diff --git a/packages/nextjs/app/_components/ActiveGrants.tsx b/packages/nextjs/app/_components/ActiveGrants.tsx new file mode 100644 index 0000000..4f709fb --- /dev/null +++ b/packages/nextjs/app/_components/ActiveGrants.tsx @@ -0,0 +1,54 @@ +import Image from "next/image"; +import { Address } from "~~/components/scaffold-eth"; +import { getAllActiveGrants } from "~~/services/database/grants"; +import { GrantData } from "~~/services/database/schema"; +import { formatDateFromNow } from "~~/utils/grants"; + +const ActiveGrantRow = ({ title, askAmount, builder, timestamp }: GrantData) => { + return ( + + {title} + {askAmount} ETH + +
+ + {formatDateFromNow(timestamp)} + + ); +}; + +export const ActiveGrants = async () => { + const activeGrants = await getAllActiveGrants(); + + return ( +
+
+

WIP grants

+ sparkle +
+ {activeGrants.length > 0 ? ( +
+
+ + + + + + + + + + + {activeGrants.map(grant => ( + + ))} + +
TitleFundingBuilderDate
+
+
+ ) : ( +

No active grants

+ )} +
+ ); +}; diff --git a/packages/nextjs/app/page.tsx b/packages/nextjs/app/page.tsx index c9be180..9835252 100644 --- a/packages/nextjs/app/page.tsx +++ b/packages/nextjs/app/page.tsx @@ -1,3 +1,4 @@ +import { ActiveGrants } from "./_components/ActiveGrants"; import { CommunityGrant } from "./_components/CommunityGrant"; import { CompletedGrants } from "./_components/CompletedGrants"; import { EcosystemGrants } from "./_components/EcosystemGrants"; @@ -12,6 +13,7 @@ const Home = () => { + ); };