Skip to content

Commit a4edda2

Browse files
committed
Remove RightToTrialActPage and implement domain-specific navigation
Deleted the RightToTrialActPage component and replaced static navigation links with dynamic domain-specific ones. Added configurations for dfda and wishonia domains, allowing tailored navigation setups for each, and updated related components to utilize the new navigation structure. Took 24 minutes
1 parent 7e3f84c commit a4edda2

File tree

12 files changed

+232
-123
lines changed

12 files changed

+232
-123
lines changed

app/dfda/components/DFDAFooter.tsx

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,40 @@
1-
'use client'
1+
"use client"
22

3-
export default function DFDAFooter() {
3+
import Link from "next/link"
4+
import { NavItem } from "@/types"
5+
6+
interface DFDAFooterProps {
7+
navItems?: NavItem[]
8+
}
9+
10+
export default function DFDAFooter({ navItems = [] }: DFDAFooterProps) {
411
return (
512
<footer className="mt-12 rounded-xl border-4 border-black bg-white p-4 text-center font-bold shadow-[8px_8px_0px_0px_rgba(0,0,0,1)]">
6-
<p>&copy; 2023 dFDA - Empowering patients, revolutionizing healthcare 🚀</p>
13+
<div className="mb-4">
14+
<ul className="flex flex-wrap justify-center gap-4">
15+
{navItems.map((item, index) => (
16+
<li key={index}>
17+
{item.external ? (
18+
<a
19+
href={item.href}
20+
target="_blank"
21+
rel="noopener noreferrer"
22+
className="hover:underline"
23+
>
24+
{item.title}
25+
</a>
26+
) : (
27+
<Link href={item.href} className="hover:underline">
28+
{item.title}
29+
</Link>
30+
)}
31+
</li>
32+
))}
33+
</ul>
34+
</div>
35+
<p>
36+
&copy; 2023 dFDA - Empowering patients, revolutionizing healthcare 🚀
37+
</p>
738
</footer>
839
)
9-
}
40+
}

app/dfda/components/DfdaTopNavbar.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,33 @@ import Link from "next/link"
55
import { NavItem } from "@/types"
66
import { User } from "next-auth"
77

8-
import { dfdaAvatarNav, generalDashboardTopNav } from "@/config/links"
8+
import { getNavigationForDomain } from "@/config/navigation"
99
import { UserNavDisplay } from "@/components/user/user-nav-display"
10+
1011
import { DfdaLogoNavMenu } from "./dfda-logo-nav"
1112

1213
interface NavbarProps extends React.HTMLAttributes<HTMLDivElement> {
1314
user: Pick<User, "name" | "image" | "email">
15+
domain?: string
1416
logoNavItems?: NavItem[]
1517
topNavItems?: NavItem[]
1618
avatarNavItems?: NavItem[]
1719
}
1820

