From 313ed48e41c5d9a5746c40a6f2e10dae02bcb12a Mon Sep 17 00:00:00 2001 From: tokodev Date: Thu, 29 Feb 2024 11:15:10 +0100 Subject: [PATCH 1/8] Add parameter to load full grants or reduced view (max-8) --- .../app/_components/CompletedGrants.tsx | 29 ++++++++++++++----- packages/nextjs/tailwind.config.js | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/packages/nextjs/app/_components/CompletedGrants.tsx b/packages/nextjs/app/_components/CompletedGrants.tsx index c961fe8..cf9ed5b 100644 --- a/packages/nextjs/app/_components/CompletedGrants.tsx +++ b/packages/nextjs/app/_components/CompletedGrants.tsx @@ -32,21 +32,36 @@ const CompletedGrantCard = ({ title, description, askAmount, builder, link, comp ); }; -export const CompletedGrants = async () => { + +export const CompletedGrants = async ({ view = "full" }) => { const completedGrants = await getAllCompletedGrants(); + const grantsToShow = view === "reduced" ? completedGrants.slice(0, 8) : completedGrants; return (
-
-
-

Completed grants

- sparkle +
+
+
+ Completed grants + sparkle +
-
- {completedGrants.map(grant => ( +
+ {grantsToShow.map(grant => ( ))}
+ {view === "reduced" && ( + + )}
); diff --git a/packages/nextjs/tailwind.config.js b/packages/nextjs/tailwind.config.js index ac22557..e62eb35 100644 --- a/packages/nextjs/tailwind.config.js +++ b/packages/nextjs/tailwind.config.js @@ -29,7 +29,7 @@ module.exports = { "--tooltip-tail": "6px", }, ".link": { - textUnderlineOffset: "2px", + textUnderlineOffset: "6px", }, ".link:hover": { opacity: "80%", From 350f874a92054f55c4a906573914f0431587a0eb Mon Sep 17 00:00:00 2001 From: tokodev Date: Thu, 29 Feb 2024 11:17:14 +0100 Subject: [PATCH 2/8] New page for all completed cards and load reduced on home --- packages/nextjs/app/completed-grants/page.tsx | 8 ++++++++ packages/nextjs/app/page.tsx | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 packages/nextjs/app/completed-grants/page.tsx diff --git a/packages/nextjs/app/completed-grants/page.tsx b/packages/nextjs/app/completed-grants/page.tsx new file mode 100644 index 0000000..79ca808 --- /dev/null +++ b/packages/nextjs/app/completed-grants/page.tsx @@ -0,0 +1,8 @@ +import { CompletedGrants } from "../_components/CompletedGrants"; +import { NextPage } from "next"; + +const SubmitGrant: NextPage = () => { + return ; +}; + +export default SubmitGrant; diff --git a/packages/nextjs/app/page.tsx b/packages/nextjs/app/page.tsx index 9835252..936e65d 100644 --- a/packages/nextjs/app/page.tsx +++ b/packages/nextjs/app/page.tsx @@ -12,7 +12,7 @@ const Home = () => { - + ); From 6ec7e46c44611de5d33892967bf28bf6f2f290aa Mon Sep 17 00:00:00 2001 From: tokodev Date: Thu, 29 Feb 2024 11:18:26 +0100 Subject: [PATCH 3/8] Manually force to show only 2 rows of cards on every rwd breakdown --- packages/nextjs/styles/globals.css | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/packages/nextjs/styles/globals.css b/packages/nextjs/styles/globals.css index 3fb55ae..3754910 100644 --- a/packages/nextjs/styles/globals.css +++ b/packages/nextjs/styles/globals.css @@ -30,3 +30,24 @@ p { .btn.btn-ghost { @apply shadow-none; } + +/* Hide elements past the 3rd on screens smaller than 768px */ +@media (max-width: 767px) { + .grant-container > :nth-child(n + 4) { + display: none; + } +} + +/* Hide elements past the 4th on screens between 768px and 1024px */ +@media (min-width: 768px) and (max-width: 1023px) { + .grant-container > :nth-child(n + 5) { + display: none; + } +} + +/* Hide elements past the 6th on screens between 1024px and 1284px */ +@media (min-width: 1024px) and (max-width: 1284px) { + .grant-container > :nth-child(n + 7) { + display: none; + } +} From 407fd8e70219e1021c0ddfb0ce35aa4ec57e52a2 Mon Sep 17 00:00:00 2001 From: tokodev Date: Thu, 29 Feb 2024 13:25:50 +0100 Subject: [PATCH 4/8] Fix completed grants section title --- packages/nextjs/app/_components/CompletedGrants.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/nextjs/app/_components/CompletedGrants.tsx b/packages/nextjs/app/_components/CompletedGrants.tsx index cf9ed5b..b4ca445 100644 --- a/packages/nextjs/app/_components/CompletedGrants.tsx +++ b/packages/nextjs/app/_components/CompletedGrants.tsx @@ -39,12 +39,10 @@ export const CompletedGrants = async ({ view = "full" }) => { return (
-
-
-
- Completed grants - sparkle -
+
+
+

Completed grants

+ sparkle
Date: Thu, 29 Feb 2024 13:33:09 +0100 Subject: [PATCH 5/8] More intuitive classname --- packages/nextjs/app/_components/CompletedGrants.tsx | 2 +- packages/nextjs/styles/globals.css | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nextjs/app/_components/CompletedGrants.tsx b/packages/nextjs/app/_components/CompletedGrants.tsx index b4ca445..aeb8084 100644 --- a/packages/nextjs/app/_components/CompletedGrants.tsx +++ b/packages/nextjs/app/_components/CompletedGrants.tsx @@ -46,7 +46,7 @@ export const CompletedGrants = async ({ view = "full" }) => {
{grantsToShow.map(grant => ( diff --git a/packages/nextjs/styles/globals.css b/packages/nextjs/styles/globals.css index 3754910..5d9e736 100644 --- a/packages/nextjs/styles/globals.css +++ b/packages/nextjs/styles/globals.css @@ -33,21 +33,21 @@ p { /* Hide elements past the 3rd on screens smaller than 768px */ @media (max-width: 767px) { - .grant-container > :nth-child(n + 4) { + .grant-container-rwd > :nth-child(n + 4) { display: none; } } /* Hide elements past the 4th on screens between 768px and 1024px */ @media (min-width: 768px) and (max-width: 1023px) { - .grant-container > :nth-child(n + 5) { + .grant-container-rwd > :nth-child(n + 5) { display: none; } } /* Hide elements past the 6th on screens between 1024px and 1284px */ @media (min-width: 1024px) and (max-width: 1284px) { - .grant-container > :nth-child(n + 7) { + .grant-container-rwd > :nth-child(n + 7) { display: none; } } From 48320f5e1e8cd2e4e0a8e97911690e8a8385a5e0 Mon Sep 17 00:00:00 2001 From: tokodev Date: Thu, 29 Feb 2024 22:58:25 +0100 Subject: [PATCH 6/8] Change view mode prop as string for a boolean --- packages/nextjs/app/_components/CompletedGrants.tsx | 8 ++++---- packages/nextjs/app/page.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/nextjs/app/_components/CompletedGrants.tsx b/packages/nextjs/app/_components/CompletedGrants.tsx index aeb8084..e13bfd2 100644 --- a/packages/nextjs/app/_components/CompletedGrants.tsx +++ b/packages/nextjs/app/_components/CompletedGrants.tsx @@ -33,9 +33,9 @@ const CompletedGrantCard = ({ title, description, askAmount, builder, link, comp ); }; -export const CompletedGrants = async ({ view = "full" }) => { +export const CompletedGrants = async ({ reducedView = false }) => { const completedGrants = await getAllCompletedGrants(); - const grantsToShow = view === "reduced" ? completedGrants.slice(0, 8) : completedGrants; + const grantsToShow = reducedView ? completedGrants.slice(0, 8) : completedGrants; return (
@@ -46,14 +46,14 @@ export const CompletedGrants = async ({ view = "full" }) => {
{grantsToShow.map(grant => ( ))}
- {view === "reduced" && ( + {reducedView && (
See all completed grants ({completedGrants.length}) diff --git a/packages/nextjs/app/page.tsx b/packages/nextjs/app/page.tsx index 936e65d..4d45e5d 100644 --- a/packages/nextjs/app/page.tsx +++ b/packages/nextjs/app/page.tsx @@ -12,7 +12,7 @@ const Home = () => { - + ); From e5758d0a67a0678ab2f5d4a53e2960426644135e Mon Sep 17 00:00:00 2001 From: tokodev Date: Fri, 1 Mar 2024 23:54:09 +0100 Subject: [PATCH 7/8] Set new completed grant card styles and section bg color --- .../app/_components/CompletedGrants.tsx | 51 ++++++++++--------- packages/nextjs/tailwind.config.js | 3 ++ 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/packages/nextjs/app/_components/CompletedGrants.tsx b/packages/nextjs/app/_components/CompletedGrants.tsx index 751976b..56fced9 100644 --- a/packages/nextjs/app/_components/CompletedGrants.tsx +++ b/packages/nextjs/app/_components/CompletedGrants.tsx @@ -5,29 +5,34 @@ import { GrantData } from "~~/services/database/schema"; const CompletedGrantCard = ({ title, description, askAmount, builder, link, completedAt }: GrantData) => { return ( -
-
- - Learn more - - {completedAt && ( -

- {new Date(completedAt).toLocaleDateString()} -

- )} -

{title}

+
+
+
+ ETH Icon + {askAmount} ETH +
+ {completedAt ? new Date(completedAt).toLocaleDateString() : ""} +
+
+

{title}

-
-
-

- {askAmount} ETH -

-

{description}

+
+
+
+
+
+

{description}

+
+
); @@ -37,7 +42,7 @@ export const CompletedGrants = async ({ limit }: { limit?: number }) => { const completedGrants = await getAllCompletedGrants(limit); return ( -
+

Completed grants

diff --git a/packages/nextjs/tailwind.config.js b/packages/nextjs/tailwind.config.js index e62eb35..ebe53d0 100644 --- a/packages/nextjs/tailwind.config.js +++ b/packages/nextjs/tailwind.config.js @@ -71,6 +71,9 @@ module.exports = { }, theme: { extend: { + colors: { + customBlue: '#D5DAFF', + }, boxShadow: { center: "0 0 12px -2px rgb(0 0 0 / 0.05)", }, From 276e41aa85c45fd3d90043a29802092bb1c45fae Mon Sep 17 00:00:00 2001 From: tokodev Date: Sat, 2 Mar 2024 00:06:45 +0100 Subject: [PATCH 8/8] Upload eth granted icon --- .../nextjs/public/assets/eth-completed-grant.png | Bin 0 -> 682 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/nextjs/public/assets/eth-completed-grant.png diff --git a/packages/nextjs/public/assets/eth-completed-grant.png b/packages/nextjs/public/assets/eth-completed-grant.png new file mode 100644 index 0000000000000000000000000000000000000000..1be90dd90375796ffd480a8c2e16362cc0a33f4b GIT binary patch literal 682 zcmV;b0#*HqP)H_+Kb*^`iWyuTt%^M5{~wUo!bL&3phHVZoQ&+>8wQASgbegfFcvXSlF4B)2ZS zVo#S4-f&ulm1+sQJ2bAb%7 literal 0 HcmV?d00001