1import classnames from "classnames";
2import Link from "next/link";
4export default function GrantPreview({ grant }) {
5 const isCompleted = grant.extra.completed;
6 const isOpen = !isCompleted && grant.extra.assignee === "";
7 const type = grant.taxonomies.grant_type;
9 const className = classnames({
10 "bg-lightBlue": type.includes("Proposal") && isOpen,
11 "bg-green-200": type.includes("Apprenticeship") && isOpen,
12 "bg-yellow-100": type.includes("Bounty") && isOpen,
18 className={`mb-4 cursor-pointer bg-wall-100 rounded-lg ${className}`}
20 <Link href={`/grants/${grant.slug}`}>
22 <div className="flex items-center mb-4">
23 <h3 className="type-ui" id={grant.slug}>
26 <div className={`bg-wall-500 text-wall-100 badge-sm ml-2`}>
27 {!isCompleted ? (isOpen ? "Open" : "In Progress") : "Completed"}
30 <p className="mb-4">{grant.extra.description}</p>
31 <div className="flex w-full flex-col md:flex-row md:items-center justify-between">
32 <p className="text-wall-500">
33 <strong>Reward: </strong>
36 <div className="flex items-center flex-wrap md:mt-0 mt-4">
37 {grant.taxonomies.grant_type.map((category) => {
38 const className = classnames({
39 "bg-blue-400 text-white": category === "Proposal",
40 "bg-green-400 text-white": category === "Apprenticeship",
41 "bg-yellow-300": category === "Bounty",
44 <div className={`${className} badge-sm mr-1 my-1`}>
49 {grant.taxonomies.grant_category.map((category) => (
50 <div className="bg-wall-500 text-wall-100 badge-sm mr-1 my-1">
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list