From ef0e780d871a238804b03066ac4d601a2a589b2f Mon Sep 17 00:00:00 2001 From: Pranav Chatur Date: Sun, 5 Jan 2025 02:55:41 +0530 Subject: [PATCH 1/7] Display contributions dynamically instead of hardcoding in shared/locales --- shared/locales/de/website-selection.json | 1 - shared/locales/en/website-selection.json | 1 - shared/locales/fr/website-selection.json | 1 - shared/locales/it/website-selection.json | 1 - .../{ => [currency]}/(assets)/globe.svg | 0 .../(assets)/transparency.svg | 0 .../(components)/draw-card.tsx | 2 +- .../(components)/scroll-to-chevron.tsx | 0 .../{ => [currency]}/(sections)/faq.tsx | 0 .../(sections)/hero-section.tsx | 2 +- .../(sections)/past-rounds.tsx | 4 +-- .../{ => [currency]}/(sections)/resources.tsx | 23 +++++++++++++-- .../(sections)/selection-process.tsx | 0 .../{ => [currency]}/(sections)/state.ts | 0 .../[currency]/currency-redirect.tsx | 18 ++++++++++++ .../recipient-selection/[currency]/page.tsx | 28 +++++++++++++++++++ .../transparency/recipient-selection/page.tsx | 27 ++++++++---------- 17 files changed, 81 insertions(+), 27 deletions(-) rename website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/{ => [currency]}/(assets)/globe.svg (100%) rename website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/{ => [currency]}/(assets)/transparency.svg (100%) rename website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/{ => [currency]}/(components)/draw-card.tsx (95%) rename website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/{ => [currency]}/(components)/scroll-to-chevron.tsx (100%) rename website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/{ => [currency]}/(sections)/faq.tsx (100%) rename website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/{ => [currency]}/(sections)/hero-section.tsx (94%) rename website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/{ => [currency]}/(sections)/past-rounds.tsx (89%) rename website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/{ => [currency]}/(sections)/resources.tsx (69%) rename website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/{ => [currency]}/(sections)/selection-process.tsx (100%) rename website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/{ => [currency]}/(sections)/state.ts (100%) create mode 100644 website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/currency-redirect.tsx create mode 100644 website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/page.tsx diff --git a/shared/locales/de/website-selection.json b/shared/locales/de/website-selection.json index dd90b9e5f..e9476f635 100644 --- a/shared/locales/de/website-selection.json +++ b/shared/locales/de/website-selection.json @@ -42,7 +42,6 @@ "text": "die die Unterstützung am meisten benötigen.”" } ], - "amount": "USD 300,000+", "amount-context": "Spenden erhalten ↗", "scope": "Mehr ", "continue-1": "Auswahlverfahren" diff --git a/shared/locales/en/website-selection.json b/shared/locales/en/website-selection.json index eb9194885..a2e0a7b7b 100644 --- a/shared/locales/en/website-selection.json +++ b/shared/locales/en/website-selection.json @@ -39,7 +39,6 @@ "text": "who need Social Income the most." } ], - "amount": "USD 300,000+", "amount-context": "raised to date ↗", "scope": "visit our ", "continue-1": "Selection Process" diff --git a/shared/locales/fr/website-selection.json b/shared/locales/fr/website-selection.json index cbef6c272..645d90e51 100644 --- a/shared/locales/fr/website-selection.json +++ b/shared/locales/fr/website-selection.json @@ -39,7 +39,6 @@ "text": "sur les personnes qui ont le plus besoin de Social Income." } ], - "amount": "USD 300,000+", "amount-context": "reçus à ce jour ↗", "scope": "Plus de ", "continue-1": "Processus de sélection" diff --git a/shared/locales/it/website-selection.json b/shared/locales/it/website-selection.json index 4e1b65509..af75cd5da 100644 --- a/shared/locales/it/website-selection.json +++ b/shared/locales/it/website-selection.json @@ -39,7 +39,6 @@ "text": "che hanno più bisogno di Social Income." } ], - "amount": "USD 300,000+", "amount-context": "raccolti fino a oggi ↗", "scope": "Più ", "continue-1": "Processo di selezione" diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(assets)/globe.svg b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(assets)/globe.svg similarity index 100% rename from website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(assets)/globe.svg rename to website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(assets)/globe.svg diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(assets)/transparency.svg b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(assets)/transparency.svg similarity index 100% rename from website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(assets)/transparency.svg rename to website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(assets)/transparency.svg diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(components)/draw-card.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(components)/draw-card.tsx similarity index 95% rename from website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(components)/draw-card.tsx rename to website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(components)/draw-card.tsx index b3427ec85..57a04db55 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(components)/draw-card.tsx +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(components)/draw-card.tsx @@ -1,10 +1,10 @@ 'use client'; -import { CompletedDraw } from '@/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/state'; import { WebsiteLanguage } from '@/i18n'; import { Card, Collapsible, CollapsibleContent, CollapsibleTrigger, Typography } from '@socialincome/ui'; import { DateTime } from 'luxon'; import Link from 'next/link'; +import { CompletedDraw } from '../(sections)/state'; type DrawCardProps = { lang: WebsiteLanguage; diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(components)/scroll-to-chevron.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(components)/scroll-to-chevron.tsx similarity index 100% rename from website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(components)/scroll-to-chevron.tsx rename to website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(components)/scroll-to-chevron.tsx diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/faq.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/faq.tsx similarity index 100% rename from website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/faq.tsx rename to website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/faq.tsx diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/hero-section.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/hero-section.tsx similarity index 94% rename from website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/hero-section.tsx rename to website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/hero-section.tsx index 49c4ffc67..73a901ab2 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/hero-section.tsx +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/hero-section.tsx @@ -1,10 +1,10 @@ import { DefaultParams } from '@/app/[lang]/[region]'; -import ScrollToChevron from '@/app/[lang]/[region]/(website)/transparency/recipient-selection/(components)/scroll-to-chevron'; import { Translator } from '@socialincome/shared/src/utils/i18n'; import { Typography } from '@socialincome/ui'; import { FontColor } from '@socialincome/ui/src/interfaces/color'; import Image from 'next/image'; import globeRotating from '../(assets)/globe.svg'; +import ScrollToChevron from '../(components)/scroll-to-chevron'; export async function HeroSection({ lang }: DefaultParams) { const translator = await Translator.getInstance({ diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/past-rounds.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/past-rounds.tsx similarity index 89% rename from website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/past-rounds.tsx rename to website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/past-rounds.tsx index a29f3b42d..12009a52b 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/past-rounds.tsx +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/past-rounds.tsx @@ -1,9 +1,9 @@ import { DefaultParams } from '@/app/[lang]/[region]'; -import { DrawCard } from '@/app/[lang]/[region]/(website)/transparency/recipient-selection/(components)/draw-card'; -import { loadPastDraws } from '@/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/state'; import { Translator } from '@socialincome/shared/src/utils/i18n'; import { BaseContainer, Typography } from '@socialincome/ui'; import { FontColor } from '@socialincome/ui/src/interfaces/color'; +import { DrawCard } from '../(components)/draw-card'; +import { loadPastDraws } from './state'; export const revalidate = 3600 * 24; // update once a day diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/resources.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/resources.tsx similarity index 69% rename from website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/resources.tsx rename to website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/resources.tsx index af9d027e5..ae5c238bc 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/resources.tsx +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/resources.tsx @@ -1,17 +1,33 @@ import { DefaultParams } from '@/app/[lang]/[region]'; -import ScrollToChevron from '@/app/[lang]/[region]/(website)/transparency/recipient-selection/(components)/scroll-to-chevron'; +import { firestoreAdmin } from '@/firebase-admin'; +import { WebsiteCurrency, WebsiteLanguage } from '@/i18n'; import { Translator } from '@socialincome/shared/src/utils/i18n'; +import { ContributionStatsCalculator } from '@socialincome/shared/src/utils/stats/ContributionStatsCalculator'; import { Button, Typography } from '@socialincome/ui'; import { FontColor } from '@socialincome/ui/src/interfaces/color'; import Image from 'next/image'; import transparency from '../(assets)/transparency.svg'; +import ScrollToChevron from '../(components)/scroll-to-chevron'; -export async function Resources({ lang }: DefaultParams) { +type ResourcePageProps = { + lang: WebsiteLanguage; + currency: string; +} & DefaultParams; + +const roundAmount = (amount: number) => (amount ? Math.round(amount / 10) * 10 : 0); + +export async function Resources({ lang, currency }: ResourcePageProps) { const translator = await Translator.getInstance({ language: lang, namespaces: ['website-selection'], }); + const contributionCalculator = await ContributionStatsCalculator.build( + firestoreAdmin, + currency.toUpperCase() as WebsiteCurrency, + ); + const totalContributionsAmount = contributionCalculator.totalContributionsAmount(); + return (
@@ -41,7 +57,8 @@ export async function Resources({ lang }: DefaultParams) { diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/selection-process.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/selection-process.tsx similarity index 100% rename from website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/selection-process.tsx rename to website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/selection-process.tsx diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/state.ts b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/state.ts similarity index 100% rename from website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/(sections)/state.ts rename to website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/state.ts diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/currency-redirect.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/currency-redirect.tsx new file mode 100644 index 000000000..360967e44 --- /dev/null +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/currency-redirect.tsx @@ -0,0 +1,18 @@ +'use client'; + +import { useI18n } from '@/components/providers/context-providers'; +import { WebsiteCurrency } from '@/i18n'; +import { redirect } from 'next/navigation'; +import { useEffect } from 'react'; + +export function CurrencyRedirect(props: { currency: WebsiteCurrency }) { + const { currency } = useI18n(); + + useEffect(() => { + if (currency && props.currency !== currency) { + redirect('./' + currency.toLowerCase()); + } + }, [currency, props.currency]); + + return null; +} diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/page.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/page.tsx new file mode 100644 index 000000000..128e02718 --- /dev/null +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/page.tsx @@ -0,0 +1,28 @@ +import { DefaultPageProps } from '@/app/[lang]/[region]'; +import { WebsiteLanguage, WebsiteRegion } from '@/i18n'; +import { SelectionFaq } from './(sections)/faq'; +import { HeroSection } from './(sections)/hero-section'; +import { PastRounds } from './(sections)/past-rounds'; +import { Resources } from './(sections)/resources'; +import { SelectionProcess } from './(sections)/selection-process'; + +type RecipientSelectionPageProps = { + params: { + region: WebsiteRegion; + lang: WebsiteLanguage; + currency: string; + }; +} & DefaultPageProps; + +export default async function Page({ params: { lang, region, currency } }: RecipientSelectionPageProps) { + return ( +
+ {/**/} + + + + + +
+ ); +} diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/page.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/page.tsx index 71400c9a5..a9bdd5987 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/page.tsx +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/page.tsx @@ -1,18 +1,13 @@ -import { DefaultPageProps } from '@/app/[lang]/[region]'; -import { SelectionFaq } from './(sections)/faq'; -import { HeroSection } from './(sections)/hero-section'; -import { PastRounds } from './(sections)/past-rounds'; -import { Resources } from './(sections)/resources'; -import { SelectionProcess } from './(sections)/selection-process'; +'use client'; -export default async function Page({ params: { lang, region } }: DefaultPageProps) { - return ( -
- - - - - -
- ); +import { useI18n } from '@/components/providers/context-providers'; +import { redirect } from 'next/navigation'; +import { useEffect } from 'react'; + +export default function Page() { + const { currency } = useI18n(); + + useEffect(() => { + redirect('./recipient-selection/' + currency?.toLowerCase()); + }, [currency]); } From e58043d10d79489e867879418774d17c14ca107c Mon Sep 17 00:00:00 2001 From: Pranav Chatur Date: Tue, 7 Jan 2025 04:06:15 +0530 Subject: [PATCH 2/7] Debug ill-functioning of currency-redirect.tsx, revert changes in shared locales --- shared/locales/de/website-selection.json | 1 + shared/locales/en/website-selection.json | 1 + shared/locales/fr/website-selection.json | 1 + shared/locales/it/website-selection.json | 1 + .../[currency]/(sections)/resources.tsx | 3 +-- .../[currency]/currency-redirect.tsx | 1 + .../recipient-selection/[currency]/page.tsx | 13 ++++++------- .../transparency/recipient-selection/page.tsx | 2 ++ 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/shared/locales/de/website-selection.json b/shared/locales/de/website-selection.json index e9476f635..dd90b9e5f 100644 --- a/shared/locales/de/website-selection.json +++ b/shared/locales/de/website-selection.json @@ -42,6 +42,7 @@ "text": "die die Unterstützung am meisten benötigen.”" } ], + "amount": "USD 300,000+", "amount-context": "Spenden erhalten ↗", "scope": "Mehr ", "continue-1": "Auswahlverfahren" diff --git a/shared/locales/en/website-selection.json b/shared/locales/en/website-selection.json index a2e0a7b7b..eb9194885 100644 --- a/shared/locales/en/website-selection.json +++ b/shared/locales/en/website-selection.json @@ -39,6 +39,7 @@ "text": "who need Social Income the most." } ], + "amount": "USD 300,000+", "amount-context": "raised to date ↗", "scope": "visit our ", "continue-1": "Selection Process" diff --git a/shared/locales/fr/website-selection.json b/shared/locales/fr/website-selection.json index 645d90e51..cbef6c272 100644 --- a/shared/locales/fr/website-selection.json +++ b/shared/locales/fr/website-selection.json @@ -39,6 +39,7 @@ "text": "sur les personnes qui ont le plus besoin de Social Income." } ], + "amount": "USD 300,000+", "amount-context": "reçus à ce jour ↗", "scope": "Plus de ", "continue-1": "Processus de sélection" diff --git a/shared/locales/it/website-selection.json b/shared/locales/it/website-selection.json index af75cd5da..4e1b65509 100644 --- a/shared/locales/it/website-selection.json +++ b/shared/locales/it/website-selection.json @@ -39,6 +39,7 @@ "text": "che hanno più bisogno di Social Income." } ], + "amount": "USD 300,000+", "amount-context": "raccolti fino a oggi ↗", "scope": "Più ", "continue-1": "Processo di selezione" diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/resources.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/resources.tsx index ae5c238bc..c2e8cd4f6 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/resources.tsx +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/resources.tsx @@ -1,6 +1,6 @@ import { DefaultParams } from '@/app/[lang]/[region]'; import { firestoreAdmin } from '@/firebase-admin'; -import { WebsiteCurrency, WebsiteLanguage } from '@/i18n'; +import { WebsiteCurrency } from '@/i18n'; import { Translator } from '@socialincome/shared/src/utils/i18n'; import { ContributionStatsCalculator } from '@socialincome/shared/src/utils/stats/ContributionStatsCalculator'; import { Button, Typography } from '@socialincome/ui'; @@ -10,7 +10,6 @@ import transparency from '../(assets)/transparency.svg'; import ScrollToChevron from '../(components)/scroll-to-chevron'; type ResourcePageProps = { - lang: WebsiteLanguage; currency: string; } & DefaultParams; diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/currency-redirect.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/currency-redirect.tsx index 360967e44..935884eed 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/currency-redirect.tsx +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/currency-redirect.tsx @@ -1,3 +1,4 @@ +//TODO: Duplicate code fragment, can be eliminated by storing it's source somewhere common. 'use client'; import { useI18n } from '@/components/providers/context-providers'; diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/page.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/page.tsx index 128e02718..fb7ebc4a8 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/page.tsx +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/page.tsx @@ -1,5 +1,6 @@ -import { DefaultPageProps } from '@/app/[lang]/[region]'; -import { WebsiteLanguage, WebsiteRegion } from '@/i18n'; +import { DefaultParams } from '@/app/[lang]/[region]'; +import { CurrencyRedirect } from '@/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/currency-redirect'; +import { WebsiteCurrency } from '@/i18n'; import { SelectionFaq } from './(sections)/faq'; import { HeroSection } from './(sections)/hero-section'; import { PastRounds } from './(sections)/past-rounds'; @@ -8,16 +9,14 @@ import { SelectionProcess } from './(sections)/selection-process'; type RecipientSelectionPageProps = { params: { - region: WebsiteRegion; - lang: WebsiteLanguage; currency: string; - }; -} & DefaultPageProps; + } & DefaultParams; +}; export default async function Page({ params: { lang, region, currency } }: RecipientSelectionPageProps) { return (
- {/**/} + diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/page.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/page.tsx index a9bdd5987..9382c1c70 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/page.tsx +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/page.tsx @@ -1,3 +1,5 @@ +//TODO: Almost duplicate instead of the redirect, can be generalised as well probably +//TODO: shared/locales/[lang]/website-selection contains section2.amount which is no longer used anywhere 'use client'; import { useI18n } from '@/components/providers/context-providers'; From 297ace8ee2d6b0ef9aa37c9e00f1622588bf700a Mon Sep 17 00:00:00 2001 From: Pranav Chatur Date: Tue, 7 Jan 2025 21:30:57 +0530 Subject: [PATCH 3/7] Experiment adding "../" to Draws path --- .../recipient-selection/[currency]/(sections)/state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/state.ts b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/state.ts index c338481f7..e7774176f 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/state.ts +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/state.ts @@ -1,7 +1,7 @@ import { readFileSync } from 'fs'; import * as fs from 'fs/promises'; -const DRAWS_PATH = '../recipients_selection/draws'; +const DRAWS_PATH = '../../recipients_selection/draws'; export type Draw = { name: string; From 49d23393cb93d45e23ca1af83e7c3428aada2222 Mon Sep 17 00:00:00 2001 From: Pranav Chatur Date: Tue, 7 Jan 2025 22:18:37 +0530 Subject: [PATCH 4/7] Use process.cwd to get the current nextjs folder --- .../recipient-selection/[currency]/(sections)/state.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/state.ts b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/state.ts index e7774176f..cf727b688 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/state.ts +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/state.ts @@ -1,7 +1,7 @@ import { readFileSync } from 'fs'; import * as fs from 'fs/promises'; -const DRAWS_PATH = '../../recipients_selection/draws'; +const DRAWS_PATH = process.cwd() + '/../recipients_selection/draws'; export type Draw = { name: string; From fc2ca4bd68442d21ffbf8c2fa3f7cf341b33a5a2 Mon Sep 17 00:00:00 2001 From: Pranav Chatur Date: Wed, 8 Jan 2025 09:10:53 +0530 Subject: [PATCH 5/7] Remove extra "/transparency" route in currency --- .../recipient-selection/[currency]/(sections)/resources.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/resources.tsx b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/resources.tsx index c2e8cd4f6..e9ca92028 100644 --- a/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/resources.tsx +++ b/website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/(sections)/resources.tsx @@ -54,7 +54,7 @@ export async function Resources({ lang, currency }: ResourcePageProps) {