From df12d117b986586468c9b48d8443ed8db12eecbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20K=C3=BCndig?= Date: Sat, 10 Aug 2024 19:14:10 +0200 Subject: [PATCH] feature(website): update monthly income section on new landing page (#890) --- ui/src/components/button.tsx | 6 +- ui/src/components/input.tsx | 2 +- ui/src/components/select.tsx | 6 +- .../v2/(home)/(components)/income-input.tsx | 116 +++++++++++++----- .../v2/(home)/(sections)/monthly-income.tsx | 25 ++-- 5 files changed, 103 insertions(+), 52 deletions(-) diff --git a/ui/src/components/button.tsx b/ui/src/components/button.tsx index 959119d58..6b7f5da74 100644 --- a/ui/src/components/button.tsx +++ b/ui/src/components/button.tsx @@ -6,13 +6,13 @@ import { ComponentType } from 'react'; import { cn } from '../lib/utils'; const buttonVariants = cva( - 'inline-flex items-center justify-center rounded-md text-sm ring-offset-background transition-all duration-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', + 'inline-flex items-center justify-center rounded-xl text-sm ring-offset-background transition-all duration-200 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', { variants: { size: { default: 'h-10 px-4 py-2', - sm: 'h-9 rounded-md px-3', - lg: 'h-16 rounded-md px-8 text-lg', + sm: 'h-9 rounded-xl px-3', + lg: 'h-16 rounded-xl px-8 text-lg', icon: 'h-10 w-10', }, variant: { diff --git a/ui/src/components/input.tsx b/ui/src/components/input.tsx index 2a72d1640..edad3c057 100644 --- a/ui/src/components/input.tsx +++ b/ui/src/components/input.tsx @@ -9,7 +9,7 @@ const Input = React.forwardRef(({ className, type, {children} - + )); @@ -39,7 +39,7 @@ const SelectContent = React.forwardRef< ; + const form = useForm({ + resolver: zodResolver(formSchema), + defaultValues: { value: '5000' as any, currency: currency }, + }); + + useEffect(() => { + form.setValue('currency', currency); + }, [currency]); + + const onSubmit = async (values: FormSchema) => { + alert(`You entered: ${values.value} ${values.currency}`); + }; return ( -
-
- - 6 - - - - - - -
    - {choices.map((choice, index) => ( -
  • - {choice} -
  • - ))} -
-
-
-
-
-
-
-
+
+ + ( + + + + + + )} + /> + ( + + + + )} + /> + + ); } diff --git a/website/src/app/[lang]/[region]/v2/(home)/(sections)/monthly-income.tsx b/website/src/app/[lang]/[region]/v2/(home)/(sections)/monthly-income.tsx index c0a1c7a12..587013433 100644 --- a/website/src/app/[lang]/[region]/v2/(home)/(sections)/monthly-income.tsx +++ b/website/src/app/[lang]/[region]/v2/(home)/(sections)/monthly-income.tsx @@ -3,27 +3,22 @@ import { Translator } from '@socialincome/shared/src/utils/i18n'; import { BaseContainer, Typography } from '@socialincome/ui'; import { IncomeInput } from '../(components)/income-input'; -export async function MonthlyIncome({ lang, region }: DefaultParams) { +export async function MonthlyIncome({ lang }: DefaultParams) { const translator = await Translator.getInstance({ language: lang, namespaces: ['website-home2', 'common'], }); return ( - // - - {' '} - {/* Is there a way to use theme-blue-v2 to set background blue? */} -
- - {translator.t('section-3.title-faded')} - - - {translator.t('section-3.title')} - - - {translator.t('section-3.subtitle')} -
+ + + {translator.t('section-3.title-faded')} + + + {translator.t('section-3.title')} + + + {translator.t('section-3.subtitle')} ); }