diff --git a/packages/ui/src/components/AppContent/index.module.scss b/packages/ui/src/components/AppContent/index.module.scss index 749944aa2..1edf8eeef 100644 --- a/packages/ui/src/components/AppContent/index.module.scss +++ b/packages/ui/src/components/AppContent/index.module.scss @@ -19,6 +19,8 @@ body { background-color: var(--color-base); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: auto; } .container { diff --git a/packages/ui/src/components/Button/index.module.scss b/packages/ui/src/components/Button/index.module.scss index e1cc5ae53..ad8e3bd06 100644 --- a/packages/ui/src/components/Button/index.module.scss +++ b/packages/ui/src/components/Button/index.module.scss @@ -3,7 +3,8 @@ .button { @include _.flex-row; justify-content: center; - padding: _.unit(3); + height: 44px; + padding: 0 _.unit(3); border-radius: var(--radius); font: var(--font-body-bold); cursor: pointer; @@ -18,7 +19,7 @@ } .small { - min-width: 44px; + min-width: 50px; } .primary { diff --git a/packages/ui/src/components/Input/PhoneInput.tsx b/packages/ui/src/components/Input/PhoneInput.tsx index 2e21c8a93..8ca480437 100644 --- a/packages/ui/src/components/Input/PhoneInput.tsx +++ b/packages/ui/src/components/Input/PhoneInput.tsx @@ -74,6 +74,7 @@ const PhoneInput = ({ {countrySelector} { return (
{ @@ -92,7 +92,6 @@ const CreateAccount = ({ className }: Props) => { className={styles.inputField} name="password" type="password" - autoComplete="current-password" placeholder={t('input.password')} {...fieldRegister('password', passwordValidation)} onClear={() => { @@ -103,7 +102,6 @@ const CreateAccount = ({ className }: Props) => { className={styles.inputField} name="confirm_password" type="password" - autoComplete="current-password" placeholder={t('input.confirm_password')} {...fieldRegister('confirmPassword', (confirmPassword) => confirmPasswordValidation(fieldValue.password, confirmPassword) diff --git a/packages/ui/src/containers/PasscodeValidation/index.tsx b/packages/ui/src/containers/PasscodeValidation/index.tsx index 600ca933e..f8330b797 100644 --- a/packages/ui/src/containers/PasscodeValidation/index.tsx +++ b/packages/ui/src/containers/PasscodeValidation/index.tsx @@ -64,6 +64,8 @@ const PasscodeValidation = ({ type, method, className, target }: Props) => { const { run: sendPassCode } = useApi(getSendPasscodeApi(type, method)); const resendPasscodeHandler = useCallback(async () => { + setError(undefined); + const result = await sendPassCode(target); if (result) { diff --git a/packages/ui/src/containers/Passwordless/EmailPasswordless.tsx b/packages/ui/src/containers/Passwordless/EmailPasswordless.tsx index 3a6f66f95..667906d5d 100644 --- a/packages/ui/src/containers/Passwordless/EmailPasswordless.tsx +++ b/packages/ui/src/containers/Passwordless/EmailPasswordless.tsx @@ -1,5 +1,5 @@ import classNames from 'classnames'; -import React, { useCallback, useEffect, useState, useMemo } from 'react'; +import React, { useCallback, useEffect, useState, useMemo, useContext } from 'react'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; @@ -9,8 +9,10 @@ import Input from '@/components/Input'; import TermsOfUse from '@/containers/TermsOfUse'; import useApi, { ErrorHandlers } from '@/hooks/use-api'; import useForm from '@/hooks/use-form'; +import { PageContext } from '@/hooks/use-page-context'; import useTerms from '@/hooks/use-terms'; -import { UserFlow } from '@/types'; +import { UserFlow, SearchParameters } from '@/types'; +import { getSearchParameters } from '@/utils'; import { emailValidation } from '@/utils/field-validations'; import PasswordlessConfirmModal from './PasswordlessConfirmModal'; @@ -28,6 +30,7 @@ type FieldState = { const defaultState: FieldState = { email: '' }; const EmailPasswordless = ({ type, className }: Props) => { + const { setToast } = useContext(PageContext); const [showPasswordlessConfirmModal, setShowPasswordlessConfirmModal] = useState(false); const { t } = useTranslation(undefined, { keyPrefix: 'main_flow' }); const navigate = useNavigate(); @@ -37,7 +40,16 @@ const EmailPasswordless = ({ type, className }: Props) => { const errorHandlers: ErrorHandlers = useMemo( () => ({ - 'user.email_not_exists': () => { + 'user.email_not_exists': (error) => { + const socialToBind = getSearchParameters(location.search, SearchParameters.bindWithSocial); + + // Directly display the error if user is trying to bind with social + if (socialToBind) { + setToast(error.message); + + return; + } + setShowPasswordlessConfirmModal(true); }, 'user.email_exists_register': () => { @@ -47,7 +59,7 @@ const EmailPasswordless = ({ type, className }: Props) => { setFieldErrors({ email: 'invalid_email' }); }, }), - [setFieldErrors] + [setFieldErrors, setToast] ); const sendPasscode = getSendPasscodeApi(type, 'email'); @@ -85,6 +97,7 @@ const EmailPasswordless = ({ type, className }: Props) => { <> { + const { setToast } = useContext(PageContext); const [showPasswordlessConfirmModal, setShowPasswordlessConfirmModal] = useState(false); const { t } = useTranslation(undefined, { keyPrefix: 'main_flow' }); const { phoneNumber, setPhoneNumber, isValidPhoneNumber } = usePhoneNumber(); @@ -38,7 +41,16 @@ const PhonePasswordless = ({ type, className }: Props) => { const errorHandlers: ErrorHandlers = useMemo( () => ({ - 'user.phone_not_exists': () => { + 'user.phone_not_exists': (error) => { + const socialToBind = getSearchParameters(location.search, SearchParameters.bindWithSocial); + + // Directly display the error if user is trying to bind with social + if (socialToBind) { + setToast(error.message); + + return; + } + setShowPasswordlessConfirmModal(true); }, 'user.phone_exists_register': () => { @@ -48,7 +60,7 @@ const PhonePasswordless = ({ type, className }: Props) => { setFieldErrors({ phone: 'invalid_phone' }); }, }), - [setFieldErrors] + [setFieldErrors, setToast] ); const sendPasscode = getSendPasscodeApi(type, 'sms'); diff --git a/packages/ui/src/containers/UsernameSignin/index.tsx b/packages/ui/src/containers/UsernameSignin/index.tsx index 536e09b96..847d8bd57 100644 --- a/packages/ui/src/containers/UsernameSignin/index.tsx +++ b/packages/ui/src/containers/UsernameSignin/index.tsx @@ -85,6 +85,7 @@ const UsernameSignin = ({ className }: Props) => { return (