From 56b85b1c0b9d09367e2d47444a52902ffea26fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=BCndig?= Date: Sat, 17 Aug 2024 13:09:24 +0200 Subject: [PATCH] feature(website): update sdg goals section on new landing page (#894) --- website/sentry.server.config.ts | 24 +++++---- .../(website)/(home)/(assets)/sdg-logo.svg | 2 +- .../v2/(home)/(components)/income-input.tsx | 4 +- .../v2/(home)/(sections)/approach.tsx | 2 +- .../v2/(home)/(sections)/explainer-video.tsx | 4 +- .../[region]/v2/(home)/(sections)/faq.tsx | 2 +- .../(home)/(sections)/mobile-illustration.tsx | 2 +- .../v2/(home)/(sections)/overview.tsx | 2 +- .../[region]/v2/(home)/(sections)/quotes.tsx | 2 +- .../(home)/(sections)/recipient-selection.tsx | 2 +- .../v2/(home)/(sections)/sdg-goals.tsx | 51 +++++++++++++++++++ .../[region]/v2/(home)/(sections)/sdgoals.tsx | 46 ----------------- .../v2/(home)/(sections)/testimonials.tsx | 2 +- .../app/[lang]/[region]/v2/(home)/page.tsx | 8 +-- 14 files changed, 80 insertions(+), 73 deletions(-) create mode 100644 website/src/app/[lang]/[region]/v2/(home)/(sections)/sdg-goals.tsx delete mode 100644 website/src/app/[lang]/[region]/v2/(home)/(sections)/sdgoals.tsx diff --git a/website/sentry.server.config.ts b/website/sentry.server.config.ts index 2c333ee2e..2c43725a0 100644 --- a/website/sentry.server.config.ts +++ b/website/sentry.server.config.ts @@ -4,15 +4,21 @@ import * as Sentry from '@sentry/nextjs'; -Sentry.init({ - dsn: 'https://3ab06c73c11cd615db9df59b15786025@o4507045017026560.ingest.us.sentry.io/4507045018992640', +console.log('Sentry is initializing'); +console.log(process.env.NODE_ENV); +if (process.env.NODE_ENV === 'development') { + console.log('Sentry is disabled in development mode'); +} else { + Sentry.init({ + dsn: 'https://3ab06c73c11cd615db9df59b15786025@o4507045017026560.ingest.us.sentry.io/4507045018992640', - // Adjust this value in production, or use tracesSampler for greater control - tracesSampleRate: 1, + // Adjust this value in production, or use tracesSampler for greater control + tracesSampleRate: 1, - // Setting this option to true will print useful information to the console while you're setting up Sentry. - debug: false, + // Setting this option to true will print useful information to the console while you're setting up Sentry. + debug: false, - // Uncomment the line below to enable Spotlight (https://spotlightjs.com) - // spotlight: process.env.NODE_ENV === 'development', -}); + // Uncomment the line below to enable Spotlight (https://spotlightjs.com) + // spotlight: process.env.NODE_ENV === 'development', + }); +} diff --git a/website/src/app/[lang]/[region]/(website)/(home)/(assets)/sdg-logo.svg b/website/src/app/[lang]/[region]/(website)/(home)/(assets)/sdg-logo.svg index bb0985f51..32a0cbc35 100644 --- a/website/src/app/[lang]/[region]/(website)/(home)/(assets)/sdg-logo.svg +++ b/website/src/app/[lang]/[region]/(website)/(home)/(assets)/sdg-logo.svg @@ -2,7 +2,7 @@ diff --git a/website/src/app/[lang]/[region]/v2/(home)/(sections)/approach.tsx b/website/src/app/[lang]/[region]/v2/(home)/(sections)/approach.tsx index 9406c8784..39d418b40 100644 --- a/website/src/app/[lang]/[region]/v2/(home)/(sections)/approach.tsx +++ b/website/src/app/[lang]/[region]/v2/(home)/(sections)/approach.tsx @@ -10,7 +10,7 @@ type ApproachCardProps = { }[]; }; -export async function Approach({ lang, region }: DefaultParams) { +export async function Approach({ lang }: DefaultParams) { const translator = await Translator.getInstance({ language: lang, namespaces: ['website-home2'], diff --git a/website/src/app/[lang]/[region]/v2/(home)/(sections)/explainer-video.tsx b/website/src/app/[lang]/[region]/v2/(home)/(sections)/explainer-video.tsx index 137481eb5..e9031ac30 100644 --- a/website/src/app/[lang]/[region]/v2/(home)/(sections)/explainer-video.tsx +++ b/website/src/app/[lang]/[region]/v2/(home)/(sections)/explainer-video.tsx @@ -4,7 +4,7 @@ import { Translator } from '@socialincome/shared/src/utils/i18n'; import { BaseContainer, Typography } from '@socialincome/ui'; import { FontColor } from '@socialincome/ui/src/interfaces/color'; -export async function ExplainerVideo({ lang, region }: DefaultParams) { +export async function ExplainerVideo({ lang }: DefaultParams) { const translator = await Translator.getInstance({ language: lang, namespaces: ['website-home2', 'website-videos'], @@ -13,7 +13,7 @@ export async function ExplainerVideo({ lang, region }: DefaultParams) { return ( - {translator.t<{ text: string; color?: FontColor }[]>('section-4.title-1').map((title, index) => ( + {translator.t<{ text: string; color?: FontColor }[]>('section-4.title-1').map((title) => ( {title.text} diff --git a/website/src/app/[lang]/[region]/v2/(home)/(sections)/faq.tsx b/website/src/app/[lang]/[region]/v2/(home)/(sections)/faq.tsx index 247323a48..f8a7b2b2b 100644 --- a/website/src/app/[lang]/[region]/v2/(home)/(sections)/faq.tsx +++ b/website/src/app/[lang]/[region]/v2/(home)/(sections)/faq.tsx @@ -18,7 +18,7 @@ type FaqQuestion = { }[]; }; -export async function Faq({ lang, region }: DefaultParams) { +export async function Faq({ lang }: DefaultParams) { const translator = await Translator.getInstance({ language: lang, namespaces: ['website-home2'], diff --git a/website/src/app/[lang]/[region]/v2/(home)/(sections)/mobile-illustration.tsx b/website/src/app/[lang]/[region]/v2/(home)/(sections)/mobile-illustration.tsx index 284cd9ab6..164258835 100644 --- a/website/src/app/[lang]/[region]/v2/(home)/(sections)/mobile-illustration.tsx +++ b/website/src/app/[lang]/[region]/v2/(home)/(sections)/mobile-illustration.tsx @@ -5,7 +5,7 @@ import { FontColor } from '@socialincome/ui/src/interfaces/color'; import Image from 'next/image'; import MobilesImg from '../(assets)/mobilesImgData.png'; -export async function MobileIllustration({ lang, region }: DefaultParams) { +export async function MobileIllustration({ lang }: DefaultParams) { const translator = await Translator.getInstance({ language: lang, namespaces: ['website-home2'], diff --git a/website/src/app/[lang]/[region]/v2/(home)/(sections)/overview.tsx b/website/src/app/[lang]/[region]/v2/(home)/(sections)/overview.tsx index 80b01a818..9ca22d815 100644 --- a/website/src/app/[lang]/[region]/v2/(home)/(sections)/overview.tsx +++ b/website/src/app/[lang]/[region]/v2/(home)/(sections)/overview.tsx @@ -3,7 +3,7 @@ import { Translator } from '@socialincome/shared/src/utils/i18n'; import { BaseContainer, Typography } from '@socialincome/ui'; import { FontColor } from '@socialincome/ui/src/interfaces/color'; -export async function Overview({ lang, region }: DefaultParams) { +export async function Overview({ lang }: DefaultParams) { const translator = await Translator.getInstance({ language: lang, namespaces: ['website-home2'], diff --git a/website/src/app/[lang]/[region]/v2/(home)/(sections)/quotes.tsx b/website/src/app/[lang]/[region]/v2/(home)/(sections)/quotes.tsx index 39f2d00ae..7c34868b3 100644 --- a/website/src/app/[lang]/[region]/v2/(home)/(sections)/quotes.tsx +++ b/website/src/app/[lang]/[region]/v2/(home)/(sections)/quotes.tsx @@ -3,7 +3,7 @@ import { Translator } from '@socialincome/shared/src/utils/i18n'; import { BaseContainer } from '@socialincome/ui'; import { CarouselCardProps, QuotesCarousel } from '../(components)/quotes-carousel'; -export async function Quotes({ lang, region }: DefaultParams) { +export async function Quotes({ lang }: DefaultParams) { const translator = await Translator.getInstance({ language: lang, namespaces: ['website-home2', 'common'], diff --git a/website/src/app/[lang]/[region]/v2/(home)/(sections)/recipient-selection.tsx b/website/src/app/[lang]/[region]/v2/(home)/(sections)/recipient-selection.tsx index 574a82952..0840e78af 100644 --- a/website/src/app/[lang]/[region]/v2/(home)/(sections)/recipient-selection.tsx +++ b/website/src/app/[lang]/[region]/v2/(home)/(sections)/recipient-selection.tsx @@ -5,7 +5,7 @@ import { FontColor } from '@socialincome/ui/src/interfaces/color'; import Image from 'next/image'; import YellowBlueDots from '../(assets)/yellowBlueDotsImgData.png'; -export async function RecipientSelection({ lang, region }: DefaultParams) { +export async function RecipientSelection({ lang }: DefaultParams) { const translator = await Translator.getInstance({ language: lang, namespaces: ['website-home2'], diff --git a/website/src/app/[lang]/[region]/v2/(home)/(sections)/sdg-goals.tsx b/website/src/app/[lang]/[region]/v2/(home)/(sections)/sdg-goals.tsx new file mode 100644 index 000000000..0bb98191f --- /dev/null +++ b/website/src/app/[lang]/[region]/v2/(home)/(sections)/sdg-goals.tsx @@ -0,0 +1,51 @@ +import { DefaultParams } from '@/app/[lang]/[region]'; +import sdgLogo from '@/app/[lang]/[region]/(website)/(home)/(assets)/sdg-logo.svg'; +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 Town from '../(assets)/sdg-town.jpg'; + +export async function SDGGoals({ lang }: DefaultParams) { + const translator = await Translator.getInstance({ + language: lang, + namespaces: ['website-home2'], + }); + + return ( +
+ + {translator.t<{ text: string; color?: FontColor }[]>('section-10.title-1').map((title, index) => ( + + {title.text}{' '} + + ))} + + Sustainable Development Goals Logo +
+
+
+ + {translator.t('section-10.sdg-1-title')} + + {translator.t('section-10.sdg-1')} +
+
+
+ + {translator.t('section-10.sdg-10-title')} + + {translator.t('section-10.sdg-10')} +
+
+
+ ); +} diff --git a/website/src/app/[lang]/[region]/v2/(home)/(sections)/sdgoals.tsx b/website/src/app/[lang]/[region]/v2/(home)/(sections)/sdgoals.tsx deleted file mode 100644 index b7367a407..000000000 --- a/website/src/app/[lang]/[region]/v2/(home)/(sections)/sdgoals.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import { DefaultParams } from '@/app/[lang]/[region]'; -import sdgLogo from '@/app/[lang]/[region]/(website)/(home)/(assets)/sdg-logo.svg'; -import { Translator } from '@socialincome/shared/src/utils/i18n'; -import { BaseContainer, Typography } from '@socialincome/ui'; -import { FontColor } from '@socialincome/ui/src/interfaces/color'; -import Image from 'next/image'; -import Town from '../(assets)/sdg-town.jpg'; - -export async function Sdgoals({ lang, region }: DefaultParams) { - const translator = await Translator.getInstance({ - language: lang, - namespaces: ['website-home2'], - }); - - return ( -
- -
-
- {translator.t<{ text: string; color?: FontColor }[]>('section-10.title-1').map((title, index) => ( - - {title.text}{' '} - - ))} -
- Sustainable Development Goals Logo -
-
-
- - {translator.t('section-10.sdg-1-title')} - - {translator.t('section-10.sdg-1')} -
-
- - {translator.t('section-10.sdg-10-title')} - - {translator.t('section-10.sdg-10')} -
-
-
- Town image -
- ); -} diff --git a/website/src/app/[lang]/[region]/v2/(home)/(sections)/testimonials.tsx b/website/src/app/[lang]/[region]/v2/(home)/(sections)/testimonials.tsx index a10a8fe84..3f7ad1ba2 100644 --- a/website/src/app/[lang]/[region]/v2/(home)/(sections)/testimonials.tsx +++ b/website/src/app/[lang]/[region]/v2/(home)/(sections)/testimonials.tsx @@ -12,7 +12,7 @@ type PortraitProps = { image: string | StaticImport; }; -export async function Testimonials({ lang, region }: DefaultParams) { +export async function Testimonials({ lang }: DefaultParams) { const translator = await Translator.getInstance({ language: lang, namespaces: ['website-home2', 'common'], diff --git a/website/src/app/[lang]/[region]/v2/(home)/page.tsx b/website/src/app/[lang]/[region]/v2/(home)/page.tsx index 07c7d688f..1ce282355 100644 --- a/website/src/app/[lang]/[region]/v2/(home)/page.tsx +++ b/website/src/app/[lang]/[region]/v2/(home)/page.tsx @@ -1,7 +1,7 @@ import { DefaultPageProps } from '@/app/[lang]/[region]'; import { Approach } from '@/app/[lang]/[region]/v2/(home)/(sections)/approach'; import { Quotes } from '@/app/[lang]/[region]/v2/(home)/(sections)/quotes'; -import { Translator } from '@socialincome/shared/src/utils/i18n'; +import { SDGGoals } from '@/app/[lang]/[region]/v2/(home)/(sections)/sdg-goals'; import { ExplainerVideo } from './(sections)/explainer-video'; import { HeroVideo } from './(sections)/hero-video'; import { MobileIllustration } from './(sections)/mobile-illustration'; @@ -9,10 +9,6 @@ import { MonthlyIncome } from './(sections)/monthly-income'; import { Overview } from './(sections)/overview'; export default async function Page({ params: { lang, region } }: DefaultPageProps) { - const translator = await Translator.getInstance({ - language: lang, - namespaces: ['website-(home)', 'website-videos'], - }); return ( <> @@ -25,7 +21,7 @@ export default async function Page({ params: { lang, region } }: DefaultPageProp {/**/} {/**/} - {/**/} + {/**/} );