-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Website: Display contributions dynamically on selections page (instea…
…d of hardcoding in shared/locales) (#1001) * Display contributions dynamically instead of hardcoding in shared/locales * Debug ill-functioning of currency-redirect.tsx, revert changes in shared locales * Experiment adding "../" to Draws path * Use process.cwd to get the current nextjs folder * Remove extra "/transparency" route in currency * Clean TODOs and ready for review * Move currency-redirect.tsx to (components) directory in transparency folder --------- Co-authored-by: Sandino Scheidegger <[email protected]>
- Loading branch information
1 parent
be8179c
commit 2d28b07
Showing
18 changed files
with
64 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
website/src/app/[lang]/[region]/(website)/transparency/finances/[currency]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion
2
...ient-selection/(components)/draw-card.tsx → ...ion/[currency]/(components)/draw-card.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ent-selection/(sections)/hero-section.tsx → ...on/[currency]/(sections)/hero-section.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ient-selection/(sections)/past-rounds.tsx → ...ion/[currency]/(sections)/past-rounds.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...y/recipient-selection/(sections)/state.ts → ...-selection/[currency]/(sections)/state.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...te/src/app/[lang]/[region]/(website)/transparency/recipient-selection/[currency]/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { DefaultParams } from '@/app/[lang]/[region]'; | ||
import { CurrencyRedirect } from '@/app/[lang]/[region]/(website)/transparency/(components)/currency-redirect'; | ||
import { WebsiteCurrency } 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: { | ||
currency: string; | ||
} & DefaultParams; | ||
}; | ||
|
||
export default async function Page({ params: { lang, region, currency } }: RecipientSelectionPageProps) { | ||
return ( | ||
<div className="-mt-24 md:-mt-36"> | ||
<CurrencyRedirect currency={currency.toUpperCase() as WebsiteCurrency} /> | ||
<HeroSection lang={lang} region={region} /> | ||
<Resources lang={lang} region={region} currency={currency} /> | ||
<SelectionProcess lang={lang} region={region} /> | ||
<PastRounds lang={lang} region={region} /> | ||
<SelectionFaq lang={lang} region={region} /> | ||
</div> | ||
); | ||
} |
27 changes: 11 additions & 16 deletions
27
website/src/app/[lang]/[region]/(website)/transparency/recipient-selection/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ( | ||
<div className="-mt-24 md:-mt-36"> | ||
<HeroSection lang={lang} region={region} /> | ||
<Resources lang={lang} region={region} /> | ||
<SelectionProcess lang={lang} region={region} /> | ||
<PastRounds lang={lang} region={region} /> | ||
<SelectionFaq lang={lang} region={region} /> | ||
</div> | ||
); | ||
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]); | ||
} |