Skip to content

Commit c9b21e2

Browse files
authored
Merge pull request #307 from gitcoinco/feat/navigation
Feat: add sidebar + breadcrumbs
2 parents ea7adbc + acfad6b commit c9b21e2

34 files changed

Lines changed: 1168 additions & 360 deletions

src/app/apps/[slug]/page.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Metadata } from 'next'
22
import { notFound } from 'next/navigation'
33
import { AppCard, CaseStudyCard, MechanismCard, ResearchCard, CampaignCard } from '@/components/cards'
44
import ContentDetailPage from '@/components/templates/ContentDetailPage'
5+
import { AppSidebar } from '@/components/layouts/AppSidebar'
56
import { getAppBySlug, apps } from '@/content/apps'
67
import { getCaseStudiesByPlatform, getCaseStudyBySlug } from '@/content/case-studies'
78
import { getMechanismBySlug } from '@/content/mechanisms'
@@ -80,9 +81,13 @@ export default async function AppDetailPage({ params }: PageProps) {
8081
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumb) }} />
8182
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(articleJsonLd) }} />
8283
<ContentDetailPage
84+
sidebar={<AppSidebar />}
8385
item={app}
84-
breadcrumbHref="/apps"
85-
breadcrumbLabel="Back to Apps"
86+
breadcrumbItems={[
87+
{ href: '/', label: 'Home' },
88+
{ href: '/apps', label: 'Apps' },
89+
{ label: app.name },
90+
]}
8691
showDate={false}
8792
relatedSections={[
8893
{

src/app/apps/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
SensemakingSection,
66
CategoryContent,
77
} from "@/components/layouts";
8+
import { AppSidebar } from "@/components/layouts/AppSidebar";
89
import { AppCard } from "@/components/cards";
910
import { apps, getFeaturedApps } from "@/content/apps";
1011
import { getSensemakingFor } from "@/content/research";
@@ -16,7 +17,7 @@ export const metadata: Metadata = pageSeo.apps;
1617
export default function AppsPage() {
1718
const featuredApps = getFeaturedApps(3);
1819
return (
19-
<ListPageLayout>
20+
<ListPageLayout sidebar={<AppSidebar />}>
2021
<ListPageHeader title="Apps" description="Funding platforms, DAOs, grant programs"/>
2122

2223
<SensemakingSection article={getSensemakingFor("apps")} />
@@ -26,7 +27,7 @@ export default function AppsPage() {
2627
title="Featured Apps"
2728
subtitle="Essential platforms shaping Ethereum funding"
2829
/>
29-
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
30+
<div className="grid gap-6 [grid-template-columns:repeat(auto-fit,minmax(300px,1fr))]">
3031
{featuredApps.map((app) => (
3132
<AppCard key={app.slug} app={app} variant="home" />
3233
))}

src/app/campaigns/[slug]/page.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Metadata } from 'next'
22
import { notFound } from 'next/navigation'
33
import { AppCard, MechanismCard, CaseStudyCard, ResearchCard, CampaignCard } from '@/components/cards'
44
import ContentDetailPage from '@/components/templates/ContentDetailPage'
5+
import { AppSidebar } from '@/components/layouts/AppSidebar'
56
import { getCampaignBySlug, campaigns } from '@/content/campaigns'
67
import { getAppBySlug } from '@/content/apps'
78
import { getMechanismBySlug } from '@/content/mechanisms'
@@ -103,9 +104,13 @@ export default async function CampaignDetailPage({ params }: PageProps) {
103104
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumb) }} />
104105
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(articleJsonLd) }} />
105106
<ContentDetailPage
107+
sidebar={<AppSidebar />}
106108
item={campaign}
107-
breadcrumbHref="/campaigns"
108-
breadcrumbLabel="Back to Campaigns"
109+
breadcrumbItems={[
110+
{ href: '/', label: 'Home' },
111+
{ href: '/campaigns', label: 'Campaigns' },
112+
{ label: campaign.name },
113+
]}
109114
ctaUrl={campaign.ctaUrl}
110115
ctaLabel="Visit Campaign"
111116
contentBefore={campaignStats}

