From d163fbebd5dc7314673397484099d1ab833467b0 Mon Sep 17 00:00:00 2001 From: John Ballesteros Date: Wed, 6 Nov 2024 13:37:19 +0800 Subject: [PATCH] refactor: update grant-impact route and cta text --- .../[grantId]/@list/default.tsx | 0 .../[grantId]/@list/loading.tsx | 0 .../[grantId]/@list/page.tsx | 0 .../[grantId]/grantees/[granteeId]/loading.tsx | 0 .../[grantId]/grantees/[granteeId]/page.tsx | 0 .../projects/[projectId]/[tab]/loading.tsx | 0 .../projects/[projectId]/[tab]/page.tsx | 0 .../[granteeId]/projects/[projectId]/loading.tsx | 0 .../[granteeId]/projects/[projectId]/page.tsx | 0 .../grantees/[granteeId]/projects/page.tsx | 0 .../[grantId]/grantees/page.tsx | 0 .../{grants => grant-impact}/[grantId]/layout.tsx | 0 .../{grants => grant-impact}/[grantId]/loading.tsx | 0 .../{grants => grant-impact}/[grantId]/page.tsx | 0 src/app/{grants => grant-impact}/page.tsx | 0 src/grants/components/grant-list/apply-button.tsx | 5 +++-- .../components/grant-list/grant-list-item.tsx | 8 +++++--- .../components/grant-list/grant-list-items.tsx | 10 ++++++++-- src/grants/components/grant-list/grant-list.tsx | 2 +- .../grantee-card/grantee-card.stories.tsx | 4 +++- .../grantee-list/item/client-wrapper.tsx | 3 ++- .../project-selections.stories.tsx | 4 +++- .../project-selections/project-selections.tsx | 4 +++- .../project-stats/project-stats.stories.tsx | 4 +++- .../project-tab-selection.stories.tsx | 4 +++- .../project-tab-selection.tsx | 4 +++- src/grants/components/ui/grantee-funding-items.tsx | 2 +- src/grants/core/schemas.ts | 2 +- .../pages/grant-page-layout/grant-page-layout.tsx | 4 +++- .../pages/route-stories/[grantId].stories.tsx | 3 ++- .../pages/route-stories/[granteeId].stories.tsx | 3 ++- .../pages/route-stories/[projectId].stories.tsx | 3 ++- src/grants/pages/route-stories/[tab].stories.tsx | 11 ++++++----- src/home/components/footer.tsx | 10 ++++++---- src/home/pages/home-page.tsx | 14 ++++++-------- src/shared/components/nav/sections.tsx | 2 +- src/shared/core/constants.ts | 7 ++++--- 37 files changed, 71 insertions(+), 42 deletions(-) rename src/app/{grants => grant-impact}/[grantId]/@list/default.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/@list/loading.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/@list/page.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/grantees/[granteeId]/loading.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/grantees/[granteeId]/page.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/grantees/[granteeId]/projects/[projectId]/[tab]/loading.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/grantees/[granteeId]/projects/[projectId]/[tab]/page.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/grantees/[granteeId]/projects/[projectId]/loading.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/grantees/[granteeId]/projects/[projectId]/page.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/grantees/[granteeId]/projects/page.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/grantees/page.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/layout.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/loading.tsx (100%) rename src/app/{grants => grant-impact}/[grantId]/page.tsx (100%) rename src/app/{grants => grant-impact}/page.tsx (100%) diff --git a/src/app/grants/[grantId]/@list/default.tsx b/src/app/grant-impact/[grantId]/@list/default.tsx similarity index 100% rename from src/app/grants/[grantId]/@list/default.tsx rename to src/app/grant-impact/[grantId]/@list/default.tsx diff --git a/src/app/grants/[grantId]/@list/loading.tsx b/src/app/grant-impact/[grantId]/@list/loading.tsx similarity index 100% rename from src/app/grants/[grantId]/@list/loading.tsx rename to src/app/grant-impact/[grantId]/@list/loading.tsx diff --git a/src/app/grants/[grantId]/@list/page.tsx b/src/app/grant-impact/[grantId]/@list/page.tsx similarity index 100% rename from src/app/grants/[grantId]/@list/page.tsx rename to src/app/grant-impact/[grantId]/@list/page.tsx diff --git a/src/app/grants/[grantId]/grantees/[granteeId]/loading.tsx b/src/app/grant-impact/[grantId]/grantees/[granteeId]/loading.tsx similarity index 100% rename from src/app/grants/[grantId]/grantees/[granteeId]/loading.tsx rename to src/app/grant-impact/[grantId]/grantees/[granteeId]/loading.tsx diff --git a/src/app/grants/[grantId]/grantees/[granteeId]/page.tsx b/src/app/grant-impact/[grantId]/grantees/[granteeId]/page.tsx similarity index 100% rename from src/app/grants/[grantId]/grantees/[granteeId]/page.tsx rename to src/app/grant-impact/[grantId]/grantees/[granteeId]/page.tsx diff --git a/src/app/grants/[grantId]/grantees/[granteeId]/projects/[projectId]/[tab]/loading.tsx b/src/app/grant-impact/[grantId]/grantees/[granteeId]/projects/[projectId]/[tab]/loading.tsx similarity index 100% rename from src/app/grants/[grantId]/grantees/[granteeId]/projects/[projectId]/[tab]/loading.tsx rename to src/app/grant-impact/[grantId]/grantees/[granteeId]/projects/[projectId]/[tab]/loading.tsx diff --git a/src/app/grants/[grantId]/grantees/[granteeId]/projects/[projectId]/[tab]/page.tsx b/src/app/grant-impact/[grantId]/grantees/[granteeId]/projects/[projectId]/[tab]/page.tsx similarity index 100% rename from src/app/grants/[grantId]/grantees/[granteeId]/projects/[projectId]/[tab]/page.tsx rename to src/app/grant-impact/[grantId]/grantees/[granteeId]/projects/[projectId]/[tab]/page.tsx diff --git a/src/app/grants/[grantId]/grantees/[granteeId]/projects/[projectId]/loading.tsx b/src/app/grant-impact/[grantId]/grantees/[granteeId]/projects/[projectId]/loading.tsx similarity index 100% rename from src/app/grants/[grantId]/grantees/[granteeId]/projects/[projectId]/loading.tsx rename to src/app/grant-impact/[grantId]/grantees/[granteeId]/projects/[projectId]/loading.tsx diff --git a/src/app/grants/[grantId]/grantees/[granteeId]/projects/[projectId]/page.tsx b/src/app/grant-impact/[grantId]/grantees/[granteeId]/projects/[projectId]/page.tsx similarity index 100% rename from src/app/grants/[grantId]/grantees/[granteeId]/projects/[projectId]/page.tsx rename to src/app/grant-impact/[grantId]/grantees/[granteeId]/projects/[projectId]/page.tsx diff --git a/src/app/grants/[grantId]/grantees/[granteeId]/projects/page.tsx b/src/app/grant-impact/[grantId]/grantees/[granteeId]/projects/page.tsx similarity index 100% rename from src/app/grants/[grantId]/grantees/[granteeId]/projects/page.tsx rename to src/app/grant-impact/[grantId]/grantees/[granteeId]/projects/page.tsx diff --git a/src/app/grants/[grantId]/grantees/page.tsx b/src/app/grant-impact/[grantId]/grantees/page.tsx similarity index 100% rename from src/app/grants/[grantId]/grantees/page.tsx rename to src/app/grant-impact/[grantId]/grantees/page.tsx diff --git a/src/app/grants/[grantId]/layout.tsx b/src/app/grant-impact/[grantId]/layout.tsx similarity index 100% rename from src/app/grants/[grantId]/layout.tsx rename to src/app/grant-impact/[grantId]/layout.tsx diff --git a/src/app/grants/[grantId]/loading.tsx b/src/app/grant-impact/[grantId]/loading.tsx similarity index 100% rename from src/app/grants/[grantId]/loading.tsx rename to src/app/grant-impact/[grantId]/loading.tsx diff --git a/src/app/grants/[grantId]/page.tsx b/src/app/grant-impact/[grantId]/page.tsx similarity index 100% rename from src/app/grants/[grantId]/page.tsx rename to src/app/grant-impact/[grantId]/page.tsx diff --git a/src/app/grants/page.tsx b/src/app/grant-impact/page.tsx similarity index 100% rename from src/app/grants/page.tsx rename to src/app/grant-impact/page.tsx diff --git a/src/grants/components/grant-list/apply-button.tsx b/src/grants/components/grant-list/apply-button.tsx index e670764..42afc6a 100644 --- a/src/grants/components/grant-list/apply-button.tsx +++ b/src/grants/components/grant-list/apply-button.tsx @@ -6,13 +6,14 @@ import { openNewTab } from '@/shared/utils/open-new-tab'; interface Props { url: string | null; + text?: string; } /** * Need to implement this as button (instead of link) to avoid nested links * Parent card is already a link, so it'll throw react minification error */ -export const ApplyButton = ({ url }: Props) => { +export const ApplyButton = ({ url, text = 'Apply' }: Props) => { if (!url) return null; const onClick: React.MouseEventHandler = (e) => { @@ -26,7 +27,7 @@ export const ApplyButton = ({ url }: Props) => { className="is-active mx-auto w-full font-semibold text-black" onClick={onClick} > - Apply + {text} ); }; diff --git a/src/grants/components/grant-list/grant-list-item.tsx b/src/grants/components/grant-list/grant-list-item.tsx index 1e464e7..db3b8cc 100644 --- a/src/grants/components/grant-list/grant-list-item.tsx +++ b/src/grants/components/grant-list/grant-list-item.tsx @@ -2,6 +2,7 @@ import Link from 'next/link'; import { Avatar } from '@nextui-org/react'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; import { cn } from '@/shared/utils/cn'; import { getLogoUrl } from '@/shared/utils/get-logo-url'; @@ -17,9 +18,10 @@ import { CaretRightIcon } from '@/grants/components/ui/icons/caret-right-icon'; interface Props { grant: Grant; isLink?: boolean; + ctaText?: string; } -export const GrantListItem = ({ grant, isLink = true }: Props) => { +export const GrantListItem = ({ grant, isLink = true, ctaText }: Props) => { // TODO: JOB-679 const { @@ -94,7 +96,7 @@ export const GrantListItem = ({ grant, isLink = true }: Props) => {
- +
@@ -107,7 +109,7 @@ export const GrantListItem = ({ grant, isLink = true }: Props) => { return ( { - const { grants, error, inViewRef, hasNextPage, isPending, isLink } = props; + const { grants, error, inViewRef, hasNextPage, isPending, isLink, ctaText } = + props; const lastItem = useMemo(() => { if (error) return

Error: {error.message}

; @@ -42,7 +44,11 @@ export const GrantListItems = (props: Props) => { {(index) => (
- +
)}
diff --git a/src/grants/components/grant-list/grant-list.tsx b/src/grants/components/grant-list/grant-list.tsx index e7d2a77..f6c5043 100644 --- a/src/grants/components/grant-list/grant-list.tsx +++ b/src/grants/components/grant-list/grant-list.tsx @@ -6,7 +6,7 @@ import { useGrantList } from './use-grant-list'; export const FetchedGrantList = () => { const props = useGrantList('inactive'); - return ; + return ; }; export const GrantList = () => { diff --git a/src/grants/components/grantee-card/grantee-card.stories.tsx b/src/grants/components/grantee-card/grantee-card.stories.tsx index 6f877c6..ed205ec 100644 --- a/src/grants/components/grantee-card/grantee-card.stories.tsx +++ b/src/grants/components/grantee-card/grantee-card.stories.tsx @@ -1,5 +1,7 @@ import { Meta, StoryObj } from '@storybook/react'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; + import { MockInfiniteQueryResult, MockQueryResult, @@ -30,7 +32,7 @@ const meta: Meta = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}`, segments: [['grantId', grantId]], }, }, diff --git a/src/grants/components/grantee-list/item/client-wrapper.tsx b/src/grants/components/grantee-list/item/client-wrapper.tsx index 2e42087..9b89b87 100644 --- a/src/grants/components/grantee-list/item/client-wrapper.tsx +++ b/src/grants/components/grantee-list/item/client-wrapper.tsx @@ -3,6 +3,7 @@ import Link from 'next/link'; import { useParams } from 'next/navigation'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; import { cn } from '@/shared/utils/cn'; import { GRANT_TEST_IDS } from '@/grants/core/constants'; @@ -22,7 +23,7 @@ export const ClientWrapper = ({ }: Props) => { const params = useParams(); - const href = `/grants/${params.grantId}/grantees/${granteeId}`; + const href = `/${ROUTE_SECTIONS.GRANT_IMPACT}/${params.grantId}/grantees/${granteeId}`; const isActive = isActiveBypass || params.granteeId === granteeId; return ( diff --git a/src/grants/components/project-selections/project-selections.stories.tsx b/src/grants/components/project-selections/project-selections.stories.tsx index 06559fd..6b5da95 100644 --- a/src/grants/components/project-selections/project-selections.stories.tsx +++ b/src/grants/components/project-selections/project-selections.stories.tsx @@ -2,6 +2,8 @@ import { Meta, StoryObj } from '@storybook/react'; import { faker } from '@faker-js/faker'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; + import { MockInfiniteQueryResult, MockQueryResult, @@ -34,7 +36,7 @@ const meta: Meta = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}`, segments: [['grantId', grantId]], }, }, diff --git a/src/grants/components/project-selections/project-selections.tsx b/src/grants/components/project-selections/project-selections.tsx index f8bad5b..d0aa373 100644 --- a/src/grants/components/project-selections/project-selections.tsx +++ b/src/grants/components/project-selections/project-selections.tsx @@ -2,6 +2,8 @@ import { useParams } from 'next/navigation'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; + import { useGranteeFetch } from '@/grants/hooks/use-grantee-fetch'; import { TabSelectionsSkeleton } from '@/grants/components/tab-selections-skeleton'; @@ -33,7 +35,7 @@ export const ProjectSelections = () => { if (errorMessage) return null; if (!granteeData?.data) return null; - const baseHref = `/grants/${grantId}/grantees/${granteeData.data.slug}/projects`; + const baseHref = `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}/grantees/${granteeData.data.slug}/projects`; return (
diff --git a/src/grants/components/project-stats/project-stats.stories.tsx b/src/grants/components/project-stats/project-stats.stories.tsx index be44a10..1ec755e 100644 --- a/src/grants/components/project-stats/project-stats.stories.tsx +++ b/src/grants/components/project-stats/project-stats.stories.tsx @@ -2,6 +2,8 @@ import { Meta, StoryObj } from '@storybook/react'; import { faker } from '@faker-js/faker'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; + import { MockInfiniteQueryResult, MockQueryResult, @@ -34,7 +36,7 @@ const meta: Meta = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}`, segments: [['grantId', grantId]], }, }, diff --git a/src/grants/components/project-tab-selections/project-tab-selection.stories.tsx b/src/grants/components/project-tab-selections/project-tab-selection.stories.tsx index c75457e..654ba13 100644 --- a/src/grants/components/project-tab-selections/project-tab-selection.stories.tsx +++ b/src/grants/components/project-tab-selections/project-tab-selection.stories.tsx @@ -2,6 +2,8 @@ import { Meta, StoryObj } from '@storybook/react'; import { faker } from '@faker-js/faker'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; + import { MockInfiniteQueryResult, MockQueryResult, @@ -34,7 +36,7 @@ const meta: Meta = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}`, segments: [['grantId', grantId]], }, }, diff --git a/src/grants/components/project-tab-selections/project-tab-selection.tsx b/src/grants/components/project-tab-selections/project-tab-selection.tsx index 9c98212..b4339ef 100644 --- a/src/grants/components/project-tab-selections/project-tab-selection.tsx +++ b/src/grants/components/project-tab-selections/project-tab-selection.tsx @@ -5,6 +5,8 @@ import { useParams } from 'next/navigation'; import { cn } from '@nextui-org/react'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; + import { useGranteeFetch } from '@/grants/hooks/use-grantee-fetch'; import { TabSelectionsSkeleton } from '@/grants/components/tab-selections-skeleton'; @@ -42,7 +44,7 @@ export const ProjectTabSelection = () => { if (!currentProject?.tabs?.length) return null; - const baseHref = `/grants/${grantId}/grantees/${granteeData.data.slug}/projects`; + const baseHref = `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}/grantees/${granteeData.data.slug}/projects`; const activeTab = tab || currentProject.tabs[0].tab; diff --git a/src/grants/components/ui/grantee-funding-items.tsx b/src/grants/components/ui/grantee-funding-items.tsx index f56020d..a931382 100644 --- a/src/grants/components/ui/grantee-funding-items.tsx +++ b/src/grants/components/ui/grantee-funding-items.tsx @@ -18,7 +18,7 @@ const createFundingItems = ({ icon: , label: 'Last Funding:', value: ( - {`$${formatNumber(lastFundingAmount)} ${lastFundingUnit}`} + {`${formatNumber(lastFundingAmount)} ${lastFundingUnit}`} ), }, ...conditionalItem(!!lastFundingDate, { diff --git a/src/grants/core/schemas.ts b/src/grants/core/schemas.ts index e25f704..a58fbad 100644 --- a/src/grants/core/schemas.ts +++ b/src/grants/core/schemas.ts @@ -107,7 +107,7 @@ export const granteeItemSchema = z.object({ logoUrl: z.string().nullable(), lastFundingDate: z.number().nullable(), lastFundingAmount: z.number(), - lastFundingUnit: z.string(), + lastFundingUnit: z.string().optional(), }); export type GranteeItem = z.infer; diff --git a/src/grants/pages/grant-page-layout/grant-page-layout.tsx b/src/grants/pages/grant-page-layout/grant-page-layout.tsx index 56e922c..7b175b8 100644 --- a/src/grants/pages/grant-page-layout/grant-page-layout.tsx +++ b/src/grants/pages/grant-page-layout/grant-page-layout.tsx @@ -1,5 +1,7 @@ import dynamic from 'next/dynamic'; +import { HREFS } from '@/shared/core/constants'; + import { Grant } from '@/grants/core/schemas'; import { GrantBackButton } from '@/grants/components/grant-back-button'; @@ -24,7 +26,7 @@ export const GrantPageLayout = ({ list, grant, children }: Props) => {
} + backButton={} />
diff --git a/src/grants/pages/route-stories/[grantId].stories.tsx b/src/grants/pages/route-stories/[grantId].stories.tsx index cd16add..8dfe600 100644 --- a/src/grants/pages/route-stories/[grantId].stories.tsx +++ b/src/grants/pages/route-stories/[grantId].stories.tsx @@ -2,6 +2,7 @@ import { Meta, StoryObj } from '@storybook/react'; import { faker } from '@faker-js/faker'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; import { NavLayout } from '@/shared/components/nav-space-layout'; import { @@ -50,7 +51,7 @@ const meta: Meta = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}`, segments: [['grantId', grantId]], }, }, diff --git a/src/grants/pages/route-stories/[granteeId].stories.tsx b/src/grants/pages/route-stories/[granteeId].stories.tsx index 2ddfe63..3116498 100644 --- a/src/grants/pages/route-stories/[granteeId].stories.tsx +++ b/src/grants/pages/route-stories/[granteeId].stories.tsx @@ -2,6 +2,7 @@ import { Meta, StoryObj } from '@storybook/react'; import { faker } from '@faker-js/faker'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; import { NavLayout } from '@/shared/components/nav-space-layout'; import { @@ -49,7 +50,7 @@ const meta: Meta = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}/grantees/${granteeId}`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}/grantees/${granteeId}`, segments: [ ['grantId', grantId], ['granteeId', granteeId], diff --git a/src/grants/pages/route-stories/[projectId].stories.tsx b/src/grants/pages/route-stories/[projectId].stories.tsx index fc0d04f..2d3a630 100644 --- a/src/grants/pages/route-stories/[projectId].stories.tsx +++ b/src/grants/pages/route-stories/[projectId].stories.tsx @@ -2,6 +2,7 @@ import { Meta, StoryObj } from '@storybook/react'; import { faker } from '@faker-js/faker'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; import { NavLayout } from '@/shared/components/nav-space-layout'; import { @@ -48,7 +49,7 @@ const meta: Meta = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}/grantees/${granteeId}/projects/${projectId}`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}/grantees/${granteeId}/projects/${projectId}`, segments: [ ['grantId', grantId], ['granteeId', granteeId], diff --git a/src/grants/pages/route-stories/[tab].stories.tsx b/src/grants/pages/route-stories/[tab].stories.tsx index acef813..4096c4c 100644 --- a/src/grants/pages/route-stories/[tab].stories.tsx +++ b/src/grants/pages/route-stories/[tab].stories.tsx @@ -2,6 +2,7 @@ import { Meta, StoryObj } from '@storybook/react'; import { faker } from '@faker-js/faker'; +import { ROUTE_SECTIONS } from '@/shared/core/constants'; import { NavLayout } from '@/shared/components/nav-space-layout'; import { @@ -51,7 +52,7 @@ export const Default: Story = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}/grantees/${granteeId}/projects/summary`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}/grantees/${granteeId}/projects/summary`, segments: [ ['grantId', grantId], ['granteeId', granteeId], @@ -79,7 +80,7 @@ export const ImpactMetrics: Story = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}/grantees/${granteeId}/projects/impact-metrics`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}/grantees/${granteeId}/projects/impact-metrics`, segments: [ ['grantId', grantId], ['granteeId', granteeId], @@ -107,7 +108,7 @@ export const GithubMetrics: Story = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}/grantees/${granteeId}/projects/github-metrics`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}/grantees/${granteeId}/projects/github-metrics`, segments: [ ['grantId', grantId], ['granteeId', granteeId], @@ -135,7 +136,7 @@ export const CodeMetrics: Story = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}/grantees/${granteeId}/projects/code-metrics`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}/grantees/${granteeId}/projects/code-metrics`, segments: [ ['grantId', grantId], ['granteeId', granteeId], @@ -163,7 +164,7 @@ export const ContractAddress: Story = { parameters: { nextjs: { navigation: { - pathname: `/grants/${grantId}/grantees/${granteeId}/projects/contract-address`, + pathname: `/${ROUTE_SECTIONS.GRANT_IMPACT}/${grantId}/grantees/${granteeId}/projects/contract-address`, segments: [ ['grantId', grantId], ['granteeId', granteeId], diff --git a/src/home/components/footer.tsx b/src/home/components/footer.tsx index 6cf5fbb..63d9966 100644 --- a/src/home/components/footer.tsx +++ b/src/home/components/footer.tsx @@ -1,6 +1,8 @@ import Image from 'next/image'; import Link from 'next/link'; +import { HREFS } from '@/shared/core/constants'; + import { FarcasterIcon } from '@/home/components/icons/farcaster'; import { TelegramIcon } from '@/home/components/icons/telegram'; import { TwitterIcon } from '@/home/components/icons/twitter'; @@ -37,16 +39,16 @@ export const Footer = () => {
  • - Projects + Projects
  • - Organizations + Organizations
  • - VC + Active Grants
  • - Grants + Grant Impact
diff --git a/src/home/pages/home-page.tsx b/src/home/pages/home-page.tsx index 78e265d..281abf7 100644 --- a/src/home/pages/home-page.tsx +++ b/src/home/pages/home-page.tsx @@ -5,6 +5,8 @@ import React from 'react'; import { Button } from '@nextui-org/react'; +import { HREFS } from '@/shared/core/constants'; + import { FeatureSwiper } from '@/home/components/feature-swiper'; import { Footer } from '@/home/components/footer'; import { FlashIcon } from '@/home/components/icons/flash'; @@ -21,9 +23,7 @@ export const HomePage = () => {
- - - +
@@ -39,7 +39,7 @@ export const HomePage = () => {
- - - +

diff --git a/src/shared/components/nav/sections.tsx b/src/shared/components/nav/sections.tsx index b1eb8ae..f42d4e1 100644 --- a/src/shared/components/nav/sections.tsx +++ b/src/shared/components/nav/sections.tsx @@ -34,7 +34,7 @@ const SECTIONS = [ }, { text: A11Y.LINK.NAV.GRANTS, - href: HREFS.GRANTS_PAGE, + href: HREFS.GRANT_IMPACT_PAGE, }, ], }, diff --git a/src/shared/core/constants.ts b/src/shared/core/constants.ts index 08d0a41..5457dc8 100644 --- a/src/shared/core/constants.ts +++ b/src/shared/core/constants.ts @@ -1,7 +1,8 @@ export const ROUTE_SECTIONS = { ORGS: 'organizations' as const, PROJECTS: 'projects' as const, - GRANTS: 'grants' as const, + ACTIVE_GRANTS: 'active-grants' as const, + GRANT_IMPACT: 'grant-impact' as const, } as const; export type RouteSection = (typeof ROUTE_SECTIONS)[keyof typeof ROUTE_SECTIONS]; @@ -20,8 +21,8 @@ export const HREFS = { HOME_PAGE: '/', ORGS_PAGE: `/${ROUTE_SECTIONS.ORGS}`, PROJECTS_PAGE: `/${ROUTE_SECTIONS.PROJECTS}`, - GRANTS_PAGE: `/${ROUTE_SECTIONS.GRANTS}`, - ACTIVE_GRANTS_PAGE: `/active-${ROUTE_SECTIONS.GRANTS}`, + GRANT_IMPACT_PAGE: `/${ROUTE_SECTIONS.GRANT_IMPACT}`, + ACTIVE_GRANTS_PAGE: `/active-${ROUTE_SECTIONS.ACTIVE_GRANTS}`, } as const; export const A11Y = {