-
-
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.
Add sections 2,3,4 of evidence page and add data only in English for …
…these sections
- Loading branch information
1 parent
67ca974
commit 2340119
Showing
9 changed files
with
781 additions
and
5 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import { DefaultPageProps } from '@/app/[lang]/[country]'; | ||
import Section1 from './section-1'; | ||
import Section2 from './section-2'; | ||
import Section3 from './section-3'; | ||
import Section4 from './section-4'; | ||
|
||
export default async function Page(props: DefaultPageProps) { | ||
return ( | ||
<> | ||
<Section1 {...props} /> | ||
<Section2 {...props} /> | ||
<Section3 {...props} /> | ||
<Section4 {...props} /> | ||
</> | ||
); | ||
} |
2 changes: 0 additions & 2 deletions
2
website/src/app/[lang]/[country]/(website)/evidence/section-1.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
35 changes: 35 additions & 0 deletions
35
website/src/app/[lang]/[country]/(website)/evidence/section-2.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,35 @@ | ||
import { DefaultPageProps } from '@/app/[lang]/[country]'; | ||
import { Translator } from '@socialincome/shared/src/utils/i18n'; | ||
import { BaseContainer,Typography } from '@socialincome/ui'; | ||
import { SectionCard } from './section-card'; | ||
|
||
export default async function Section2({ params }: DefaultPageProps) { | ||
const section = 2; | ||
const translator = await Translator.getInstance({ | ||
language: params.lang, | ||
namespaces: ['website-evidence'], | ||
}); | ||
|
||
const c = translator.t(`section-${section}.cards`, {returnObjects: true}); | ||
let cards: Object[] = []; | ||
for(const card in c){cards.push(card);} | ||
let i = 0; | ||
|
||
return ( | ||
<BaseContainer backgroundColor='bg-blue-50' className="mt-12 p-10 rounded-sm flex flex-col items-start space-y-1"> | ||
<Typography size='xl' weight='medium' color='muted-foreground'>{translator.t(`section-${section}.topic`)}</Typography> | ||
<div className='pb-10' > | ||
<Typography as='span' size='4xl' weight='bold'>{translator.t(`section-${section}.title-black`)}</Typography> | ||
<Typography as='span' size='4xl' weight='bold' className='text-red-400'>{translator.t(`section-${section}.title-red`)}</Typography> | ||
</div> | ||
<div className='my-32 flex space-x-20'> | ||
<Typography size='2xl' weight='semibold' className='w-1/4'>{translator.t(`section-${section}.evidence`)}</Typography> | ||
<div className='w-2/5 h-fit text-left space-y-10'> | ||
{ | ||
cards.map((card, key)=> {i++;return (<SectionCard section={section} cardNumber={i} params={params} key={key}/>)}) | ||
} | ||
</div> | ||
</div> | ||
</BaseContainer> | ||
); | ||
} |
35 changes: 35 additions & 0 deletions
35
website/src/app/[lang]/[country]/(website)/evidence/section-3.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,35 @@ | ||
import { DefaultPageProps } from '@/app/[lang]/[country]'; | ||
import { Translator } from '@socialincome/shared/src/utils/i18n'; | ||
import { BaseContainer,Typography } from '@socialincome/ui'; | ||
import { SectionCard } from './section-card'; | ||
|
||
export default async function Section3({ params }: DefaultPageProps) { | ||
const section = 3; | ||
const translator = await Translator.getInstance({ | ||
language: params.lang, | ||
namespaces: ['website-evidence'], | ||
}); | ||
|
||
const c = translator.t(`section-${section}.cards`, {returnObjects: true}); | ||
let cards: Object[] = []; | ||
for(const card in c){cards.push(card);} | ||
let i = 0; | ||
|
||
return ( | ||
<BaseContainer backgroundColor='bg-pink-50' className="p-10 rounded-sm flex flex-col items-start space-y-1"> | ||
<Typography size='xl' weight='medium' color='muted-foreground'>{translator.t(`section-${section}.topic`)}</Typography> | ||
<div className='pb-10' > | ||
<Typography as='span' size='4xl' weight='bold'>{translator.t(`section-${section}.title-black`)}</Typography> | ||
<Typography as='span' size='4xl' weight='bold' className='text-red-400'>{translator.t(`section-${section}.title-red`)}</Typography> | ||
</div> | ||
<div className='my-32 flex space-x-20'> | ||
<Typography size='2xl' weight='semibold' className='w-1/4'>{translator.t(`section-${section}.evidence`)}</Typography> | ||
<div className='w-2/5 h-fit text-left space-y-10'> | ||
{ | ||
cards.map((card, key)=> {i++;return (<SectionCard section={section} cardNumber={i} params={params} key={key}/>)}) | ||
} | ||
</div> | ||
</div> | ||
</BaseContainer> | ||
); | ||
} |
35 changes: 35 additions & 0 deletions
35
website/src/app/[lang]/[country]/(website)/evidence/section-4.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,35 @@ | ||
import { DefaultPageProps } from '@/app/[lang]/[country]'; | ||
import { Translator } from '@socialincome/shared/src/utils/i18n'; | ||
import { BaseContainer,Typography } from '@socialincome/ui'; | ||
import { SectionCard } from './section-card'; | ||
|
||
export default async function Section4({ params }: DefaultPageProps) { | ||
const section = 4; | ||
const translator = await Translator.getInstance({ | ||
language: params.lang, | ||
namespaces: ['website-evidence'], | ||
}); | ||
|
||
const c = translator.t(`section-${section}.cards`, {returnObjects: true}); | ||
let cards: Object[] = []; | ||
for(const card in c){cards.push(card);} | ||
let i = 0; | ||
|
||
return ( | ||
<BaseContainer backgroundColor='bg-yellow-50' className="p-10 rounded-sm flex flex-col items-start space-y-1"> | ||
<Typography size='xl' weight='medium' color='muted-foreground'>{translator.t(`section-${section}.topic`)}</Typography> | ||
<div className='pb-10' > | ||
<Typography as='span' size='4xl' weight='bold'>{translator.t(`section-${section}.title-black`)}</Typography> | ||
<Typography as='span' size='4xl' weight='bold' className='text-red-400'>{translator.t(`section-${section}.title-red`)}</Typography> | ||
</div> | ||
<div className='my-32 flex space-x-20'> | ||
<Typography size='2xl' weight='semibold' className='w-1/4'>{translator.t(`section-${section}.evidence`)}</Typography> | ||
<div className='w-2/5 h-fit text-left space-y-10'> | ||
{ | ||
cards.map((card, key)=> {i++;return (<SectionCard section={section} cardNumber={i} params={params} key={key}/>)}) | ||
} | ||
</div> | ||
</div> | ||
</BaseContainer> | ||
); | ||
} |
62 changes: 62 additions & 0 deletions
62
website/src/app/[lang]/[country]/(website)/evidence/section-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { Translator } from '@socialincome/shared/src/utils/i18n'; | ||
import {Card, CardTitle, Typography, Dialog, DialogTitle, DialogTrigger, DialogContent, DialogHeader, DialogDescription, DialogFooter, Button, } from '@socialincome/ui'; | ||
import Link from 'next/link'; | ||
import { DefaultParams } from '@/app/[lang]/[country]'; | ||
import { SectionParagraph } from './section-paragraph'; | ||
|
||
type SectionCardProps = { | ||
section: number; | ||
cardNumber: number; | ||
params: DefaultParams; | ||
} | ||
|
||
|
||
export async function SectionCard({ section, cardNumber, params}: SectionCardProps){ | ||
|
||
const translator = await Translator.getInstance({ | ||
language: params.lang, | ||
namespaces: ['website-evidence'], | ||
}); | ||
|
||
const p = translator.t(`section-${section}.cards.card-${cardNumber}.paragraphs`, {returnObjects: true}); | ||
let paragraphs: Object[] = []; | ||
for(const paragraph in p){paragraphs.push(paragraph);} | ||
let i = 0; | ||
|
||
|
||
return ( | ||
<Dialog> | ||
<DialogTrigger> | ||
<Card className='bg-inherit border-black border w-full py-4 px-10 text-left scale-100 hover:scale-105 ease-in duration-200'> | ||
<CardTitle className='text-red-400 py-2 '>{translator.t(`section-${section}.cards.card-${cardNumber}.title`)}</CardTitle> | ||
<Typography size='lg'>{translator.t(`section-${section}.cards.card-${cardNumber}.description`)}</Typography> | ||
</Card> | ||
</DialogTrigger> | ||
<DialogContent className='w-full'> | ||
<DialogHeader> | ||
<DialogTitle> | ||
<Typography size='2xl' weight='bold'>{translator.t(`section-${section}.cards.card-${cardNumber}.title`)}</Typography> | ||
</DialogTitle> | ||
</DialogHeader> | ||
<DialogDescription> | ||
{ | ||
paragraphs.map((paragraph, key)=>{ | ||
i++; return( | ||
<div className='mb-3'> | ||
<SectionParagraph section={section} cardNumber={cardNumber} paragraphNumber={i} params={params} key={key} /> | ||
</div> | ||
) | ||
}) | ||
} | ||
<br/> | ||
</DialogDescription> | ||
<DialogFooter> | ||
<Link href="/get-involved"> | ||
<Button>{translator.t('take-action')}</Button> | ||
</Link> | ||
</DialogFooter> | ||
|
||
</DialogContent> | ||
</Dialog> | ||
); | ||
} |
38 changes: 38 additions & 0 deletions
38
website/src/app/[lang]/[country]/(website)/evidence/section-paragraph.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,38 @@ | ||
import { Translator } from "@socialincome/shared/src/utils/i18n"; | ||
import { DefaultParams } from "../.."; | ||
import { Typography } from "@socialincome/ui"; | ||
import Link from "next/link"; | ||
|
||
type SectionParagraphProps = { | ||
section: number; | ||
cardNumber: number; | ||
paragraphNumber: number; | ||
params: DefaultParams | ||
} | ||
|
||
export async function SectionParagraph({section, cardNumber, paragraphNumber, params}: SectionParagraphProps){ | ||
const translator = await Translator.getInstance({ | ||
language: params.lang, | ||
namespaces: ['website-evidence'], | ||
}); | ||
const pt = translator.t(`section-${section}.cards.card-${cardNumber}.paragraphs.paragraph-${paragraphNumber}`, {returnObjects: true}); | ||
let parts: Object[] = []; | ||
for(const part in pt){parts.push(part);} | ||
let i = 0; | ||
return( | ||
<div> | ||
{ | ||
parts.map((part, key)=> { | ||
i++; | ||
return ( | ||
<span key={key}> | ||
<Typography as="span" size='lg'>{translator.t(`section-${section}.cards.card-${cardNumber}.paragraphs.paragraph-${paragraphNumber}.part-${i}.text`)}</Typography> | ||
<Link href={translator.t(`section-${section}.cards.card-${cardNumber}.paragraphs.paragraph-${paragraphNumber}.part-${i}.link`)}> | ||
<Typography as="span" size='lg' className='text-blue-500 hover:text-blue-800' >{translator.t(`section-${section}.cards.card-${cardNumber}.paragraphs.paragraph-${paragraphNumber}.part-${i}.text-blue`) }</Typography> | ||
</Link> | ||
</span> | ||
);} | ||
)} | ||
</div> | ||
) | ||
} |