src/app/campaigns/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
SensemakingSection,
88
CategoryContent,
99
} from "@/components/layouts";
10+
import { AppSidebar } from "@/components/layouts/AppSidebar";
1011
import { CampaignCard } from "@/components/cards";
1112
import { campaigns, getFeaturedCampaigns } from "@/content/campaigns";
1213
import { getSensemakingFor } from "@/content/research";
@@ -18,7 +19,7 @@ export const metadata: Metadata = pageSeo.campaigns;
1819
export default function CampaignsPage() {
1920
const featuredCampaigns = getFeaturedCampaigns(2);
2021
return (
21-
<ListPageLayout>
22+
<ListPageLayout sidebar={<AppSidebar />}>
2223
<ListPageHeader
2324
title="Funding Campaigns"
2425
description="Active or upcoming funding rounds"

src/app/case-studies/[slug]/page.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Metadata } from 'next'
22
import { notFound } from 'next/navigation'
33
import { AppCard, MechanismCard, CaseStudyCard, ResearchCard, CampaignCard } from '@/components/cards'
44
import ContentDetailPage from '@/components/templates/ContentDetailPage'
5+
import { AppSidebar } from '@/components/layouts/AppSidebar'
56
import { getCaseStudyBySlug, caseStudies } from '@/content/case-studies'
67
import { getAppBySlug } from '@/content/apps'
78
import { getMechanismBySlug } from '@/content/mechanisms'
@@ -74,9 +75,13 @@ export default async function CaseStudyDetailPage({ params }: PageProps) {
7475
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumb) }} />
7576
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(articleJsonLd) }} />
7677
<ContentDetailPage
78+
sidebar={<AppSidebar />}
7779
item={caseStudy}
78-
breadcrumbHref="/case-studies"
79-
breadcrumbLabel="Back to Case Studies"
80+
breadcrumbItems={[
81+
{ href: '/', label: 'Home' },
82+
{ href: '/case-studies', label: 'Case Studies' },
83+
{ label: caseStudy.name },
84+
]}
8085
relatedSections={[
8186
{
8287
title: 'Related Apps',

src/app/case-studies/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
SensemakingSection,
88
CategoryContent,
99
} from "@/components/layouts";
10+
import { AppSidebar } from "@/components/layouts/AppSidebar";
1011
import { caseStudies } from "@/content/case-studies";
1112
import { getSensemakingFor } from "@/content/research";
1213
import SectionHeader from "@/components/ui/SectionHeader";
@@ -15,7 +16,7 @@ export const metadata: Metadata = pageSeo.caseStudies;
1516

1617
export default function CaseStudiesPage() {
1718
return (
18-
<ListPageLayout>
19+
<ListPageLayout sidebar={<AppSidebar />}>
1920
<ListPageHeader
2021
title="Case Studies"
2122
description="Analysis of a funding experiment"

src/app/globals.css

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,15 @@
204204

205205
/* Container */
206206
.container-page {
207-
@apply max-w-7xl mx-auto px-4 sm:px-6 lg:px-24;
207+
@apply max-w-[74rem] mx-auto;
208+
padding-left: 1rem;
209+
padding-right: 1rem;
210+
}
211+
212+
.detail-page-container {
213+
@apply max-w-[800px] mx-auto;
214+
padding-left: 1rem;
215+
padding-right: 1rem;
208216
}
209217

210218
/* Star decorative element */
@@ -237,6 +245,24 @@
237245
}
238246
}
239247

248+
@media (min-width: 640px) {
249+
.container-page, .detail-page-container {
250+
padding-left: 1.5rem;
251+
padding-right: 1.5rem;
252+
}
253+
}
254+
255+
@media (min-width: 1024px) {
256+
.container-page {
257+
padding-left: 3rem;
258+
padding-right: 3rem;
259+
}
260+
.detail-page-container {
261+
padding-left: 3rem;
262+
padding-right: 3rem;
263+
}
264+
}
265+
240266
@layer utilities {
241267
/* Woodcut-style texture overlay (optional) */
242268
.texture-woodcut {

src/app/layout.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import "./globals.css";
66
import { GoogleAnalytics } from "@next/third-parties/google";
77
import Header from "@/components/layout/Header";
88
import Footer from "@/components/layout/Footer";
9-
import SearchProvider from "@/components/search/SearchProvider";
9+
import { SearchProvider } from "@/context/SearchContext";
1010
import SearchModal from "@/components/search/SearchModal";
1111
import AIChatSidebar from "@/components/search/AIChatSidebar";
12+
import { ScrollToTop } from "@/components/layout/ScrollToTop";
13+
import { SidebarProvider } from "@/context/SidebarContext";
1214

1315
const inter = Inter({
1416
subsets: ["latin"],
@@ -109,13 +111,16 @@ export default function RootLayout({
109111
className={`${inter.variable} ${bdoGrotesk.variable} ${source_serif.variable} ${ibm_plex_mono.variable}`}
110112
>
111113
<body className="min-h-screen flex flex-col">
114+
<SidebarProvider>
112115
<SearchProvider>
116+
<ScrollToTop />
113117
<Header />
114-
<main className="flex-grow pt-[72px]">{children}</main>
118+
<main className="flex-grow pt-[70px]">{children}</main>
115119
<Footer />
116120
<SearchModal />
117121
<AIChatSidebar />
118122
</SearchProvider>
123+
</SidebarProvider>
119124
</body>
120125
<GoogleAnalytics gaId="G-MYMQNTYY27" />
121126
</html>

src/app/mechanisms/[slug]/page.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Metadata } from 'next'
22
import { notFound } from 'next/navigation'
33
import { AppCard, MechanismCard, CaseStudyCard, ResearchCard, CampaignCard } from '@/components/cards'
44
import ContentDetailPage from '@/components/templates/ContentDetailPage'
5+
import { AppSidebar } from '@/components/layouts/AppSidebar'
56
import { getMechanismBySlug, mechanisms } from '@/content/mechanisms'
67
import { getAppBySlug } from '@/content/apps'
78
import { getCaseStudyBySlug } from '@/content/case-studies'
@@ -74,9 +75,13 @@ export default async function MechanismDetailPage({ params }: PageProps) {
7475
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(breadcrumb) }} />
7576
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify(articleJsonLd) }} />
7677
<ContentDetailPage
78+
sidebar={<AppSidebar />}
7779
item={mechanism}
78-
breadcrumbHref="/mechanisms"
79-
breadcrumbLabel="Back to Mechanisms"
80+
breadcrumbItems={[
81+
{ href: '/', label: 'Home' },
82+
{ href: '/mechanisms', label: 'Mechanisms' },
83+
{ label: mechanism.name },
84+
]}
8085
relatedSections={[
8186
{
8287
title: 'Related Apps',

src/app/mechanisms/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
SensemakingSection,
77
CategoryContent,
88
} from "@/components/layouts";
9+
import { AppSidebar } from "@/components/layouts/AppSidebar";
910
import { mechanisms } from "@/content/mechanisms";
1011
import { getSensemakingFor } from "@/content/research";
1112
import SectionHeader from "@/components/ui/SectionHeader";
@@ -15,7 +16,7 @@ export const metadata: Metadata = pageSeo.mechanisms;
1516

1617
export default function MechanismsPage() {
1718
return (
18-
<ListPageLayout>
19+
<ListPageLayout sidebar={<AppSidebar />}>
1920
<ListPageHeader
2021
title="Funding Mechanisms"
2122
description="Funding mechanisms and approaches"

0 commit comments

Comments
 (0)