1921
export default function DfdaTopNavbar({
2022
user,
23+
domain = "dfda.earth",
2124
logoNavItems,
2225
topNavItems,
2326
avatarNavItems,
2427
}: NavbarProps) {
28+
const navigation = getNavigationForDomain(domain)
29+
2530
if (!topNavItems) {
26-
topNavItems = generalDashboardTopNav.data
31+
topNavItems = navigation.topNav
2732
}
28-
if(!avatarNavItems) {
29-
avatarNavItems = dfdaAvatarNav.data
33+
if (!avatarNavItems) {
34+
avatarNavItems = navigation.avatarNav
3035
}
3136
return (
3237
<header className="select-none">

app/dfda/components/right-to-trial-act.tsx

Lines changed: 0 additions & 70 deletions
This file was deleted.

app/dfda/layout.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import React from "react"
22

3+
import { getNavigationForDomain } from "@/config/navigation"
34
import { getCurrentUser } from "@/lib/session"
5+
6+
import DFDAFooter from "./components/DFDAFooter"
47
import DfdaTopNavbar from "./components/DfdaTopNavbar"
5-
import DFDAFooter from './components/DFDAFooter'
68

7-
interface DashboardLayoutProps {
9+
interface DFDALayoutProps {
810
children: React.ReactNode
911
}
1012

11-
export default async function DashboardLayout({
12-
children,
13-
}: DashboardLayoutProps) {
13+
export default async function DFDALayout({ children }: DFDALayoutProps) {
1414
const user = await getCurrentUser()
15+
const navigation = getNavigationForDomain("dfda.earth")
1516

1617
return (
1718
<div className="flex min-h-screen flex-col bg-gradient-to-br from-cyan-300 to-purple-400 p-4 font-mono text-black md:p-8">
@@ -21,13 +22,13 @@ export default async function DashboardLayout({
2122
image: user?.image,
2223
email: user?.email,
2324
}}
25+
topNavItems={navigation.topNav}
26+
avatarNavItems={navigation.avatarNav}
2427
/>
25-
<main className="flex-1">
26-
{children}
27-
</main>
28+
<main className="flex-1">{children}</main>
2829
<div className="px-4 pb-4">
29-
<DFDAFooter />
30+
<DFDAFooter navItems={navigation.footerNav} />
3031
</div>
3132
</div>
3233
)
33-
}
34+
}

app/dfda/right-to-trial-act/components/right-to-trial-act.tsx

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
'use client';
2-
3-
import React, { useState } from 'react';
4-
import { motion } from 'framer-motion';
5-
6-
1+
"use client"
72

3+
import React, { useState } from "react"
4+
import { motion } from "framer-motion"
85

6+
import CostSavingsTable from "../../components/CostSavingsTable"
97

108
// First, let's define the interfaces
119
interface Section {
@@ -47,11 +45,17 @@ const Header = () => (
4745
<h1 className="mb-4 text-5xl font-black uppercase tracking-tight">
4846
RIGHT TO TRIAL ACT 🧪💊
4947
</h1>
50-
<p className="text-xl font-bold">Faster Cures, Lower Costs, Universal Access 🚀🏥</p>
48+
<p className="text-xl font-bold">
49+
Faster Cures, Lower Costs, Universal Access 🚀🏥
50+
</p>
5151
</header>
5252
)
5353

54-
const Navigation = ({ sections, activeSection, setActiveSection }: NavigationProps) => (
54+
const Navigation = ({
55+
sections,
56+
activeSection,
57+
setActiveSection,
58+
}: NavigationProps) => (
5559
<nav className="mb-8 flex flex-wrap justify-center gap-4">
5660
{sections.map((section) => (
5761
<button
@@ -70,12 +74,14 @@ const Navigation = ({ sections, activeSection, setActiveSection }: NavigationPro
7074
)
7175

7276
const Card = ({ title, items, bgColor }: CardProps) => (
73-
<div className={`rounded-lg border-2 border-black ${bgColor} p-4 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]`}>
77+
<div
78+
className={`rounded-lg border-2 border-black ${bgColor} p-4 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]`}
79+
>
7480
<h3 className="mb-4 text-xl font-bold">{title}</h3>
7581
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
7682
{items.map((item, index) => (
77-
<div
78-
key={index}
83+
<div
84+
key={index}
7985
className="rounded-lg border-2 border-black bg-white p-4 shadow-[2px_2px_0px_0px_rgba(0,0,0,1)] transition-transform hover:translate-x-[1px] hover:translate-y-[1px] hover:shadow-none"
8086
>
8187
<div className="text-center">
@@ -89,7 +95,9 @@ const Card = ({ title, items, bgColor }: CardProps) => (
8995
)
9096

9197
const ListCard = ({ title, items, bgColor }: ListCardProps) => (
92-
<div className={`rounded-lg border-2 border-black ${bgColor} p-4 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]`}>
98+
<div
99+
className={`rounded-lg border-2 border-black ${bgColor} p-4 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]`}
100+
>
93101
<h3 className="mb-4 text-xl font-bold">{title}</h3>
94102
<div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
95103
{items.map((item, index) => (
@@ -113,8 +121,14 @@ const Overview = ({ problems, solutions }: OverviewProps) => (
113121
>
114122
<h2 className="mb-4 text-3xl font-black">Overview & Findings 📜</h2>
115123
<h3 className="mb-2 text-xl font-bold">Title 🏷️</h3>
116-
<p className="mb-4 text-lg">This Act may be cited as the "Right to Trial Act" 📋</p>
117-
<Card title="Core Problems This Act Solves 🛠️" items={problems} bgColor="bg-red-200" />
124+
<p className="mb-4 text-lg">
125+
This Act may be cited as the "Right to Trial Act" 📋
126+
</p>
127+
<Card
128+
title="Core Problems This Act Solves 🛠️"
129+
items={problems}
130+
bgColor="bg-red-200"
131+
/>
118132
<Card title="The Solution 💡" items={solutions} bgColor="bg-green-200" />
119133
<ListCard
120134
title="Economic Impact 📈"
@@ -137,7 +151,9 @@ const OpenTrialPlatform = () => (
137151
transition={{ duration: 0.5 }}
138152
className="rounded-lg border-4 border-black bg-white p-6 shadow-[8px_8px_0px_0px_rgba(0,0,0,1)]"
139153
>
140-
<h2 className="mb-4 text-3xl font-black">Open Source Global Decentralized Trial Platform 🌐💻</h2>
154+
<h2 className="mb-4 text-3xl font-black">
155+
Open Source Global Decentralized Trial Platform 🌐💻
156+
</h2>
141157
<div className="space-y-4">
142158
<ListCard
143159
title="Revolutionary Safety & Efficacy Testing 🔬"
@@ -210,6 +226,9 @@ const OpenTrialPlatform = () => (
210226
]}
211227
bgColor="bg-blue-200"
212228
/>
229+
<section className="mt-12">
230+
<CostSavingsTable />
231+
</section>
213232
</div>
214233
</motion.section>
215234
)
@@ -221,7 +240,9 @@ const UniversalAccess = () => (
221240
transition={{ duration: 0.5 }}
222241
className="rounded-lg border-4 border-black bg-white p-6 shadow-[8px_8px_0px_0px_rgba(0,0,0,1)]"
223242
>
224-
<h2 className="mb-4 text-3xl font-black">Universal Access to Treatments 🚪</h2>
243+
<h2 className="mb-4 text-3xl font-black">
244+
Universal Access to Treatments 🚪
245+
</h2>
225246
<div className="space-y-4">
226247
<ListCard
227248
title="Breaking Down All Barriers 🧱💥"
@@ -281,11 +302,17 @@ const FinancialIncentives = () => (
281302
bgColor="bg-green-200"
282303
/>
283304
<div className="rounded-lg border-2 border-black bg-yellow-200 p-4 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)]">
284-
<h3 className="mb-2 text-xl font-bold">Healthcare Savings Sharing Program 💰🤝</h3>
285-
<p className="mb-2 font-bold text-lg">Win-Win: Manufacturers and Society Split Healthcare Savings 50/50</p>
286-
287-
<div className="mb-4 p-3 bg-white rounded-lg border-2 border-black">
288-
<p className="font-bold mb-2">Example: Age-Related Disease Prevention 🧬</p>
305+
<h3 className="mb-2 text-xl font-bold">
306+
Healthcare Savings Sharing Program 💰🤝
307+
</h3>
308+
<p className="mb-2 text-lg font-bold">
309+
Win-Win: Manufacturers and Society Split Healthcare Savings 50/50
310+
</p>
311+
312+
<div className="mb-4 rounded-lg border-2 border-black bg-white p-3">
313+
<p className="mb-2 font-bold">
314+
Example: Age-Related Disease Prevention 🧬
315+
</p>
289316
<ul className="list-inside list-disc space-y-1">
290317
<li>Average lifetime healthcare costs: $1.2M per person 📊</li>
291318
<li>~80% of costs are from age-related diseases ($960k) 👴</li>
@@ -294,12 +321,15 @@ const FinancialIncentives = () => (
294321
<li>Total lifetime savings: $750 billion 💰</li>
295322
<li>Society keeps: $375 billion in savings 🏥</li>
296323
<li>Manufacturer receives: $375 billion in rewards 🎯</li>
297-
<li>Additional savings from increased productivity and reduced care needs 📈</li>
324+
<li>
325+
Additional savings from increased productivity and reduced care
326+
needs 📈
327+
</li>
298328
</ul>
299329
</div>
300330

301-
<div className="mb-4 p-3 bg-white rounded-lg border-2 border-black">
302-
<p className="font-bold mb-2">Massive Economic Benefits 📊</p>
331+
<div className="mb-4 rounded-lg border-2 border-black bg-white p-3">
332+
<p className="mb-2 font-bold">Massive Economic Benefits 📊</p>
303333
<ul className="list-inside list-disc space-y-1">
304334
<li>Government healthcare costs cut in half 📉</li>
305335
<li>Patients save thousands on treatment costs 💰</li>
@@ -310,7 +340,7 @@ const FinancialIncentives = () => (
310340
</div>
311341

312342
<p className="mb-2 font-bold">This creates a virtuous cycle:</p>
313-
<ul className="list-inside list-disc space-y-1 mb-4">
343+
<ul className="mb-4 list-inside list-disc space-y-1">
314344
<li>Lower prices → More patients can afford treatment 💫</li>
315345
<li>More patients → Higher total savings generated 📈</li>
316346
<li>Higher savings → Bigger rewards for manufacturers 🎯</li>
@@ -319,7 +349,7 @@ const FinancialIncentives = () => (
319349
</ul>
320350

321351
<p className="mb-2 font-bold">Eligible Treatments Include:</p>
322-
<ul className="list-inside list-disc space-y-1 mb-4">
352+
<ul className="mb-4 list-inside list-disc space-y-1">
323353
<li>Age reversal therapies 🧬</li>
324354
<li>Gene therapies 🧬</li>
325355
<li>Disease prevention treatments 🛡️</li>

0 commit comments

Comments
 (0)