From 849bf85bcea12485d0347cddea445c2d74ccb4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Thu, 21 Mar 2024 11:57:57 +0100 Subject: [PATCH 01/20] add forgot password screen --- .../(not-authorized)/forgot-password.tsx | 3 ++ src/components/molecules/Field/Checkbox.tsx | 2 +- src/components/molecules/Field/Input.tsx | 2 +- src/i18n/translations/en.json | 2 + src/i18n/translations/pl.json | 2 + src/screens/ForgotPasswordScreen.tsx | 11 +++++ src/screens/SignInScreen.tsx | 40 ++++++++++--------- src/screens/index.ts | 1 + 8 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 app/(app)/(not-authorized)/forgot-password.tsx create mode 100644 src/screens/ForgotPasswordScreen.tsx diff --git a/app/(app)/(not-authorized)/forgot-password.tsx b/app/(app)/(not-authorized)/forgot-password.tsx new file mode 100644 index 00000000..caedadac --- /dev/null +++ b/app/(app)/(not-authorized)/forgot-password.tsx @@ -0,0 +1,3 @@ +import { ForgotPasswordScreen } from '@baca/screens' + +export default ForgotPasswordScreen diff --git a/src/components/molecules/Field/Checkbox.tsx b/src/components/molecules/Field/Checkbox.tsx index 9401d07a..c8585be8 100644 --- a/src/components/molecules/Field/Checkbox.tsx +++ b/src/components/molecules/Field/Checkbox.tsx @@ -52,7 +52,7 @@ export const Checkbox = ({ }, [checkboxes, value, props, onChange]) return ( - + {checkboxes ? ( renderCheckboxes diff --git a/src/components/molecules/Field/Input.tsx b/src/components/molecules/Field/Input.tsx index 071f54d8..648199ed 100644 --- a/src/components/molecules/Field/Input.tsx +++ b/src/components/molecules/Field/Input.tsx @@ -88,7 +88,7 @@ export const Input = forwardRef, FieldInputProps>( ) return ( - + { + const { t } = useTranslation() + + useScreenOptions({ + title: t('navigation.screen_titles.forgot_password'), + }) + + return <> +} diff --git a/src/screens/SignInScreen.tsx b/src/screens/SignInScreen.tsx index 8e6d9650..72944339 100644 --- a/src/screens/SignInScreen.tsx +++ b/src/screens/SignInScreen.tsx @@ -1,7 +1,7 @@ import { ControlledField, KeyboardAwareScrollView, LanguagePicker, Version } from '@baca/components' import { REGEX, darkLogo, lightLogo } from '@baca/constants' import { useColorScheme } from '@baca/contexts' -import { Box, Button, Center, Spacer, Text } from '@baca/design-system' +import { Box, Button, Center, Row, Spacer, Text } from '@baca/design-system' import { useCallback, useSignInForm, @@ -31,6 +31,7 @@ export const SignInScreen = (): JSX.Element => { const navigateToSignUp = useCallback(() => push('/sign-up'), [push]) const navigateToAppInfo = useCallback(() => push('/application-info'), [push]) + const navigateToForgotPassword = useCallback(() => push('/forgot-password'), [push]) const focusPasswordInput = useCallback(() => setFocus('password'), [setFocus]) return ( @@ -38,7 +39,7 @@ export const SignInScreen = (): JSX.Element => { -
+
{ testID="passwordInput" type="password" /> -
+ - - - {t('sign_in_screen.do_not_have_an_account')} - - - {t('sign_in_screen.sign_up')} + + {t('sign_in_screen.forgot_password')} -
+ + + + {t('sign_in_screen.do_not_have_an_account')} + + + {t('sign_in_screen.sign_up')} + {/* TODO: Remove this after implementing signing in with backend */} diff --git a/src/screens/index.ts b/src/screens/index.ts index 12a7fc75..af3f4550 100644 --- a/src/screens/index.ts +++ b/src/screens/index.ts @@ -6,6 +6,7 @@ export * from './ConfirmEmail' export * from './DataFromBeScreen_EXAMPLE' export * from './DetailsScreen' export * from './ExamplesScreen' +export * from './ForgotPasswordScreen' export * from './HomeScreen' export * from './NotFoundScreen' export * from './ProfileScreen' From db6da359da1fafa3e3c53fee17639fcdcc264763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Thu, 21 Mar 2024 13:56:08 +0100 Subject: [PATCH 02/20] add forgot password screen content --- src/components/CompanyLogo.tsx | 37 +++++++++++ src/components/FeaturedIcon.tsx | 35 +++++++++++ src/components/index.ts | 2 + src/hooks/forms/index.ts | 1 + src/hooks/forms/useForgotPasswordForm.tsx | 49 +++++++++++++++ src/hooks/forms/useSignInForm.ts | 4 +- src/i18n/translations/en.json | 6 ++ src/i18n/translations/pl.json | 6 ++ .../tabNavigator/components/HeaderLogo.tsx | 49 ++++++--------- src/screens/ForgotPasswordScreen.tsx | 62 ++++++++++++++++++- src/screens/SignInScreen.tsx | 30 ++++----- src/screens/SignUpScreen.tsx | 5 +- 12 files changed, 233 insertions(+), 53 deletions(-) create mode 100644 src/components/CompanyLogo.tsx create mode 100644 src/components/FeaturedIcon.tsx create mode 100644 src/hooks/forms/useForgotPasswordForm.tsx diff --git a/src/components/CompanyLogo.tsx b/src/components/CompanyLogo.tsx new file mode 100644 index 00000000..831725cf --- /dev/null +++ b/src/components/CompanyLogo.tsx @@ -0,0 +1,37 @@ +import { darkBinarLogo, darkLogoSygnet, lightBinarLogo, lightLogoSygnet } from '@baca/constants' +import { ColorSchemeName, useColorScheme } from '@baca/contexts' +import { Image, ImageProps, ImageStyle } from 'react-native' + +type LogoTypes = 'binarSygnet' | 'binar' + +const LOGO: { + [key in ColorSchemeName]: { [key in LogoTypes]: ImageProps['source'] } +} = { + light: { binarSygnet: lightLogoSygnet, binar: lightBinarLogo }, + dark: { binarSygnet: darkLogoSygnet, binar: darkBinarLogo }, +} + +export const CompanyLogo = ({ + height = 100, + type = 'binar', + width = '100%', + style, +}: { + height?: ImageStyle['height'] + type?: LogoTypes + width?: ImageStyle['width'] + style?: ImageStyle +}) => { + const { colorScheme } = useColorScheme() + + const source = LOGO[colorScheme][type] + + return ( + + ) +} diff --git a/src/components/FeaturedIcon.tsx b/src/components/FeaturedIcon.tsx new file mode 100644 index 00000000..22005967 --- /dev/null +++ b/src/components/FeaturedIcon.tsx @@ -0,0 +1,35 @@ +import { Box, Icon } from '@baca/design-system' +import { IconNames } from '@baca/types/icon' + +type FeatureIconSize = 'sm' | 'md' | 'lg' | 'xl' + +const featuredIconSizeVariants: { + [key in FeatureIconSize]: { iconSize: number; borderRadius: number; padding: number } +} = { + // FIXME: add values according to design theme + sm: { iconSize: 16, borderRadius: 6, padding: 2.5 }, + md: { iconSize: 20, borderRadius: 8, padding: 2.5 }, + lg: { iconSize: 24, borderRadius: 10, padding: 3 }, + xl: { iconSize: 28, borderRadius: 12, padding: 14 }, +} + +// FIXME: Add different variants for featuredIcon according to design https://www.figma.com/file/Zk5v95NgasXz7o84UABvH3/%E2%9D%96-BACA---Untitled-UI-(v4.0---plik-madka)?type=design&node-id=1102-5338&mode=design&t=sc8jQ2o3oHFoeslg-4 +export const FeaturedIcon = ({ + iconName, + size = 'md', +}: { + iconName: IconNames + size?: FeatureIconSize +}) => { + const icon = featuredIconSizeVariants[size] + return ( + + + + ) +} diff --git a/src/components/index.ts b/src/components/index.ts index f33b3c77..e1cb6335 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -2,6 +2,8 @@ export * from './molecules' export * from './organisms' export * from './AppLoading' +export * from './CompanyLogo' +export * from './FeaturedIcon' export * from './KeyboardAwareScrollView' export * from './LanguagePicker' export * from './Modal' diff --git a/src/hooks/forms/index.ts b/src/hooks/forms/index.ts index c026210d..70d7fd67 100644 --- a/src/hooks/forms/index.ts +++ b/src/hooks/forms/index.ts @@ -1,3 +1,4 @@ +export * from './useForgotPasswordForm' export * from './useSignInForm' export * from './useSignUpForm' export * from './useTestForm' diff --git a/src/hooks/forms/useForgotPasswordForm.tsx b/src/hooks/forms/useForgotPasswordForm.tsx new file mode 100644 index 00000000..2481e31b --- /dev/null +++ b/src/hooks/forms/useForgotPasswordForm.tsx @@ -0,0 +1,49 @@ +import { useAuthControllerForgotPassword } from '@baca/api/query/auth/auth' +import { AuthForgotPasswordDto } from '@baca/api/types' +import { handleFormError, hapticImpact } from '@baca/utils' +import { useForm } from 'react-hook-form' + +const defaultValues: AuthForgotPasswordDto = { + email: '', +} + +export const useForgotPasswordForm = () => { + const { mutate: forgotPasswordMutate, isLoading: isSubmitting } = + useAuthControllerForgotPassword() + + const { + control, + formState: { errors }, + handleSubmit, + setError: setFormError, + } = useForm({ + mode: 'onTouched', + defaultValues, + }) + + const onSubmit = async (data: AuthForgotPasswordDto) => { + forgotPasswordMutate( + { data }, + { + onSuccess: () => {}, + onError: (e) => { + handleFormError( + e as unknown as keyof AuthForgotPasswordDto, + ({ field, description }) => { + setFormError(field, { message: description }) + } + ) + + hapticImpact() + }, + } + ) + } + + return { + control, + errors, + isSubmitting, + submit: handleSubmit(onSubmit), + } +} diff --git a/src/hooks/forms/useSignInForm.ts b/src/hooks/forms/useSignInForm.ts index 1783a4ec..82fa1f61 100644 --- a/src/hooks/forms/useSignInForm.ts +++ b/src/hooks/forms/useSignInForm.ts @@ -65,10 +65,10 @@ export const useSignInForm = () => { } return { - submit: handleSubmit(onSubmit), - isSubmitting, control, errors, + isSubmitting, setFocus, + submit: handleSubmit(onSubmit), } } diff --git a/src/i18n/translations/en.json b/src/i18n/translations/en.json index 78f63cb8..f7579a8e 100644 --- a/src/i18n/translations/en.json +++ b/src/i18n/translations/en.json @@ -169,6 +169,12 @@ "go_to_typography": "Go to Typography", "header": "This is Example screen" }, + "forgot_password_screen": { + "back_to_login": "Back to login", + "forgot_password": "Forgot password?", + "no_worries": "No worries, we’ll send you reset instructions.", + "reset_password": "Reset password" + }, "home_screen": { "details": "Details" }, diff --git a/src/i18n/translations/pl.json b/src/i18n/translations/pl.json index 5f82c33f..e6f288d0 100644 --- a/src/i18n/translations/pl.json +++ b/src/i18n/translations/pl.json @@ -168,6 +168,12 @@ "go_to_screen_with_BEdata": "Idź do widoku z danymi z backend-u", "go_to_screen_test_form": "Idź do formularza testowego" }, + "forgot_password_screen": { + "back_to_login": "Wróć do logowania", + "forgot_password": "Zapomniałeś hasła?", + "no_worries": "Bez obaw, wyślemy Ci instrukcje resetowania hasła.", + "reset_password": "Zresetuj hasło" + }, "home_screen": { "details": "Detale" }, diff --git a/src/navigation/tabNavigator/components/HeaderLogo.tsx b/src/navigation/tabNavigator/components/HeaderLogo.tsx index dd4653af..09db93c9 100644 --- a/src/navigation/tabNavigator/components/HeaderLogo.tsx +++ b/src/navigation/tabNavigator/components/HeaderLogo.tsx @@ -1,16 +1,14 @@ -import { darkLogoFull, darkLogoSygnet, lightLogoFull, lightLogoSygnet } from '@baca/constants' -import { useColorScheme } from '@baca/contexts' +import { CompanyLogo } from '@baca/components' import cssStyles from '@baca/styles' import { Pressable, Text } from '@bacons/react-views' import { Link } from 'expo-router' -import { Image, Platform, StyleSheet, View } from 'react-native' +import { Platform, StyleSheet, View } from 'react-native' import { useWidth } from '../hooks' import { TabColorsStrings } from '../navigation-config' import { cns } from '../utils' export function HeaderLogo() { - const { colorScheme } = useColorScheme() const isLargeHorizontal = useWidth(1264) return ( @@ -40,29 +38,23 @@ export function HeaderLogo() { }, ]} > - - )} @@ -85,8 +77,7 @@ const jsStyles = StyleSheet.create({ alignItems: 'center', borderRadius: 8, display: 'flex', - margin: 0, + marginVertical: 8, + padding: 8, }, - logoSygnet: { height: 60, width: 40 }, - logoWide: { height: 60, width: 150 }, }) diff --git a/src/screens/ForgotPasswordScreen.tsx b/src/screens/ForgotPasswordScreen.tsx index edfd166b..2e002cc6 100644 --- a/src/screens/ForgotPasswordScreen.tsx +++ b/src/screens/ForgotPasswordScreen.tsx @@ -1,4 +1,14 @@ -import { useScreenOptions, useTranslation } from '@baca/hooks' +import { + CompanyLogo, + ControlledField, + FeaturedIcon, + KeyboardAwareScrollView, +} from '@baca/components' +import { REGEX } from '@baca/constants' +import { Button, Center, Display, Spacer, Text } from '@baca/design-system' +import { useForgotPasswordForm, useScreenOptions, useTranslation } from '@baca/hooks' +import { router } from 'expo-router' +import { StyleSheet } from 'react-native' export const ForgotPasswordScreen = () => { const { t } = useTranslation() @@ -7,5 +17,53 @@ export const ForgotPasswordScreen = () => { title: t('navigation.screen_titles.forgot_password'), }) - return <> + const { control, errors, submit } = useForgotPasswordForm() + + return ( + +
+ + + + + + {t('forgot_password_screen.forgot_password')} + + {t('forgot_password_screen.no_worries')} + + + + + + +
+
+ ) } + +const styles = StyleSheet.create({ + contentContainerStyle: { padding: 32 }, +}) diff --git a/src/screens/SignInScreen.tsx b/src/screens/SignInScreen.tsx index 72944339..b9f41014 100644 --- a/src/screens/SignInScreen.tsx +++ b/src/screens/SignInScreen.tsx @@ -1,6 +1,11 @@ -import { ControlledField, KeyboardAwareScrollView, LanguagePicker, Version } from '@baca/components' -import { REGEX, darkLogo, lightLogo } from '@baca/constants' -import { useColorScheme } from '@baca/contexts' +import { + CompanyLogo, + ControlledField, + KeyboardAwareScrollView, + LanguagePicker, + Version, +} from '@baca/components' +import { REGEX } from '@baca/constants' import { Box, Button, Center, Row, Spacer, Text } from '@baca/design-system' import { useCallback, @@ -10,12 +15,10 @@ import { useScreenOptions, } from '@baca/hooks' import { useRouter } from 'expo-router' -import { StyleSheet, Image } from 'react-native' export const SignInScreen = (): JSX.Element => { const { push } = useRouter() const { t } = useTranslation() - const { colorScheme } = useColorScheme() useScreenOptions({ title: t('navigation.screen_titles.sign_in'), @@ -40,13 +43,9 @@ export const SignInScreen = (): JSX.Element => {
- - + + + { ) } - -const styles = StyleSheet.create({ - logo: { - height: 100, - width: '100%', - }, -}) diff --git a/src/screens/SignUpScreen.tsx b/src/screens/SignUpScreen.tsx index dee3915d..6b10b13a 100644 --- a/src/screens/SignUpScreen.tsx +++ b/src/screens/SignUpScreen.tsx @@ -1,4 +1,4 @@ -import { ControlledField, KeyboardAwareScrollView } from '@baca/components' +import { CompanyLogo, ControlledField, KeyboardAwareScrollView } from '@baca/components' import { Button, Center, Spacer } from '@baca/design-system' import { useScreenOptions, useSignUpForm, useTranslation } from '@baca/hooks' import { useCallback, useEffect } from 'react' @@ -25,6 +25,9 @@ export const SignUpScreen = () => { return (
+ + + Date: Thu, 21 Mar 2024 14:30:48 +0100 Subject: [PATCH 03/20] pass current email to forgot password screen --- src/hooks/forms/useForgotPasswordForm.tsx | 7 ++++++- src/hooks/forms/useSignInForm.ts | 2 ++ src/screens/ForgotPasswordScreen.tsx | 21 ++++++++++++++++----- src/screens/SignInScreen.tsx | 7 +++++-- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/hooks/forms/useForgotPasswordForm.tsx b/src/hooks/forms/useForgotPasswordForm.tsx index 2481e31b..e772e0d9 100644 --- a/src/hooks/forms/useForgotPasswordForm.tsx +++ b/src/hooks/forms/useForgotPasswordForm.tsx @@ -1,6 +1,7 @@ import { useAuthControllerForgotPassword } from '@baca/api/query/auth/auth' import { AuthForgotPasswordDto } from '@baca/api/types' import { handleFormError, hapticImpact } from '@baca/utils' +import { router } from 'expo-router' import { useForm } from 'react-hook-form' const defaultValues: AuthForgotPasswordDto = { @@ -15,6 +16,7 @@ export const useForgotPasswordForm = () => { control, formState: { errors }, handleSubmit, + reset, setError: setFormError, } = useForm({ mode: 'onTouched', @@ -25,7 +27,9 @@ export const useForgotPasswordForm = () => { forgotPasswordMutate( { data }, { - onSuccess: () => {}, + onSuccess: () => { + router.replace('/reset-password-sent') + }, onError: (e) => { handleFormError( e as unknown as keyof AuthForgotPasswordDto, @@ -44,6 +48,7 @@ export const useForgotPasswordForm = () => { control, errors, isSubmitting, + reset, submit: handleSubmit(onSubmit), } } diff --git a/src/hooks/forms/useSignInForm.ts b/src/hooks/forms/useSignInForm.ts index 82fa1f61..bddc2f77 100644 --- a/src/hooks/forms/useSignInForm.ts +++ b/src/hooks/forms/useSignInForm.ts @@ -27,6 +27,7 @@ export const useSignInForm = () => { const { control, formState: { errors }, + getValues, handleSubmit, setError: setFormError, setFocus, @@ -67,6 +68,7 @@ export const useSignInForm = () => { return { control, errors, + getValues, isSubmitting, setFocus, submit: handleSubmit(onSubmit), diff --git a/src/screens/ForgotPasswordScreen.tsx b/src/screens/ForgotPasswordScreen.tsx index 2e002cc6..86a84452 100644 --- a/src/screens/ForgotPasswordScreen.tsx +++ b/src/screens/ForgotPasswordScreen.tsx @@ -6,8 +6,8 @@ import { } from '@baca/components' import { REGEX } from '@baca/constants' import { Button, Center, Display, Spacer, Text } from '@baca/design-system' -import { useForgotPasswordForm, useScreenOptions, useTranslation } from '@baca/hooks' -import { router } from 'expo-router' +import { useForgotPasswordForm, useScreenOptions, useTranslation, useEffect } from '@baca/hooks' +import { router, useLocalSearchParams } from 'expo-router' import { StyleSheet } from 'react-native' export const ForgotPasswordScreen = () => { @@ -17,7 +17,15 @@ export const ForgotPasswordScreen = () => { title: t('navigation.screen_titles.forgot_password'), }) - const { control, errors, submit } = useForgotPasswordForm() + const { email } = useLocalSearchParams<{ email?: string }>() + + const { control, errors, reset, submit } = useForgotPasswordForm() + + useEffect(() => { + if (email) { + reset({ email: decodeURIComponent(email) }) + } + }, [email, reset]) return ( @@ -29,13 +37,16 @@ export const ForgotPasswordScreen = () => { {t('forgot_password_screen.forgot_password')} - {t('forgot_password_screen.no_worries')} + + {t('forgot_password_screen.no_worries')} + { testID="emailInput" /> - diff --git a/src/screens/SignInScreen.tsx b/src/screens/SignInScreen.tsx index b9f41014..a820a546 100644 --- a/src/screens/SignInScreen.tsx +++ b/src/screens/SignInScreen.tsx @@ -24,7 +24,7 @@ export const SignInScreen = (): JSX.Element => { title: t('navigation.screen_titles.sign_in'), }) - const { control, errors, submit, isSubmitting, setFocus } = useSignInForm() + const { control, errors, submit, getValues, isSubmitting, setFocus } = useSignInForm() useEffect(() => { setTimeout(() => { @@ -34,7 +34,10 @@ export const SignInScreen = (): JSX.Element => { const navigateToSignUp = useCallback(() => push('/sign-up'), [push]) const navigateToAppInfo = useCallback(() => push('/application-info'), [push]) - const navigateToForgotPassword = useCallback(() => push('/forgot-password'), [push]) + const navigateToForgotPassword = useCallback( + () => push(`/forgot-password?email=${encodeURIComponent(getValues('email'))}`), + [getValues, push] + ) const focusPasswordInput = useCallback(() => setFocus('password'), [setFocus]) return ( From bfa82b99369ce5bbcdc2ac1a0bc4f157e07c8901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Thu, 21 Mar 2024 15:40:01 +0100 Subject: [PATCH 04/20] add reset password link sent screen --- .../reset-password-link-sent.tsx | 2 + src/hooks/forms/useForgotPasswordForm.tsx | 7 +- src/i18n/translations/en.json | 8 ++ src/i18n/translations/pl.json | 8 ++ src/screens/ForgotPasswordScreen.tsx | 2 +- src/screens/ResetPasswordLinkSentScreen.tsx | 74 +++++++++++++++++++ src/screens/ResetPasswordScreen.tsx | 3 + src/screens/index.ts | 2 + 8 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 app/(app)/(not-authorized)/reset-password-link-sent.tsx create mode 100644 src/screens/ResetPasswordLinkSentScreen.tsx create mode 100644 src/screens/ResetPasswordScreen.tsx diff --git a/app/(app)/(not-authorized)/reset-password-link-sent.tsx b/app/(app)/(not-authorized)/reset-password-link-sent.tsx new file mode 100644 index 00000000..dcfec1d5 --- /dev/null +++ b/app/(app)/(not-authorized)/reset-password-link-sent.tsx @@ -0,0 +1,2 @@ +import { ResetPasswordLinkSentScreen } from '@baca/screens' +export default ResetPasswordLinkSentScreen diff --git a/src/hooks/forms/useForgotPasswordForm.tsx b/src/hooks/forms/useForgotPasswordForm.tsx index e772e0d9..db1aa3f2 100644 --- a/src/hooks/forms/useForgotPasswordForm.tsx +++ b/src/hooks/forms/useForgotPasswordForm.tsx @@ -8,7 +8,7 @@ const defaultValues: AuthForgotPasswordDto = { email: '', } -export const useForgotPasswordForm = () => { +export const useForgotPasswordForm = ({ onSuccess }: { onSuccess?: () => void }) => { const { mutate: forgotPasswordMutate, isLoading: isSubmitting } = useAuthControllerForgotPassword() @@ -27,8 +27,9 @@ export const useForgotPasswordForm = () => { forgotPasswordMutate( { data }, { - onSuccess: () => { - router.replace('/reset-password-sent') + onSuccess: (_, { data: { email } }) => { + if (onSuccess) onSuccess() + else router.replace(`/reset-password-link-sent?email=${encodeURIComponent(email)}`) }, onError: (e) => { handleFormError( diff --git a/src/i18n/translations/en.json b/src/i18n/translations/en.json index f7579a8e..c196b209 100644 --- a/src/i18n/translations/en.json +++ b/src/i18n/translations/en.json @@ -69,6 +69,7 @@ "home": "Home", "main_tab": "MainTab", "not_found": "Not Found", + "resetLinkSent": "Reset link sent", "settings": "Settings", "sign_in": "Sign in", "sign_up": "Sign up", @@ -184,6 +185,13 @@ "login_cta": "Log in", "sign_up": "Sign up" }, + "reset_password_link_sent_screen": { + "check_email": "Check your email", + "click_to_resend": "Click to resend", + "did_not_receive": "Didn’t receive the email?", + "open_email_app": "Open email app", + "we_sent_link": "We sent a password reset link to" + }, "settings_screen": { "copy_push_token": "Copy push token", "current_theme": "Current theme: {{theme}}", diff --git a/src/i18n/translations/pl.json b/src/i18n/translations/pl.json index e6f288d0..8adf89d8 100644 --- a/src/i18n/translations/pl.json +++ b/src/i18n/translations/pl.json @@ -69,6 +69,7 @@ "home": "Home", "main_tab": "MainTab", "not_found": "NotFound", + "resetLinkSent": "Link wysłany", "settings": "Settings", "sign_in": "Sign in", "sign_up": "Sign up", @@ -183,6 +184,13 @@ "go_to_blog": "Otwórz blog", "go_to_form": "Otwórz pełno ekranowy formularz full" }, + "reset_password_link_sent_screen": { + "check_email": "Sprawdź skrzynkę e-mail", + "click_to_resend": "Wyślij ponownie", + "did_not_receive": "Nie otrzymałeś wiadomości e-mail?", + "open_email_app": "Otwórz aplikację e-mail", + "we_sent_link": "Wysłaliśmy link resetujący hasło na" + }, "settings_screen": { "current_theme": "Current theme: {{theme}}", "selected": " - wybrano", diff --git a/src/screens/ForgotPasswordScreen.tsx b/src/screens/ForgotPasswordScreen.tsx index 86a84452..80d94d31 100644 --- a/src/screens/ForgotPasswordScreen.tsx +++ b/src/screens/ForgotPasswordScreen.tsx @@ -19,7 +19,7 @@ export const ForgotPasswordScreen = () => { const { email } = useLocalSearchParams<{ email?: string }>() - const { control, errors, reset, submit } = useForgotPasswordForm() + const { control, errors, reset, submit } = useForgotPasswordForm({}) useEffect(() => { if (email) { diff --git a/src/screens/ResetPasswordLinkSentScreen.tsx b/src/screens/ResetPasswordLinkSentScreen.tsx new file mode 100644 index 00000000..d29dce85 --- /dev/null +++ b/src/screens/ResetPasswordLinkSentScreen.tsx @@ -0,0 +1,74 @@ +import { CompanyLogo, FeaturedIcon, KeyboardAwareScrollView } from '@baca/components' +import { Button, Center, Display, Row, Spacer, Text } from '@baca/design-system' +import { useEffect, useForgotPasswordForm, useScreenOptions, useTranslation } from '@baca/hooks' +import { showSuccessToast } from '@baca/utils' +import { router, useLocalSearchParams } from 'expo-router' +import { StyleSheet } from 'react-native' + +const navigateToLogin = () => { + router.navigate('/sign-in') +} + +export const ResetPasswordLinkSentScreen = () => { + const { t } = useTranslation() + + useScreenOptions({ + title: t('navigation.screen_titles.forgot_password'), + }) + + const { email } = useLocalSearchParams<{ email?: string }>() + + const { reset, submit } = useForgotPasswordForm({ + onSuccess: () => { + showSuccessToast({ description: 'Password link resend' }) + }, + }) + + useEffect(() => { + if (email) { + reset({ email }) + } + }, [email, reset]) + + return ( + +
+ + + + + + {t('reset_password_link_sent_screen.check_email')} + + + {t('reset_password_link_sent_screen.we_sent_link')} + + {email} + + + + + + {t('reset_password_link_sent_screen.did_not_receive')} + + + + +
+
+ ) +} + +const styles = StyleSheet.create({ + contentContainerStyle: { padding: 32 }, +}) diff --git a/src/screens/ResetPasswordScreen.tsx b/src/screens/ResetPasswordScreen.tsx new file mode 100644 index 00000000..88155262 --- /dev/null +++ b/src/screens/ResetPasswordScreen.tsx @@ -0,0 +1,3 @@ +export const ResetPasswordScreen = () => { + return <> +} diff --git a/src/screens/index.ts b/src/screens/index.ts index af3f4550..e6bf5296 100644 --- a/src/screens/index.ts +++ b/src/screens/index.ts @@ -10,6 +10,8 @@ export * from './ForgotPasswordScreen' export * from './HomeScreen' export * from './NotFoundScreen' export * from './ProfileScreen' +export * from './ResetPasswordLinkSentScreen' +export * from './ResetPasswordScreen' export * from './SettingsScreen' export * from './SignInScreen' export * from './SignUpScreen' From 6cc242d101f080b744ee653f5515bad6b6d3c475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Fri, 22 Mar 2024 11:11:11 +0100 Subject: [PATCH 05/20] add small style fixes to header logo style --- src/navigation/tabNavigator/components/HeaderLogo.tsx | 10 +++------- src/navigation/tabNavigator/components/SideBar.tsx | 2 +- src/styles/root-layout.module.scss | 4 +--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/navigation/tabNavigator/components/HeaderLogo.tsx b/src/navigation/tabNavigator/components/HeaderLogo.tsx index 09db93c9..4eb285b6 100644 --- a/src/navigation/tabNavigator/components/HeaderLogo.tsx +++ b/src/navigation/tabNavigator/components/HeaderLogo.tsx @@ -1,6 +1,6 @@ import { CompanyLogo } from '@baca/components' import cssStyles from '@baca/styles' -import { Pressable, Text } from '@bacons/react-views' +import { Pressable } from '@bacons/react-views' import { Link } from 'expo-router' import { Platform, StyleSheet, View } from 'react-native' @@ -28,7 +28,7 @@ export function HeaderLogo() { > {({ hovered }) => ( - - + )} @@ -66,8 +66,6 @@ export function HeaderLogo() { const jsStyles = StyleSheet.create({ headerContainer: { - height: 96, - minHeight: 96, paddingTop: 0, }, headerLink: { @@ -76,8 +74,6 @@ const jsStyles = StyleSheet.create({ headerLogo: { alignItems: 'center', borderRadius: 8, - display: 'flex', - marginVertical: 8, padding: 8, }, }) diff --git a/src/navigation/tabNavigator/components/SideBar.tsx b/src/navigation/tabNavigator/components/SideBar.tsx index 27c7de5e..ea94fa78 100644 --- a/src/navigation/tabNavigator/components/SideBar.tsx +++ b/src/navigation/tabNavigator/components/SideBar.tsx @@ -65,7 +65,7 @@ export function SideBar({ visible }: { visible: boolean }) { > - + {upperSideTabs.map((tab) => ( {tab.displayedName} diff --git a/src/styles/root-layout.module.scss b/src/styles/root-layout.module.scss index c65cb1bc..6046563b 100644 --- a/src/styles/root-layout.module.scss +++ b/src/styles/root-layout.module.scss @@ -15,8 +15,6 @@ $ui-sidebar: 244px; // Header Logo .headerContainer { padding-top: 0px; - min-height: 96px; - height: 96px; } .headerLink { @@ -87,5 +85,5 @@ $ui-sidebar: 244px; } .sideBarHeader { - align-items: center; + align-items: stretch; } From f9a96dd7424ca3cd29d151bbe59593c8350d179a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Fri, 22 Mar 2024 11:53:19 +0100 Subject: [PATCH 06/20] remove full logo --- assets/logo/logo-full-dark.png | Bin 15683 -> 0 bytes assets/logo/logo-full-light.png | Bin 21203 -> 0 bytes src/constants/images.ts | 3 --- .../tabNavigator/components/AppHeader.tsx | 23 ++++-------------- 4 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 assets/logo/logo-full-dark.png delete mode 100644 assets/logo/logo-full-light.png diff --git a/assets/logo/logo-full-dark.png b/assets/logo/logo-full-dark.png deleted file mode 100644 index a14668ad3a815802cd2461433f55150f745aaf56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15683 zcmeHuXHZl@*QNr35=A5nh)B*EhMWZ?XC#W`BpC(KjGf2M-=1 z|CR?HD?=KAIG4{uu?8ud` zS=x%JuPC$`KViKp=jE8=EVO#GU-e$$(brcKaG967I9w+a@~Y8~a1?jBpWwWa$6^e} zdDCu-SzTQbA3pfda=em!8z`N>lP5S9Fef)H+y;KX_EbB~73>K^@1B(z} zFzPm+gJ-cm4ow9=-U6gaitF>{5UEPsNGO;LSuDj3Lku{+5L~i$Rob@QZ`N)WQIl)p!`^T)hTUh#)W=SdMzuGNvTMuqY(ru1GR2;%HJ~TyDC- za`7CH636FyTw8gOd|xv#*^k~GCK@!}^KT|*K~LUPmPvIp5T$w2wNK&}Z7hU9H$1Xe zC>FM-aNhp--_7tPmH`6*5h{yt7bL-zj{_&qOrMS;$REm1vkHM52ZaJCZ~|*u{>aQZ zPABYB-*J!4-0KU>gTX;|`iE_Rv+WG(9>SAxHwwKFqeo3KcHm6F}*XUCi_fh5SOfS9GvQEduQ=A z{!DyReKe*n@k4GB1X#I0neJVtu;pEupjNk!(0>NM`<#H#%{daeB)pp@7j(>V0^|snvLDb4ukk| zW=&2B^WpmgoB#Tp|MgM-uh)38a@6nk^l{*i+%wwYB3&5Kd+HdR%HW^6HE?P?GlTR2 z`r%*G@7sdDkv>*w=|g5&&vc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WKpfVc0z1!YScx2CTrK6i)*P{SHTB(75v3@Ld>ts}4$x!mJtf z3L9TE+=Qx5EQ05Rhb)zg60)JUXO=g{r&=mkG)2+^n6BKxVogMH(`=3;{!Y)M6 z%jFi8FE|P>!^bGnTC4xyL>>fMWB2B&f)W!(6ZVVD`kij_wplNKa+oQU^M+`+OJ8mD zvu+|ms(&**|0MOB(tbqek7F-;q(HAWRo;!RmC?2wz8i{L!UXPu+k#Mg96>x)Cn?H1 z5~IM6KmP>bwFWVn|LeSKT_M?D81E6@3iTMg9@Qx#-qN`CJ7>A`m25KQoSnxkQs1md zPy2s8R+H|Vtfn=dw*>fTb$!hXg|qxWEl>RKQpNwXWe1W_42cZ*{0%haS;^m1(GOIW LG!<**tv>$`_+2r+ diff --git a/assets/logo/logo-full-light.png b/assets/logo/logo-full-light.png deleted file mode 100644 index 5f767a5a273e4b401fa3af58f2f3784107821361..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21203 zcmeFZV{m5OyC>XH$F@63$F{AGZQJ%8b!^+Vb*JNwZQHh;ym|iTocF^yXQpauYCcTW zeA~PB-mCV)wbu2+T4D0C;_xsyFyFp?gO~UvqWJ9_$lcfV5Y+dtD+>Y=pRXHmGeH@_ zZ{O--VBZWNzI_w;CLtoI><)6C1+9-Z|30{xu`JW$ov{A&0I5ujg4{pTy{*h#dwf_Q9;T^sGJKEHN*g#;SD;bCOj% zbw-9NjkjN03LS}i$9PhH+_3ynf_0v`iz%t?y_?5m4|g>B91F4RV8BxLW*q~_gXW%ktJO4ye8*5<;Usj25;(IyiQw5t;tT3>Jklh#9yOL- zG~eDex6Fg<3nf#}QRH^U!L}frJaGb<`&suM=WRg3ofJ&TrU2)UJjLMcTh+IOF)7$l z!pNp(FX8zE^^PU8qDV8N`!{$MD@yW0R0qe5pMl8Jrgd7OzcP*9PoAuSc(x@R5IvnS zP3oAH4smHFbn|i)qkZLya-v9MDVB;kh8aXs^lFk`-&WCGC~y+bN&3f2#gNN$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;O}#3rnLUXKP_1SLWvS8r^&<^L?$4+i&79`IcqO(U;NnZ4Lx;1?!FNGV z8|ixzR)>nCgr$V=Osn=Y-;l zEu`x^;YEFhxR&NK7c(JOH??(woE5V0-XDNV!{jCmCck`i*HFl%<<5BF%B@`~`fh^! zFp9u4Fc3IqayQpstRh?K#;w;I0{1gyFa7tX}5(4Et zpJ$f{(0w@A>JssPOTV*SQNUiE-J8b=c5~J0=`jV|r0#Xvz-1OV*w^xopP(L{pilw_iKVmgy_HX*`bWiwW|lCRCjJ zJtd5~@;_uz6b)=tNk@g0le9=at#OCkw8RDJVzc6nLV(A7lI8r_U8dmfc$tM;S!|!t z|B1JqHRf`?hdm*&pLmpSByQs}9#af?z{Sn=e88B5SCio(0iR}D%eIG@mblidNIU=h zzg4ci?OzwM9dGYXyD3CTdX6PBz0?=hU&5>_$kb(7E)|AWT}DP+FIa$_SRs4%XpnTO zjTFDxBtBXpj|(#EKZe5pL3n?P4FCNPS?0NX&fJiaT4$b^3;gS1^t6q&DnRy;{|3*& Bh@b!f diff --git a/src/constants/images.ts b/src/constants/images.ts index 52b081b3..baf24b92 100644 --- a/src/constants/images.ts +++ b/src/constants/images.ts @@ -5,8 +5,5 @@ export const lightLogo = require('@baca/assets/logo-light.png') export const darkBinarLogo = require('@baca/assets/logo/logo-dark.png') export const lightBinarLogo = require('@baca/assets/logo/logo-light.png') -export const darkLogoFull = require('@baca/assets/logo/logo-full-dark.png') -export const lightLogoFull = require('@baca/assets/logo/logo-full-light.png') - export const darkLogoSygnet = require('@baca/assets/logo/logo-sygnet-dark.png') export const lightLogoSygnet = require('@baca/assets/logo/logo-sygnet-light.png') diff --git a/src/navigation/tabNavigator/components/AppHeader.tsx b/src/navigation/tabNavigator/components/AppHeader.tsx index 7cc37e32..11a64a27 100644 --- a/src/navigation/tabNavigator/components/AppHeader.tsx +++ b/src/navigation/tabNavigator/components/AppHeader.tsx @@ -1,29 +1,16 @@ -import { darkLogoFull, lightLogoFull } from '@baca/constants' -import { useColorScheme } from '@baca/contexts' -import { Image, Platform, StyleSheet, View } from 'react-native' +import { CompanyLogo } from '@baca/components' +import { Platform, StyleSheet, View } from 'react-native' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { TabColorsStrings } from '../navigation-config' export function AppHeader() { - const { colorScheme } = useColorScheme() const { top } = useSafeAreaInsets() const height = 60 + top return ( - - + + ) } @@ -38,6 +25,6 @@ const jsStyles = StyleSheet.create({ paddingHorizontal: 16, width: '100%', zIndex: 10, + ...Platform.select({ default: { display: 'none' }, web: { display: 'flex' } }), }, - logoWide: { height: 60, width: 150 }, }) From 72f04de07996c4a9228aa77735191e5abcc927bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Fri, 22 Mar 2024 12:00:21 +0100 Subject: [PATCH 07/20] replace company logo here and there --- src/components/index.ts | 1 + src/screens/CategoriesScreen.tsx | 20 ++------------------ src/screens/HomeScreen.tsx | 20 ++------------------ src/screens/LandingScreen.tsx | 22 ++-------------------- 4 files changed, 7 insertions(+), 56 deletions(-) diff --git a/src/components/index.ts b/src/components/index.ts index e1cb6335..5f7e6034 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -5,6 +5,7 @@ export * from './AppLoading' export * from './CompanyLogo' export * from './FeaturedIcon' export * from './KeyboardAwareScrollView' +export * from './LandingHeader' export * from './LanguagePicker' export * from './Modal' export * from './StatusBar' diff --git a/src/screens/CategoriesScreen.tsx b/src/screens/CategoriesScreen.tsx index cd18c4de..52a19bc8 100644 --- a/src/screens/CategoriesScreen.tsx +++ b/src/screens/CategoriesScreen.tsx @@ -1,32 +1,16 @@ -import { darkLogo, lightLogo } from '@baca/constants' -import { useColorScheme } from '@baca/contexts' +import { CompanyLogo } from '@baca/components' import { Center, Text } from '@baca/design-system' import { useScreenOptions } from '@baca/hooks' -import { Image, StyleSheet } from 'react-native' export const CategoriesScreen = () => { useScreenOptions({ title: 'Categories', }) - const { colorScheme } = useColorScheme() - return (
- + Categories screen
) } - -const styles = StyleSheet.create({ - logo: { - height: 50, - width: '100%', - }, -}) diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index d3c28780..4e9b4610 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -1,10 +1,8 @@ import { useArticlesControllerFindAll } from '@baca/api/query/articles/articles' -import { darkLogo, lightLogo } from '@baca/constants' -import { useColorScheme } from '@baca/contexts' +import { CompanyLogo } from '@baca/components' import { Button, Center, Text } from '@baca/design-system' import { useCallback, useScreenOptions, useTranslation } from '@baca/hooks' import { router } from 'expo-router' -import { Image, StyleSheet } from 'react-native' export const HomeScreen = () => { const { t } = useTranslation() @@ -13,8 +11,6 @@ export const HomeScreen = () => { title: t('navigation.screen_titles.home'), }) - const { colorScheme } = useColorScheme() - useArticlesControllerFindAll({ page: 1, pageSize: 10 }) const navigateToDetails = useCallback(() => { @@ -33,12 +29,7 @@ export const HomeScreen = () => { return (
- + {t('hello')} {t('thanks')} {t('app_information')} @@ -54,10 +45,3 @@ export const HomeScreen = () => {
) } - -const styles = StyleSheet.create({ - logo: { - height: 50, - width: '100%', - }, -}) diff --git a/src/screens/LandingScreen.tsx b/src/screens/LandingScreen.tsx index 3ff4fd70..ffafaf54 100644 --- a/src/screens/LandingScreen.tsx +++ b/src/screens/LandingScreen.tsx @@ -1,11 +1,7 @@ -import { KeyboardAwareScrollView } from '@baca/components' -import { LandingHeader } from '@baca/components/LandingHeader' -import { darkLogo, lightLogo } from '@baca/constants' -import { useColorScheme } from '@baca/contexts' +import { CompanyLogo, KeyboardAwareScrollView, LandingHeader } from '@baca/components' import { Button, Center, Text } from '@baca/design-system' import { useCallback, useScreenOptions, useTranslation } from '@baca/hooks' import { router } from 'expo-router' -import { Image, StyleSheet } from 'react-native' export const LandingScreen = () => { const { t } = useTranslation() @@ -14,8 +10,6 @@ export const LandingScreen = () => { title: t('navigation.screen_titles.home'), }) - const { colorScheme } = useColorScheme() - const navigateToBlog = useCallback(() => { router.navigate('/blog') }, []) @@ -28,12 +22,7 @@ export const LandingScreen = () => {
- + {t('hello')} {t('thanks')} {t('app_information')} @@ -47,10 +36,3 @@ export const LandingScreen = () => { ) } - -const styles = StyleSheet.create({ - logo: { - height: 50, - width: '100%', - }, -}) From 0f8e41a725223cc0841edba8bec0b232b40dfc7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Mon, 25 Mar 2024 08:35:24 +0100 Subject: [PATCH 08/20] change checkbox text size --- src/design-system/components/Checkbox.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/design-system/components/Checkbox.tsx b/src/design-system/components/Checkbox.tsx index 91b02831..e2be0237 100644 --- a/src/design-system/components/Checkbox.tsx +++ b/src/design-system/components/Checkbox.tsx @@ -97,7 +97,7 @@ export const Checkbox = forwardRef( ) : null} - {checkboxText} + {checkboxText} ) From 2d0e0f234787a851ccff9d5a1a2c42041ae44f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Mon, 25 Mar 2024 09:22:46 +0100 Subject: [PATCH 09/20] add form wrapper --- src/components/index.ts | 1 + src/components/wrappers/FormWrapper.tsx | 24 +++++++++++++++++ src/components/wrappers/index.ts | 1 + src/hooks/forms/useSignInForm.ts | 2 +- src/screens/ForgotPasswordScreen.tsx | 29 ++++++--------------- src/screens/ResetPasswordLinkSentScreen.tsx | 24 +++++++---------- 6 files changed, 44 insertions(+), 37 deletions(-) create mode 100644 src/components/wrappers/FormWrapper.tsx create mode 100644 src/components/wrappers/index.ts diff --git a/src/components/index.ts b/src/components/index.ts index 5f7e6034..129263d8 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,5 +1,6 @@ export * from './molecules' export * from './organisms' +export * from './wrappers' export * from './AppLoading' export * from './CompanyLogo' diff --git a/src/components/wrappers/FormWrapper.tsx b/src/components/wrappers/FormWrapper.tsx new file mode 100644 index 00000000..78e00acc --- /dev/null +++ b/src/components/wrappers/FormWrapper.tsx @@ -0,0 +1,24 @@ +import { useScreenOptions } from '@baca/hooks' +import { FC, PropsWithChildren } from 'react' +import { StyleSheet } from 'react-native' + +import { KeyboardAwareScrollView } from '../KeyboardAwareScrollView' + +export const FormWrapper: FC = ({ children }) => { + useScreenOptions({ headerShown: false }) + return ( + + {children} + + ) +} + +const styles = StyleSheet.create({ + contentContainerStyle: { + alignSelf: 'center', + flex: 1, + flexGrow: 1, + maxWidth: 360, + width: '100%', + }, +}) diff --git a/src/components/wrappers/index.ts b/src/components/wrappers/index.ts new file mode 100644 index 00000000..719fcfb6 --- /dev/null +++ b/src/components/wrappers/index.ts @@ -0,0 +1 @@ +export * from './FormWrapper' diff --git a/src/hooks/forms/useSignInForm.ts b/src/hooks/forms/useSignInForm.ts index bddc2f77..e0b5d0d8 100644 --- a/src/hooks/forms/useSignInForm.ts +++ b/src/hooks/forms/useSignInForm.ts @@ -12,7 +12,7 @@ type SignInFormValues = AuthEmailLoginDto & { const defaultValues: SignInFormValues = { // TODO: Reset this values when building production app - email: 'l.jeziorski+user@binarapps.com', + email: 'm.baumruck+user@binarapps.com', password: 'Qwerty1!', confirm: false, } diff --git a/src/screens/ForgotPasswordScreen.tsx b/src/screens/ForgotPasswordScreen.tsx index 80d94d31..a6eef520 100644 --- a/src/screens/ForgotPasswordScreen.tsx +++ b/src/screens/ForgotPasswordScreen.tsx @@ -1,22 +1,12 @@ -import { - CompanyLogo, - ControlledField, - FeaturedIcon, - KeyboardAwareScrollView, -} from '@baca/components' +import { CompanyLogo, ControlledField, FeaturedIcon, FormWrapper } from '@baca/components' import { REGEX } from '@baca/constants' import { Button, Center, Display, Spacer, Text } from '@baca/design-system' -import { useForgotPasswordForm, useScreenOptions, useTranslation, useEffect } from '@baca/hooks' +import { useForgotPasswordForm, useTranslation, useEffect } from '@baca/hooks' import { router, useLocalSearchParams } from 'expo-router' -import { StyleSheet } from 'react-native' export const ForgotPasswordScreen = () => { const { t } = useTranslation() - useScreenOptions({ - title: t('navigation.screen_titles.forgot_password'), - }) - const { email } = useLocalSearchParams<{ email?: string }>() const { control, errors, reset, submit } = useForgotPasswordForm({}) @@ -28,16 +18,16 @@ export const ForgotPasswordScreen = () => { }, [email, reset]) return ( - +
- + {t('forgot_password_screen.forgot_password')} - + {t('forgot_password_screen.no_worries')} @@ -64,17 +54,14 @@ export const ForgotPasswordScreen = () => { - +
-
+ ) } - -const styles = StyleSheet.create({ - contentContainerStyle: { padding: 32 }, -}) diff --git a/src/screens/ResetPasswordLinkSentScreen.tsx b/src/screens/ResetPasswordLinkSentScreen.tsx index d29dce85..693a4b04 100644 --- a/src/screens/ResetPasswordLinkSentScreen.tsx +++ b/src/screens/ResetPasswordLinkSentScreen.tsx @@ -1,9 +1,8 @@ -import { CompanyLogo, FeaturedIcon, KeyboardAwareScrollView } from '@baca/components' +import { CompanyLogo, FeaturedIcon, FormWrapper } from '@baca/components' import { Button, Center, Display, Row, Spacer, Text } from '@baca/design-system' -import { useEffect, useForgotPasswordForm, useScreenOptions, useTranslation } from '@baca/hooks' +import { useEffect, useForgotPasswordForm, useTranslation } from '@baca/hooks' import { showSuccessToast } from '@baca/utils' import { router, useLocalSearchParams } from 'expo-router' -import { StyleSheet } from 'react-native' const navigateToLogin = () => { router.navigate('/sign-in') @@ -12,9 +11,9 @@ const navigateToLogin = () => { export const ResetPasswordLinkSentScreen = () => { const { t } = useTranslation() - useScreenOptions({ - title: t('navigation.screen_titles.forgot_password'), - }) + // useScreenOptions({ + // title: t('navigation.screen_titles.forgot_password'), + // }) const { email } = useLocalSearchParams<{ email?: string }>() @@ -31,21 +30,20 @@ export const ResetPasswordLinkSentScreen = () => { }, [email, reset]) return ( - +
- + {t('reset_password_link_sent_screen.check_email')} - + {t('reset_password_link_sent_screen.we_sent_link')} {email} - @@ -65,10 +63,6 @@ export const ResetPasswordLinkSentScreen = () => { title={t('forgot_password_screen.back_to_login')} />
-
+ ) } - -const styles = StyleSheet.create({ - contentContainerStyle: { padding: 32 }, -}) From 99c41a4bdeede06fb9738881d0760ac9ca026cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Tue, 26 Mar 2024 10:06:45 +0100 Subject: [PATCH 10/20] refactor button --- .../components/Button/Button.tsx | 59 +++++++++---------- 1 file changed, 27 insertions(+), 32 deletions(-) diff --git a/src/design-system/components/Button/Button.tsx b/src/design-system/components/Button/Button.tsx index e9af61ef..a3248681 100644 --- a/src/design-system/components/Button/Button.tsx +++ b/src/design-system/components/Button/Button.tsx @@ -1,4 +1,4 @@ -import { useColorScheme } from '@baca/contexts' +import { useTheme } from '@baca/hooks' import { IconNames } from '@baca/types/icon' import { getColorValue } from '@baca/utils' import { @@ -28,7 +28,6 @@ import { buttonSizeVariants, buttonVariants, getButtonShadowStyle, - theme, } from '../../config' import { generateStyledComponent } from '../../utils' import { Icon } from '../Icon' @@ -84,7 +83,7 @@ const RawButton = memo( }, ref ) => { - const { colorScheme } = useColorScheme() + const { colors } = useTheme() const { hoverProps, isHovered } = useHover() const { hoveredStyle, defaultStyle, disabledStyle } = useMemo( () => buttonVariants[variant], @@ -99,76 +98,66 @@ const RawButton = memo( () => ({ backgroundColor: getColorValue({ color: hoveredStyle.backgroundColor, - colors: colorScheme === 'light' ? theme.light.colors : theme.dark.colors, + colors, }), borderColor: getColorValue({ color: hoveredStyle.borderColor!, - colors: colorScheme === 'light' ? theme.light.colors : theme.dark.colors, + colors, }), borderWidth: hoveredStyle.borderWidth, }), - [ - colorScheme, - hoveredStyle.backgroundColor, - hoveredStyle.borderColor, - hoveredStyle.borderWidth, - ] + [colors, hoveredStyle.backgroundColor, hoveredStyle.borderColor, hoveredStyle.borderWidth] ) const hoverColorStyle = useMemo( () => ({ color: getColorValue({ color: hoveredStyle.color!, - colors: colorScheme === 'light' ? theme.light.colors : theme.dark.colors, + colors, }), }), - [colorScheme, hoveredStyle.color] + [colors, hoveredStyle.color] ) const defaultStyles = useMemo( () => ({ backgroundColor: getColorValue({ color: defaultStyle.backgroundColor, - colors: colorScheme === 'light' ? theme.light.colors : theme.dark.colors, + colors, }), borderColor: getColorValue({ color: defaultStyle.borderColor!, - colors: colorScheme === 'light' ? theme.light.colors : theme.dark.colors, + colors, }), borderWidth: defaultStyle.borderWidth, }), - [ - colorScheme, - defaultStyle.backgroundColor, - defaultStyle.borderColor, - defaultStyle.borderWidth, - ] + [colors, defaultStyle.backgroundColor, defaultStyle.borderColor, defaultStyle.borderWidth] ) const defaultColorStyle = useMemo( () => ({ color: getColorValue({ color: defaultStyle.color!, - colors: colorScheme === 'light' ? theme.light.colors : theme.dark.colors, + colors, }), }), - [colorScheme, defaultStyle.color] + [colors, defaultStyle.color] ) const disabledStyles = useMemo( () => ({ backgroundColor: getColorValue({ color: disabledStyle.backgroundColor, - colors: colorScheme === 'light' ? theme.light.colors : theme.dark.colors, + colors, }), borderColor: getColorValue({ color: disabledStyle.borderColor!, - colors: colorScheme === 'light' ? theme.light.colors : theme.dark.colors, + colors, }), borderWidth: disabledStyle.borderWidth, }), [ - colorScheme, + colors, disabledStyle.backgroundColor, disabledStyle.borderColor, disabledStyle.borderWidth, @@ -179,10 +168,10 @@ const RawButton = memo( () => ({ color: getColorValue({ color: disabledStyle.color!, - colors: colorScheme === 'light' ? theme.light.colors : theme.dark.colors, + colors, }), }), - [colorScheme, disabledStyle.color] + [colors, disabledStyle.color] ) const buttonSizeVariant = buttonSizeVariants[size] @@ -261,10 +250,11 @@ const RawButton = memo( if (title) { return ( {title} @@ -273,10 +263,11 @@ const RawButton = memo( if (typeof children === 'string') { return ( {children} @@ -298,7 +289,11 @@ const RawButton = memo( {...{ ...hoverProps, ref, ...props }} > {loading ? ( - + ) : ( (props: PressableStateCallbackType) => ( @@ -326,7 +321,7 @@ const Button = generateStyledComponent( ) as ButtonComposition const generateButtonVariant = (variant: ButtonVariant) => - forwardRef((props, ref) => diff --git a/src/screens/ResetPasswordLinkSentScreen.tsx b/src/screens/ResetPasswordLinkSentScreen.tsx index 693a4b04..e1bf7858 100644 --- a/src/screens/ResetPasswordLinkSentScreen.tsx +++ b/src/screens/ResetPasswordLinkSentScreen.tsx @@ -11,13 +11,9 @@ const navigateToLogin = () => { export const ResetPasswordLinkSentScreen = () => { const { t } = useTranslation() - // useScreenOptions({ - // title: t('navigation.screen_titles.forgot_password'), - // }) - const { email } = useLocalSearchParams<{ email?: string }>() - const { reset, submit } = useForgotPasswordForm({ + const { isSubmitting, reset, submit } = useForgotPasswordForm({ onSuccess: () => { showSuccessToast({ description: 'Password link resend' }) }, @@ -51,6 +47,7 @@ export const ResetPasswordLinkSentScreen = () => { {t('reset_password_link_sent_screen.did_not_receive')} Date: Tue, 26 Mar 2024 10:38:19 +0100 Subject: [PATCH 12/20] handle to many request error --- src/api/axios/custom-instance.ts | 5 +++++ src/i18n/translations/en.json | 3 ++- src/i18n/translations/pl.json | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/api/axios/custom-instance.ts b/src/api/axios/custom-instance.ts index 4a8ced25..0acacf3a 100644 --- a/src/api/axios/custom-instance.ts +++ b/src/api/axios/custom-instance.ts @@ -42,6 +42,11 @@ AXIOS_INSTANCE.interceptors.response.use( throw formErrors } + if (error.response?.status === 429) { + showErrorToast({ title: 'ERROR', description: i18n.t('errors.to_may_requests') }) + return + } + // TODO: we should handle certain error type if (errorMessage) { showErrorToast({ title: 'ERROR', description: i18n.t('errors.something_went_wrong') }) diff --git a/src/i18n/translations/en.json b/src/i18n/translations/en.json index c196b209..f176eac0 100644 --- a/src/i18n/translations/en.json +++ b/src/i18n/translations/en.json @@ -16,7 +16,8 @@ "missing_auth": "Missing auth", "screen_not_found": "NotFound screen", "something_went_wrong": "Something went wrong", - "token_expired": "Token expired" + "token_expired": "Token expired", + "to_may_requests": "To many request. Please try again after few minutes" }, "examples_component": { "example": "Example" diff --git a/src/i18n/translations/pl.json b/src/i18n/translations/pl.json index 8adf89d8..d5d4e0fd 100644 --- a/src/i18n/translations/pl.json +++ b/src/i18n/translations/pl.json @@ -16,7 +16,8 @@ "missing_auth": "Brak autoryzacji", "screen_not_found": "NotFound screen", "something_went_wrong": "Coś poszło nie tak", - "token_expired": "Token wygasł" + "token_expired": "Token wygasł", + "to_may_requests": "Zbyt wiele prób, spróbuj ponownie za kilka minut" }, "examples_component": { "example": "Przykład" From 1614dcd928b520c1a7511e703c7955c839e399ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Tue, 26 Mar 2024 12:26:25 +0100 Subject: [PATCH 13/20] add small fixes / refactor --- App.web.tsx | 2 +- src/constants/regex.ts | 2 +- src/design-system/components/Button/Button.tsx | 2 +- src/utils/showToast.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/App.web.tsx b/App.web.tsx index 0edc6f34..9fd96927 100644 --- a/App.web.tsx +++ b/App.web.tsx @@ -11,7 +11,7 @@ import { startMockedServer } from '@baca/services' import 'expo-router/entry' // FIXME: moking not working on mobile app - follow this discussion https://github.com/mswjs/msw/issues/2026 -const ENABLE_MOCKED_SERVER = true +const ENABLE_MOCKED_SERVER = false if (ENABLE_MOCKED_SERVER) { startMockedServer() diff --git a/src/constants/regex.ts b/src/constants/regex.ts index d89c9c67..f703ae7a 100644 --- a/src/constants/regex.ts +++ b/src/constants/regex.ts @@ -1,5 +1,5 @@ export const REGEX = { EMAIL: /^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/g, // PASSWORD - minimum: at least 8 chars, 1 small letter, 1 big letter, 1 special char, 1 number - REGISTRATION_PASSWORD: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/g, + REGISTRATION_PASSWORD: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@#$%^&*!])[A-Za-z\d@#$%^&*!]{8,}$/, } as const diff --git a/src/design-system/components/Button/Button.tsx b/src/design-system/components/Button/Button.tsx index a3248681..1ac12982 100644 --- a/src/design-system/components/Button/Button.tsx +++ b/src/design-system/components/Button/Button.tsx @@ -299,7 +299,7 @@ const RawButton = memo( {leftIconName && iconElement(props, leftIconName)} {childrenElement(props)} - {rightIconName && iconElement(props, leftIconName)} + {rightIconName && iconElement(props, rightIconName)} ) )} diff --git a/src/utils/showToast.ts b/src/utils/showToast.ts index 74113dd3..9872acc4 100644 --- a/src/utils/showToast.ts +++ b/src/utils/showToast.ts @@ -24,7 +24,7 @@ const showCustomToast = ({ error: i18n.t('toast.title.error'), info: i18n.t('toast.title.info'), warning: i18n.t('toast.title.warning'), - success: i18n.t('toast.title.warning'), + success: i18n.t('toast.title.success'), }[variant] notify(variant, { From 8f56fdc86a61e7ba140d86ac65bc7d1eba5c1c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Tue, 26 Mar 2024 14:07:20 +0100 Subject: [PATCH 14/20] add reset password screens --- .../reset-password-complete.tsx | 3 + app/(app)/(not-authorized)/reset-password.tsx | 3 + src/api/axios/custom-instance.ts | 29 +++++- src/hooks/forms/index.ts | 1 + src/hooks/forms/useResetPasswordForm.tsx | 57 +++++++++++ src/hooks/forms/useSignInForm.ts | 2 +- src/i18n/translations/en.json | 13 +++ src/i18n/translations/pl.json | 17 +++- src/screens/ConfirmEmail.tsx | 6 +- src/screens/ResetPasswordCompleteScreen.tsx | 31 ++++++ src/screens/ResetPasswordScreen.tsx | 95 ++++++++++++++++++- src/screens/index.ts | 1 + 12 files changed, 246 insertions(+), 12 deletions(-) create mode 100644 app/(app)/(not-authorized)/reset-password-complete.tsx create mode 100644 app/(app)/(not-authorized)/reset-password.tsx create mode 100644 src/hooks/forms/useResetPasswordForm.tsx create mode 100644 src/screens/ResetPasswordCompleteScreen.tsx diff --git a/app/(app)/(not-authorized)/reset-password-complete.tsx b/app/(app)/(not-authorized)/reset-password-complete.tsx new file mode 100644 index 00000000..6714dff0 --- /dev/null +++ b/app/(app)/(not-authorized)/reset-password-complete.tsx @@ -0,0 +1,3 @@ +import { ResetPasswordCompleteScreen } from '@baca/screens' + +export default ResetPasswordCompleteScreen diff --git a/app/(app)/(not-authorized)/reset-password.tsx b/app/(app)/(not-authorized)/reset-password.tsx new file mode 100644 index 00000000..cba7da09 --- /dev/null +++ b/app/(app)/(not-authorized)/reset-password.tsx @@ -0,0 +1,3 @@ +import { ResetPasswordScreen } from '@baca/screens' + +export default ResetPasswordScreen diff --git a/src/api/axios/custom-instance.ts b/src/api/axios/custom-instance.ts index 0acacf3a..ba994ad1 100644 --- a/src/api/axios/custom-instance.ts +++ b/src/api/axios/custom-instance.ts @@ -8,13 +8,28 @@ import qs from 'qs' import { injectTokenToRequest } from './interceptors' -export type ApiError = { - error?: string +type ApiErrorType = { + error: string + message: string + statusCode: number + + errors: never + status: never +} + +type FormErrorType = { errors?: { [key: string]: string[] } + status: number + + error: never + message: never + statusCode: never } +export type ApiError = ApiErrorType | FormErrorType + export const baseURL = ENV.API_URL export const AXIOS_INSTANCE = Axios.create({ @@ -35,21 +50,25 @@ AXIOS_INSTANCE.interceptors.response.use( return response }, async (error: AxiosError) => { - const errorMessage = error?.response?.data?.error + console.log('ERRRRRR DUPA ERRR', error) + // handle FormErrorType const formErrors = error?.response?.data?.errors if (formErrors) { throw formErrors } + // handle ApiErrorType + const errorMessage = error?.response?.data?.message + if (error.response?.status === 429) { - showErrorToast({ title: 'ERROR', description: i18n.t('errors.to_may_requests') }) + showErrorToast({ description: i18n.t('errors.to_may_requests') }) return } // TODO: we should handle certain error type if (errorMessage) { - showErrorToast({ title: 'ERROR', description: i18n.t('errors.something_went_wrong') }) + showErrorToast({ description: errorMessage }) //CONFIG: Add errors in getApiError const api_error = getApiError(errorMessage) diff --git a/src/hooks/forms/index.ts b/src/hooks/forms/index.ts index 70d7fd67..1388b190 100644 --- a/src/hooks/forms/index.ts +++ b/src/hooks/forms/index.ts @@ -1,4 +1,5 @@ export * from './useForgotPasswordForm' +export * from './useResetPasswordForm' export * from './useSignInForm' export * from './useSignUpForm' export * from './useTestForm' diff --git a/src/hooks/forms/useResetPasswordForm.tsx b/src/hooks/forms/useResetPasswordForm.tsx new file mode 100644 index 00000000..c2d9befc --- /dev/null +++ b/src/hooks/forms/useResetPasswordForm.tsx @@ -0,0 +1,57 @@ +import { useAuthControllerResetPassword } from '@baca/api/query/auth/auth' +import { AuthResetPasswordDto } from '@baca/api/types' +import { handleFormError, hapticImpact } from '@baca/utils' +import { router } from 'expo-router' +import { useForm } from 'react-hook-form' + +type FormValuesType = AuthResetPasswordDto & { confirmPassword: string } + +const defaultValues: FormValuesType = { + confirmPassword: '', + hash: '', + password: '', +} + +export const useResetPasswordForm = () => { + const { mutate: resetPasswordMutate, isLoading: isSubmitting } = useAuthControllerResetPassword() + + const { + control, + formState: { errors }, + handleSubmit, + reset, + setError: setFormError, + } = useForm({ + mode: 'onTouched', + defaultValues, + }) + + const onSubmit = async ({ confirmPassword, ...data }: FormValuesType) => { + resetPasswordMutate( + { data }, + { + onSuccess: () => { + router.replace(`/reset-password-complete`) + }, + onError: (e) => { + handleFormError( + e as unknown as keyof AuthResetPasswordDto, + ({ field, description }) => { + setFormError(field, { message: description }) + } + ) + + hapticImpact() + }, + } + ) + } + + return { + control, + errors, + isSubmitting, + reset, + submit: handleSubmit(onSubmit), + } +} diff --git a/src/hooks/forms/useSignInForm.ts b/src/hooks/forms/useSignInForm.ts index e0b5d0d8..bddc2f77 100644 --- a/src/hooks/forms/useSignInForm.ts +++ b/src/hooks/forms/useSignInForm.ts @@ -12,7 +12,7 @@ type SignInFormValues = AuthEmailLoginDto & { const defaultValues: SignInFormValues = { // TODO: Reset this values when building production app - email: 'm.baumruck+user@binarapps.com', + email: 'l.jeziorski+user@binarapps.com', password: 'Qwerty1!', confirm: false, } diff --git a/src/i18n/translations/en.json b/src/i18n/translations/en.json index f176eac0..b6710970 100644 --- a/src/i18n/translations/en.json +++ b/src/i18n/translations/en.json @@ -3,6 +3,7 @@ "add": "Add", "back": "Back", "cancel": "Cancel", + "continue": "Continue", "go_back": "Go back", "remove": "Remove", "save": "Save", @@ -30,12 +31,14 @@ }, "errors": {}, "labels": { + "confirm_password": "Confirm password", "email": "E-mail address", "first_name": "First name", "last_name": "Last name", "password": "Password" }, "placeholders": { + "confirm_password": "Confirm password", "create_password": "Create a password", "email": "Enter your email", "first_name": "Enter your first name", @@ -46,6 +49,7 @@ "validation": { "invalid_email_format": "Incorrect e-mail address format", "invalid_password_format": "Password must be at least 8 characters long, contain at least one uppercase letter, one lowercase letter, one number, and one special character", + "passwords_does_not_match": "Passwords does not match", "required": "This field is required" } }, @@ -186,6 +190,10 @@ "login_cta": "Log in", "sign_up": "Sign up" }, + "reset_password_complete": { + "password_reset": "Password reset", + "password_successfully_reset": "Your password has been successfully reset. Click below to log in magically." + }, "reset_password_link_sent_screen": { "check_email": "Check your email", "click_to_resend": "Click to resend", @@ -193,6 +201,11 @@ "open_email_app": "Open email app", "we_sent_link": "We sent a password reset link to" }, + "reset_password_screen": { + "reset_password": "Reset password", + "set_new_password": "Set new password", + "welcome_back": "Welcome back! Please enter your details." + }, "settings_screen": { "copy_push_token": "Copy push token", "current_theme": "Current theme: {{theme}}", diff --git a/src/i18n/translations/pl.json b/src/i18n/translations/pl.json index d5d4e0fd..26899a58 100644 --- a/src/i18n/translations/pl.json +++ b/src/i18n/translations/pl.json @@ -3,6 +3,7 @@ "add": "Dodaj", "back": "Cofnij", "cancel": "Anuluj", + "continue": "Kontynuuj", "go_back": "Cofnij", "remove": "Usuń", "save": "Zapisz", @@ -30,12 +31,14 @@ }, "errors": {}, "labels": { + "confirm_password": "Potwierdź hasło", "email": "Adres e-mail", "first_name": "Imię", "last_name": "Nazwisko", "password": "Hasło" }, "placeholders": { + "confirm_password": "Potwierdź hasło", "create_password": "Utwórz nowe hasło", "email": "Podaj adres e-mail", "first_name": "Podaj swoje imię", @@ -46,6 +49,7 @@ "validation": { "invalid_email_format": "Niepoprawny format adresu e-mail", "invalid_password_format": "Hasło musi zawierać minimum: 8 znaków, jedną wielką literę, jedną małą literę, jedną cyfrę i jeden znak specjalny", + "passwords_does_not_match": "Wprowadzone hasła nie są identyczne", "required": "Pole wymagane" } }, @@ -185,6 +189,10 @@ "go_to_blog": "Otwórz blog", "go_to_form": "Otwórz pełno ekranowy formularz full" }, + "reset_password_complete": { + "password_reset": "Reset hasła", + "password_successfully_reset": "Twoje hasło zostało pomyślnie zresetowane. Kliknij poniżej aby się zalogować." + }, "reset_password_link_sent_screen": { "check_email": "Sprawdź skrzynkę e-mail", "click_to_resend": "Wyślij ponownie", @@ -192,6 +200,11 @@ "open_email_app": "Otwórz aplikację e-mail", "we_sent_link": "Wysłaliśmy link resetujący hasło na" }, + "reset_password_screen": { + "reset_password": "Reset hasła", + "set_new_password": "Ustaw nowe hasło", + "welcome_back": "Witaj ponownie! Proszę wprowadź dane." + }, "settings_screen": { "current_theme": "Current theme: {{theme}}", "selected": " - wybrano", @@ -226,9 +239,9 @@ "interests": "Zaznacz przynajmniej 1 zainteresowanie", "music": "Zaznacz przynajmniej 1 rodzaj muzyki", "name": "Imie jest wymagane", - "phone_format": "Numer telefonu musi byc w formacie 000-000-000", + "phone_format": "Numer telefonu musi być w formacie 000-000-000", "phone": "Number telefonu jest wymagany", - "postalCode_format": "Kod pocztowy musi byc w formacie 00-000", + "postalCode_format": "Kod pocztowy musi być w formacie 00-000", "postalCode": "Kod pocztowy jest wymagany", "sex": "Płeć jest wymagana", "shoeSize": "Rozmiar buta jest wymagany", diff --git a/src/screens/ConfirmEmail.tsx b/src/screens/ConfirmEmail.tsx index d2b918fa..52827720 100644 --- a/src/screens/ConfirmEmail.tsx +++ b/src/screens/ConfirmEmail.tsx @@ -9,7 +9,7 @@ const navigateToSignIn = () => router.replace('/sign-in') export const ConfirmEmail = () => { const { t } = useTranslation() - const { code } = useLocalSearchParams<{ code: string }>() + const { hash } = useLocalSearchParams<{ hash: string }>() const { isError, @@ -30,8 +30,8 @@ export const ConfirmEmail = () => { } } } - confirmFn(code) - }, [code, confirmEmailMutation]) + confirmFn(hash) + }, [hash, confirmEmailMutation]) return (
diff --git a/src/screens/ResetPasswordCompleteScreen.tsx b/src/screens/ResetPasswordCompleteScreen.tsx new file mode 100644 index 00000000..ec7baecd --- /dev/null +++ b/src/screens/ResetPasswordCompleteScreen.tsx @@ -0,0 +1,31 @@ +import { CompanyLogo, FeaturedIcon, FormWrapper } from '@baca/components' +import { Button, Center, Display, Spacer, Text } from '@baca/design-system' +import { useTranslation } from '@baca/hooks' +import { router } from 'expo-router' + +const navigateToLogin = () => { + router.replace('/sign-in') +} + +export const ResetPasswordCompleteScreen = () => { + const { t } = useTranslation() + + return ( + +
+ + + + + + {t('reset_password_complete.password_reset')} + + + {t('reset_password_complete.password_successfully_reset')} + + +
+
+ ) +} diff --git a/src/screens/ResetPasswordScreen.tsx b/src/screens/ResetPasswordScreen.tsx index 88155262..978657c2 100644 --- a/src/screens/ResetPasswordScreen.tsx +++ b/src/screens/ResetPasswordScreen.tsx @@ -1,3 +1,96 @@ +import { CompanyLogo, ControlledField, FeaturedIcon, FormWrapper } from '@baca/components' +import { REGEX } from '@baca/constants' +import { Button, Center, Display, Spacer, Text } from '@baca/design-system' +import { useEffect, useResetPasswordForm, useTranslation } from '@baca/hooks' +import { router, useLocalSearchParams } from 'expo-router' + +const navigateToLogin = () => { + router.replace('/sign-in') +} + export const ResetPasswordScreen = () => { - return <> + const { t } = useTranslation() + const { hash } = useLocalSearchParams<{ hash: string }>() + + const { control, errors, isSubmitting, reset, submit } = useResetPasswordForm() + + useEffect(() => { + if (hash) { + reset({ hash }) + } + }, [hash, reset]) + + return ( + +
+ + + + + + {t('reset_password_screen.set_new_password')} + + + {t('reset_password_screen.welcome_back')} + + + + + + { + if (formValues.password !== inputValue) { + return t('form.validation.passwords_does_not_match') + } + }, + }, + }} + testID="passwordInput" + type="password" + /> + + + + +
+
+ ) } diff --git a/src/screens/index.ts b/src/screens/index.ts index e6bf5296..2e5ba259 100644 --- a/src/screens/index.ts +++ b/src/screens/index.ts @@ -10,6 +10,7 @@ export * from './ForgotPasswordScreen' export * from './HomeScreen' export * from './NotFoundScreen' export * from './ProfileScreen' +export * from './ResetPasswordCompleteScreen' export * from './ResetPasswordLinkSentScreen' export * from './ResetPasswordScreen' export * from './SettingsScreen' From 139419cf3bada72c38116fd1fb254c0311398803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Tue, 26 Mar 2024 14:15:59 +0100 Subject: [PATCH 15/20] update button snapshot --- .../components/Button/__snapshots__/Button.test.tsx.snap | 1 + 1 file changed, 1 insertion(+) diff --git a/src/design-system/components/Button/__snapshots__/Button.test.tsx.snap b/src/design-system/components/Button/__snapshots__/Button.test.tsx.snap index e4380482..541ac05a 100644 --- a/src/design-system/components/Button/__snapshots__/Button.test.tsx.snap +++ b/src/design-system/components/Button/__snapshots__/Button.test.tsx.snap @@ -63,6 +63,7 @@ exports[`Button renders correctly 1`] = ` > Date: Tue, 26 Mar 2024 14:45:11 +0100 Subject: [PATCH 16/20] move auth screens to auth folder inside screen folder --- src/screens/{ => auth}/ConfirmEmail.tsx | 0 src/screens/{ => auth}/ForgotPasswordScreen.tsx | 0 src/screens/{ => auth}/ResetPasswordCompleteScreen.tsx | 0 src/screens/{ => auth}/ResetPasswordLinkSentScreen.tsx | 0 src/screens/{ => auth}/ResetPasswordScreen.tsx | 0 src/screens/{ => auth}/SignInScreen.tsx | 2 +- src/screens/{ => auth}/SignUpScreen.tsx | 0 src/screens/auth/index.ts | 7 +++++++ src/screens/index.ts | 9 ++------- 9 files changed, 10 insertions(+), 8 deletions(-) rename src/screens/{ => auth}/ConfirmEmail.tsx (100%) rename src/screens/{ => auth}/ForgotPasswordScreen.tsx (100%) rename src/screens/{ => auth}/ResetPasswordCompleteScreen.tsx (100%) rename src/screens/{ => auth}/ResetPasswordLinkSentScreen.tsx (100%) rename src/screens/{ => auth}/ResetPasswordScreen.tsx (100%) rename src/screens/{ => auth}/SignInScreen.tsx (99%) rename src/screens/{ => auth}/SignUpScreen.tsx (100%) create mode 100644 src/screens/auth/index.ts diff --git a/src/screens/ConfirmEmail.tsx b/src/screens/auth/ConfirmEmail.tsx similarity index 100% rename from src/screens/ConfirmEmail.tsx rename to src/screens/auth/ConfirmEmail.tsx diff --git a/src/screens/ForgotPasswordScreen.tsx b/src/screens/auth/ForgotPasswordScreen.tsx similarity index 100% rename from src/screens/ForgotPasswordScreen.tsx rename to src/screens/auth/ForgotPasswordScreen.tsx diff --git a/src/screens/ResetPasswordCompleteScreen.tsx b/src/screens/auth/ResetPasswordCompleteScreen.tsx similarity index 100% rename from src/screens/ResetPasswordCompleteScreen.tsx rename to src/screens/auth/ResetPasswordCompleteScreen.tsx diff --git a/src/screens/ResetPasswordLinkSentScreen.tsx b/src/screens/auth/ResetPasswordLinkSentScreen.tsx similarity index 100% rename from src/screens/ResetPasswordLinkSentScreen.tsx rename to src/screens/auth/ResetPasswordLinkSentScreen.tsx diff --git a/src/screens/ResetPasswordScreen.tsx b/src/screens/auth/ResetPasswordScreen.tsx similarity index 100% rename from src/screens/ResetPasswordScreen.tsx rename to src/screens/auth/ResetPasswordScreen.tsx diff --git a/src/screens/SignInScreen.tsx b/src/screens/auth/SignInScreen.tsx similarity index 99% rename from src/screens/SignInScreen.tsx rename to src/screens/auth/SignInScreen.tsx index 40cb165e..a820a546 100644 --- a/src/screens/SignInScreen.tsx +++ b/src/screens/auth/SignInScreen.tsx @@ -48,7 +48,7 @@ export const SignInScreen = (): JSX.Element => {
- + Date: Tue, 26 Mar 2024 14:52:40 +0100 Subject: [PATCH 17/20] change api error type --- src/api/axios/custom-instance.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/api/axios/custom-instance.ts b/src/api/axios/custom-instance.ts index ba994ad1..e289f077 100644 --- a/src/api/axios/custom-instance.ts +++ b/src/api/axios/custom-instance.ts @@ -14,18 +14,16 @@ type ApiErrorType = { statusCode: number errors: never - status: never } type FormErrorType = { errors?: { [key: string]: string[] } - status: number + statusCode: number error: never message: never - statusCode: never } export type ApiError = ApiErrorType | FormErrorType @@ -50,7 +48,6 @@ AXIOS_INSTANCE.interceptors.response.use( return response }, async (error: AxiosError) => { - console.log('ERRRRRR DUPA ERRR', error) // handle FormErrorType const formErrors = error?.response?.data?.errors From aadd51c72ca4aba4e3407270f5bf651df28e6b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Wed, 27 Mar 2024 14:14:58 +0100 Subject: [PATCH 18/20] adjust sign in screen and sign up screen --- src/components/KeyboardAwareScrollView.tsx | 70 +++++++------- src/components/LanguagePicker.tsx | 31 ++++--- src/components/Version.tsx | 6 +- src/components/organisms/Menu/index.tsx | 19 +++- src/components/wrappers/FormWrapper.tsx | 37 ++++++-- src/constants/environments.ts | 3 + .../components/BoxWithShadow.tsx | 2 +- src/design-system/config/theme.ts | 4 +- .../utils/generateStyledSystem.ts | 1 - src/i18n/translations/en.json | 9 +- src/i18n/translations/pl.json | 12 ++- src/screens/auth/SignInScreen.tsx | 80 ++++++++-------- src/screens/auth/SignUpScreen.tsx | 92 +++++++++++-------- src/utils/removeFalsyProperties.ts | 6 +- 14 files changed, 219 insertions(+), 153 deletions(-) diff --git a/src/components/KeyboardAwareScrollView.tsx b/src/components/KeyboardAwareScrollView.tsx index e1e0eb9d..c137f118 100644 --- a/src/components/KeyboardAwareScrollView.tsx +++ b/src/components/KeyboardAwareScrollView.tsx @@ -3,45 +3,49 @@ import { forwardRef, useMemo } from 'react' import { Platform, StyleProp, ViewStyle } from 'react-native' import { KeyboardAwareScrollView as KeyboardAwareScroll, - KeyboardAwareScrollViewProps, + KeyboardAwareScrollViewProps as KeyboardAwareScrollProps, } from 'react-native-keyboard-aware-scroll-view' const keyboardDismissMode = Platform.OS === 'android' ? 'on-drag' : 'interactive' -type Props = Omit & { +export type KeyboardAwareScrollViewProps = Omit< + KeyboardAwareScrollProps, + 'contentContainerStyle' +> & { contentContainerStyle?: Omit, 'false'> } -export const KeyboardAwareScrollView = forwardRef( - ({ children, contentContainerStyle = {}, ...rest }, ref) => { - const { navigationTheme } = useNavigationTheme() +export const KeyboardAwareScrollView = forwardRef< + KeyboardAwareScroll, + KeyboardAwareScrollViewProps +>(({ children, contentContainerStyle = {}, ...rest }, ref) => { + const { navigationTheme } = useNavigationTheme() - const scrollViewContentContainerStyle = useMemo( - () => [ - { - backgroundColor: navigationTheme.colors.background, - flexGrow: 1, - }, - contentContainerStyle, - ], - [contentContainerStyle, navigationTheme.colors.background] - ) + const scrollViewContentContainerStyle = useMemo( + () => [ + { + backgroundColor: navigationTheme.colors.background, + flexGrow: 1, + }, + contentContainerStyle, + ], + [contentContainerStyle, navigationTheme.colors.background] + ) - return ( - - {children} - - ) - } -) + return ( + + {children} + + ) +}) diff --git a/src/components/LanguagePicker.tsx b/src/components/LanguagePicker.tsx index 984d0f17..cf98c6e9 100644 --- a/src/components/LanguagePicker.tsx +++ b/src/components/LanguagePicker.tsx @@ -1,6 +1,7 @@ +import { theme } from '@baca/design-system' import { Icon, Row, Text } from '@baca/design-system/components' import { Touchable, TouchableProps } from '@baca/design-system/components/Touchables/Touchable' -import { useCallback, useTranslation, useTheme } from '@baca/hooks' +import { useCallback, useTranslation } from '@baca/hooks' import { StyleSheet } from 'react-native' import Animated, { useAnimatedStyle, @@ -9,12 +10,18 @@ import Animated, { withTiming, } from 'react-native-reanimated' -import { Menu } from './organisms/Menu' +import { Menu, MenuProps } from './organisms/Menu' import languages from '../../assets/languages.json' -export const LanguagePicker: React.FC = () => { - const { size } = useTheme() +type LanguagePickerProps = { + isWeb?: boolean + pickerPlacement?: MenuProps['placement'] +} +export const LanguagePicker: React.FC = ({ + isWeb = false, + pickerPlacement, +}) => { const { i18n } = useTranslation() const language = i18n?.language?.slice?.(0, 2).toUpperCase() as keyof typeof languages const isOpen = useSharedValue(false) @@ -24,10 +31,6 @@ export const LanguagePicker: React.FC = () => { transform: [{ rotateZ: `${rotateZ.value}deg` }], })) - const styles = StyleSheet.create({ - icon: { height: size['8'], justifyContent: 'center' }, - }) - const iconColor = 'text.brand.primary' const renderTrigger = useCallback( @@ -43,7 +46,9 @@ export const LanguagePicker: React.FC = () => { return ( - {languages?.[language]?.emoji} + + {languages?.[language]?.[isWeb ? 'language' : 'emoji']} + @@ -51,7 +56,7 @@ export const LanguagePicker: React.FC = () => { ) }, - [animatedIconStyle, isOpen, language, styles.icon, iconColor] + [isOpen, language, isWeb, animatedIconStyle] ) const handleItemPress = useCallback( @@ -62,7 +67,7 @@ export const LanguagePicker: React.FC = () => { ) return ( - + {Object.entries(languages).map(([key, languageData]) => ( { ) } + +const styles = StyleSheet.create({ + icon: { height: theme.dark.size['8'], justifyContent: 'center' }, +}) diff --git a/src/components/Version.tsx b/src/components/Version.tsx index 7330a418..38972d5a 100644 --- a/src/components/Version.tsx +++ b/src/components/Version.tsx @@ -11,7 +11,7 @@ const appVersion = Application?.nativeApplicationVersion ?? Constants?.expoConfi export const Version = ({ onPress }: { onPress: () => void }) => { const version = `${appName}: ${appVersion} (${Application?.nativeBuildVersion ?? '-'}) ${ - Updates.updateId ? 'update: ' + Updates.updateId : '' + Updates.updateId ? '\nupdate: ' + Updates.updateId : '' }` const handleShortPress = useCallback(async () => { @@ -20,7 +20,9 @@ export const Version = ({ onPress }: { onPress: () => void }) => { return ( - {version} + + {version} + ) diff --git a/src/components/organisms/Menu/index.tsx b/src/components/organisms/Menu/index.tsx index 511323b9..0ea4f9df 100644 --- a/src/components/organisms/Menu/index.tsx +++ b/src/components/organisms/Menu/index.tsx @@ -1,8 +1,9 @@ -import { Box, TouchableProps, ScrollView, Pressable } from '@baca/design-system/components' +import { useColorScheme } from '@baca/contexts' +import { Box, TouchableProps, ScrollView, Pressable } from '@baca/design-system' import { useRef, useState, useMemo, useTheme, useCallback } from '@baca/hooks' import { Portal } from '@gorhom/portal' import React, { NamedExoticComponent, PropsWithChildren, memo } from 'react' -import { View, Modal } from 'react-native' +import { View, Modal, Dimensions } from 'react-native' import { MenuItem } from '../../molecules/MenuItem' @@ -15,7 +16,7 @@ type TriggerPosition = { type TriggerState = { isOpen: boolean } -type MenuProps = { +export type MenuProps = { trigger: (props: TouchableProps, state: TriggerState) => JSX.Element onOpen?: () => void onClose?: () => void @@ -47,6 +48,7 @@ const Menu = memo( placement = 'bottomLeft', ...props }) => { + const { colorScheme } = useColorScheme() const { shadows } = useTheme() const _modalRef = useRef(null) const _triggerContainer = useRef(null) @@ -120,12 +122,19 @@ const Menu = memo( visible={isOpen} onRequestClose={handleClose} > - + {triggerPosition && ( = ({ children }) => { - useScreenOptions({ headerShown: false }) +type FormWrapperProps = { + edges?: SafeAreaViewProps['edges'] + headerShown?: boolean + keyboardAwareProps?: KeyboardAwareScrollViewProps +} + +export const FormWrapper: FC> = ({ + children, + edges, + headerShown = false, + keyboardAwareProps = {}, +}) => { + useScreenOptions({ headerShown }) return ( - - {children} - + + + {children} + + ) } const styles = StyleSheet.create({ contentContainerStyle: { alignSelf: 'center', - flex: 1, flexGrow: 1, - maxWidth: 360, + maxWidth: 360 + 2 * 32, // contentWidth + 2 * paddingHorizontal + paddingHorizontal: 32, width: '100%', }, + safeAreaContainer: { flex: 1 }, }) diff --git a/src/constants/environments.ts b/src/constants/environments.ts index 9e44fbfc..12d2ad22 100644 --- a/src/constants/environments.ts +++ b/src/constants/environments.ts @@ -1,5 +1,8 @@ import Constants, { AppOwnership } from 'expo-constants' +import { Platform } from 'react-native' export const isExpoGo = Constants.appOwnership === AppOwnership.Expo export const isDevelopment = __DEV__ || process.env.NODE_ENV === 'development' export const isProduction = !isDevelopment || process.env.NODE_ENV === 'production' + +export const isWeb = Platform.OS === 'web' diff --git a/src/design-system/components/BoxWithShadow.tsx b/src/design-system/components/BoxWithShadow.tsx index 2cfe4f9f..2da06cc2 100644 --- a/src/design-system/components/BoxWithShadow.tsx +++ b/src/design-system/components/BoxWithShadow.tsx @@ -18,7 +18,7 @@ export const BoxWithShadow: FC> = ({ ...rest }) => { const shadowProps = useMemo( - () => (isInvalid ? errorShadow : isFocused ? focusShadow : {}), + () => (isInvalid && isFocused ? errorShadow : isFocused ? focusShadow : {}), [isInvalid, isFocused] ) diff --git a/src/design-system/config/theme.ts b/src/design-system/config/theme.ts index ba420444..37bf664c 100644 --- a/src/design-system/config/theme.ts +++ b/src/design-system/config/theme.ts @@ -320,14 +320,14 @@ export const shadows = { shadowOffset: { width: 0, height: 0 }, shadowColor: themeColors.primitives.Error[500], shadowOpacity: 1, - shadowRadius: 8, + shadowRadius: 3, elevation: 3, }, focusShadow: { shadowOffset: { width: 0, height: 0 }, shadowColor: themeColors.primitives.Brand[500], shadowOpacity: 1, - shadowRadius: 8, + shadowRadius: 3, elevation: 3, }, grayShadow: { diff --git a/src/design-system/utils/generateStyledSystem.ts b/src/design-system/utils/generateStyledSystem.ts index 4f2308d2..9ff6ce54 100644 --- a/src/design-system/utils/generateStyledSystem.ts +++ b/src/design-system/utils/generateStyledSystem.ts @@ -173,7 +173,6 @@ const generateLayoutsStyle = ({ }: LayoutsProps): StyleProp => { return { position, - bottom, left, right, top, diff --git a/src/i18n/translations/en.json b/src/i18n/translations/en.json index b6710970..02f093b7 100644 --- a/src/i18n/translations/en.json +++ b/src/i18n/translations/en.json @@ -216,10 +216,15 @@ "do_not_have_an_account": "Don't have an account?", "forgot_password": "Forgot password", "sign_in": "Sign in", - "sign_up": "Sign up" + "sign_up": "Sign up", + "welcome_back": "Welcome back", + "welcome_back_enter_details": "Welcome back! Please enter your details" }, "sign_up_screen": { - "sign_up": "Sign up" + "get_started": "Get started", + "log_in": "Log in", + "sign_up": "Sign up", + "start_free_trail": "Start your 30-day free trial." }, "test_form": { "additional_comment": "Additional comment", diff --git a/src/i18n/translations/pl.json b/src/i18n/translations/pl.json index 26899a58..1137b946 100644 --- a/src/i18n/translations/pl.json +++ b/src/i18n/translations/pl.json @@ -213,12 +213,16 @@ "sign_in_screen": { "do_not_have_an_account": "Nie masz konta?", "forgot_password": "Nie pamiętam hasła", - "sign_in": "Zaloguj", - "sign_up": "Zarejestruj" + "sign_in": "Zaloguj się", + "sign_up": "Zarejestruj się", + "welcome_back": "Welcome back", + "welcome_back_enter_details": "Welcome back! Please enter your details" }, "sign_up_screen": { - "created_new_account": "Nowe konto zostało stworzone. Email z linkiem weryfikacyjnym został wysłany na {{userEmail}}.", - "sign_up": "Zarejestruj" + "get_started": "Rozpoczynamy", + "log_in": "Zaloguj się", + "sign_up": "Zarejestruj się", + "start_free_trail": "Rozpocznij darmowy 30 dniowy okres próbny." }, "test_form": { "additional_comment": "Dodatkowy komentarz", diff --git a/src/screens/auth/SignInScreen.tsx b/src/screens/auth/SignInScreen.tsx index a820a546..87d7f898 100644 --- a/src/screens/auth/SignInScreen.tsx +++ b/src/screens/auth/SignInScreen.tsx @@ -1,37 +1,21 @@ import { CompanyLogo, ControlledField, - KeyboardAwareScrollView, + FormWrapper, LanguagePicker, Version, } from '@baca/components' -import { REGEX } from '@baca/constants' -import { Box, Button, Center, Row, Spacer, Text } from '@baca/design-system' -import { - useCallback, - useSignInForm, - useTranslation, - useEffect, - useScreenOptions, -} from '@baca/hooks' +import { REGEX, isWeb } from '@baca/constants' +import { Box, Button, Center, Display, Row, Spacer, Text } from '@baca/design-system' +import { useCallback, useSignInForm, useTranslation } from '@baca/hooks' import { useRouter } from 'expo-router' export const SignInScreen = (): JSX.Element => { const { push } = useRouter() const { t } = useTranslation() - useScreenOptions({ - title: t('navigation.screen_titles.sign_in'), - }) - const { control, errors, submit, getValues, isSubmitting, setFocus } = useSignInForm() - useEffect(() => { - setTimeout(() => { - setFocus('email') - }, 500) - }, [setFocus]) - const navigateToSignUp = useCallback(() => push('/sign-up'), [push]) const navigateToAppInfo = useCallback(() => push('/application-info'), [push]) const navigateToForgotPassword = useCallback( @@ -41,14 +25,30 @@ export const SignInScreen = (): JSX.Element => { const focusPasswordInput = useCallback(() => setFocus('password'), [setFocus]) return ( - - - - -
- + + {isWeb ? ( + + + + + + + ) : null} +
+ {!isWeb ? ( + + + + ) : null} + + {t('sign_in_screen.welcome_back')} + + + {t('sign_in_screen.welcome_back_enter_details')} + + { my={8} onPress={submit} testID="signInButton" + w="full" > {t('sign_in_screen.sign_in')} - - {t('sign_in_screen.do_not_have_an_account')} - - - {t('sign_in_screen.sign_up')} - - - - {/* TODO: Remove this after implementing signing in with backend */} - Correct credentials - - Email: test@example.com{'\n'}Password: 123456 - - + + + {t('sign_in_screen.do_not_have_an_account')} + + + {t('sign_in_screen.sign_up')} + +
- + + + +
) } diff --git a/src/screens/auth/SignUpScreen.tsx b/src/screens/auth/SignUpScreen.tsx index 6b10b13a..412d27c7 100644 --- a/src/screens/auth/SignUpScreen.tsx +++ b/src/screens/auth/SignUpScreen.tsx @@ -1,33 +1,35 @@ -import { CompanyLogo, ControlledField, KeyboardAwareScrollView } from '@baca/components' -import { Button, Center, Spacer } from '@baca/design-system' -import { useScreenOptions, useSignUpForm, useTranslation } from '@baca/hooks' -import { useCallback, useEffect } from 'react' +import { CompanyLogo, ControlledField, FormWrapper } from '@baca/components' +import { Box, Button, Center, Display, Row, Spacer, Text } from '@baca/design-system' +import { useSignUpForm, useTranslation } from '@baca/hooks' +import { router } from 'expo-router' +import { useCallback } from 'react' +import { Keyboard } from 'react-native' + +const navigateToLogIn = () => { + router.navigate('/sign-in') +} export const SignUpScreen = () => { const { t } = useTranslation() - useScreenOptions({ - title: t('navigation.screen_titles.sign_up'), - }) - const { control, errors, register, isSubmitting, setFocus } = useSignUpForm() - useEffect(() => { - setTimeout(() => { - setFocus('firstName') - }, 500) - }, [setFocus]) - const focusLastNameInput = useCallback(() => setFocus('lastName'), [setFocus]) const focusEmailInput = useCallback(() => setFocus('email'), [setFocus]) const focusPasswordInput = useCallback(() => setFocus('password'), [setFocus]) return ( - -
+ +
+ {t('sign_up_screen.sign_up')} + + + {t('sign_up_screen.start_free_trail')} + + { enterKeyHint="next" isRequired label={t('form.labels.password')} - mb={16} name="password" - onSubmitEditing={register} + onSubmitEditing={Keyboard.dismiss} placeholder={t('form.placeholders.create_password')} rules={{ required: t('form.validation.required'), }} type="password" /> - - - + + + + + - + + + + {t('sign_in_screen.do_not_have_an_account')} + + + {t('sign_up_screen.log_in')} + +
- +
) } diff --git a/src/utils/removeFalsyProperties.ts b/src/utils/removeFalsyProperties.ts index 94f51195..b1e78c69 100644 --- a/src/utils/removeFalsyProperties.ts +++ b/src/utils/removeFalsyProperties.ts @@ -1,10 +1,10 @@ export const removeFalsyProperties = (obj: O) => { - const filterdObject = Object.entries(obj).reduce>((acc, curr) => { - if (curr[1]) { + const filteredObject = Object.entries(obj).reduce>((acc, curr) => { + if (curr[1] !== undefined) { acc[curr[0]] = curr[1] } return acc }, {}) - return filterdObject as O + return filteredObject } From 4641444a4fde6e0ee91522858e166158998a364e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Wed, 27 Mar 2024 14:25:43 +0100 Subject: [PATCH 19/20] add CR fixes --- src/navigation/tabNavigator/components/AppHeader.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/navigation/tabNavigator/components/AppHeader.tsx b/src/navigation/tabNavigator/components/AppHeader.tsx index 11a64a27..eb030c2f 100644 --- a/src/navigation/tabNavigator/components/AppHeader.tsx +++ b/src/navigation/tabNavigator/components/AppHeader.tsx @@ -1,5 +1,6 @@ import { CompanyLogo } from '@baca/components' -import { Platform, StyleSheet, View } from 'react-native' +import { isWeb } from '@baca/constants' +import { StyleSheet, View } from 'react-native' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { TabColorsStrings } from '../navigation-config' @@ -7,7 +8,10 @@ import { TabColorsStrings } from '../navigation-config' export function AppHeader() { const { top } = useSafeAreaInsets() + if (!isWeb) return null + const height = 60 + top + return ( @@ -20,11 +24,11 @@ const jsStyles = StyleSheet.create({ alignItems: 'center', borderBottomColor: TabColorsStrings.lightGray, borderBottomWidth: 1, + display: 'flex', flexDirection: 'row', justifyContent: 'center', paddingHorizontal: 16, width: '100%', zIndex: 10, - ...Platform.select({ default: { display: 'none' }, web: { display: 'flex' } }), }, }) From 297ebac534207951fb27d433b9a7e9aa7741b09c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Baumruck?= Date: Wed, 27 Mar 2024 14:31:11 +0100 Subject: [PATCH 20/20] add fixes according to pass tests --- src/design-system/components/Button/Button.tsx | 1 - src/utils/removeFalsyProperties.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/design-system/components/Button/Button.tsx b/src/design-system/components/Button/Button.tsx index 1ac12982..c7bb0518 100644 --- a/src/design-system/components/Button/Button.tsx +++ b/src/design-system/components/Button/Button.tsx @@ -60,7 +60,6 @@ const styles = StyleSheet.create({ baseText: { fontStyle: 'normal', fontWeight: '400', - letterSpacing: 0, lineHeight: 21, }, }) diff --git a/src/utils/removeFalsyProperties.ts b/src/utils/removeFalsyProperties.ts index b1e78c69..e1031436 100644 --- a/src/utils/removeFalsyProperties.ts +++ b/src/utils/removeFalsyProperties.ts @@ -1,6 +1,6 @@ export const removeFalsyProperties = (obj: O) => { const filteredObject = Object.entries(obj).reduce>((acc, curr) => { - if (curr[1] !== undefined) { + if (curr[1] || curr[1] === 0) { acc[curr[0]] = curr[1] } return acc