diff --git a/packages/account-v2/src/components/FormFields/FormDropDownField.tsx b/packages/account-v2/src/components/FormFields/FormDropDownField.tsx index 0436d9c4a559..c1b5162c8d24 100644 --- a/packages/account-v2/src/components/FormFields/FormDropDownField.tsx +++ b/packages/account-v2/src/components/FormFields/FormDropDownField.tsx @@ -2,12 +2,13 @@ import React, { ComponentProps } from 'react'; import { Field, FieldProps } from 'formik'; import * as Yup from 'yup'; import { useBreakpoint } from '@deriv/quill-design'; +import { LabelPairedChevronDownMdRegularIcon } from '@deriv/quill-icons'; +import { Dropdown } from '@deriv-com/ui'; import { validateField } from '../../utils/validation'; -import { WalletDropdown as DropDown } from '../base/WalletDropdown'; type FormDropDownFieldProps = Omit< - ComponentProps, - 'errorMessage' | 'isRequired' | 'onSelect' | 'variant' + ComponentProps, + 'dropdownIcon' | 'errorMessage' | 'isRequired' | 'onSelect' | 'variant' > & { name: string; validationSchema?: Yup.AnySchema; @@ -26,12 +27,13 @@ const FormDropDownField = ({ name, validationSchema, ...rest }: FormDropDownFiel return ( {({ field, form, meta: { error, touched } }: FieldProps) => ( - } errorMessage={error} isRequired={touched && !!error} - onSelect={(value: string) => form.setFieldValue(name, value)} + onSelect={value => form.setFieldValue(name, value)} variant={isMobile ? 'prompt' : 'comboBox'} /> )} diff --git a/packages/account-v2/src/components/FormFields/FormInputField.tsx b/packages/account-v2/src/components/FormFields/FormInputField.tsx index e8c3a373f2f1..2f0deac867a1 100644 --- a/packages/account-v2/src/components/FormFields/FormInputField.tsx +++ b/packages/account-v2/src/components/FormFields/FormInputField.tsx @@ -1,10 +1,10 @@ import React, { ComponentProps } from 'react'; import { Field, FieldProps } from 'formik'; import * as Yup from 'yup'; +import { Input } from '@deriv-com/ui'; import { validateField } from '../../utils/validation'; -import { WalletTextField as TextField } from '../base/WalletTextField'; -type FormInputFieldProps = Omit, 'errorMessage' | 'isInvalid' | 'showMessage'> & { +type FormInputFieldProps = Omit, 'errorMessage' | 'isInvalid' | 'showMessage'> & { name: string; validationSchema?: Yup.AnySchema; }; @@ -20,14 +20,12 @@ type FormInputFieldProps = Omit, 'errorMessage' const FormInputField = ({ name, validationSchema, ...rest }: FormInputFieldProps) => ( {({ field, meta: { error, touched } }: FieldProps) => ( - )} diff --git a/packages/account-v2/src/modules/AddressFields/AddressFields.tsx b/packages/account-v2/src/modules/AddressFields/AddressFields.tsx index ea755ac2aca2..50a76e5a0593 100644 --- a/packages/account-v2/src/modules/AddressFields/AddressFields.tsx +++ b/packages/account-v2/src/modules/AddressFields/AddressFields.tsx @@ -14,7 +14,7 @@ export const AddressFields = () => { const isSvg = landingCompanyName === LANDING_COMPANY.SVG || !!upgradableLandingCompanies?.includes(LANDING_COMPANY.SVG); - const { data: statesList, isFetched: statesListFetched } = useStatesList(settings.country_code || '', { + const { data: statesList, isFetched: statesListFetched } = useStatesList(settings.country_code ?? '', { enabled: !!settings.country_code, }); @@ -27,25 +27,10 @@ export const AddressFields = () => { } = addressDetailValidations(settings.country_code ?? '', isSvg); return ( -
- - - +
+ + + {statesListFetched && statesList.length ? ( { validationSchema={addressStateSchema} /> ) : ( - + )} - +
); }; diff --git a/packages/account-v2/src/modules/Onfido/OnfidoContainer.tsx b/packages/account-v2/src/modules/Onfido/OnfidoContainer.tsx index a1f320fb7f5b..d3f903c2c51f 100644 --- a/packages/account-v2/src/modules/Onfido/OnfidoContainer.tsx +++ b/packages/account-v2/src/modules/Onfido/OnfidoContainer.tsx @@ -1,8 +1,7 @@ import React, { useEffect, useState } from 'react'; -import clsx from 'clsx'; import { useHistory } from 'react-router-dom'; +import { twMerge } from 'tailwind-merge'; import { useOnfido } from '@deriv/api'; -import { qtMerge } from '@deriv/quill-design'; import { Button, Loader, Text } from '@deriv-com/ui'; import IcAccountMissingDetails from '../../assets/proof-of-identity/ic-account-missing-details.svg'; import { ErrorMessage } from '../../components/ErrorMessage'; @@ -58,7 +57,7 @@ export const OnfidoContainer = ({ const hasPersonalDetailsValidationError = ['MissingPersonalDetails', 'InvalidPostalCode'].includes( serviceTokenError?.error.code ?? '' ); - const showErrorMessage = onfidoInitializationError?.message || serviceTokenError?.error?.message; + const showErrorMessage = onfidoInitializationError?.message ?? serviceTokenError?.error?.message; if (isServiceTokenLoading) { return ; @@ -98,16 +97,17 @@ export const OnfidoContainer = ({ } return ( -
+
- {/* TODO: Dummy div here replace with PoiConfirmWithExample */} + {/* Do this: Dummy div here replace with PoiConfirmWithExample */}
setIsOnfidoEnabled(true)} onKeyDown={() => setIsOnfidoEnabled(true)} diff --git a/packages/account-v2/src/modules/POAForm/POAFormContainer.tsx b/packages/account-v2/src/modules/POAForm/POAFormContainer.tsx index 5feacdf64b29..62bd48f43f53 100644 --- a/packages/account-v2/src/modules/POAForm/POAFormContainer.tsx +++ b/packages/account-v2/src/modules/POAForm/POAFormContainer.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { useHistory } from 'react-router-dom'; -import { useActiveAccount } from '@deriv/api'; +import { useActiveTradingAccount } from '@deriv/api'; import { Button, Loader, Text } from '@deriv-com/ui'; import IcPOAError from '../../assets/verification-status/ic-poa-error.svg'; import IcPOAUpload from '../../assets/verification-status/ic-poa-upload.svg'; @@ -14,7 +14,7 @@ import { usePOAInfo } from '../../hooks/usePOAInfo'; import { isNavigationFromDerivGO, isNavigationFromP2P } from '../../utils/platform'; export const POAFormContainer = () => { - const { data: activeAccount } = useActiveAccount(); + const { data: activeAccount } = useActiveTradingAccount(); const { data: poaInfo, isLoading } = usePOAInfo(); const [resubmitting, setResubmitting] = useState(false); const history = useHistory(); diff --git a/packages/account-v2/src/router/components/route-links/route-links.tsx b/packages/account-v2/src/router/components/route-links/route-links.tsx index dc0eb9fa25ce..7a80deb4a64c 100644 --- a/packages/account-v2/src/router/components/route-links/route-links.tsx +++ b/packages/account-v2/src/router/components/route-links/route-links.tsx @@ -5,7 +5,7 @@ import { defaultRoute, routes } from '../../constants/routes-config'; const RouteLinks = () => (
-
+
{routes.map(route => ( { - addUtilities({ - '.d-none': { - display: 'none', - }, - }); - }), - ], - presets: [QuillTailwindConfig], theme: { extend: { borderRadius: { @@ -141,6 +129,25 @@ export default { lg: { min: '1280px' }, xl: { min: '1440px' }, }, + opacity: { + 0: '0', + 4: '0.04', + 8: '0.08', + 16: '0.16', + 24: '0.24', + 32: '0.32', + 40: '0.4', + 48: '0.48', + 56: '0.56', + 64: '0.64', + 72: '0.72', + 80: '0.8', + 88: '0.88', + 96: '0.96', + 100: '1', + overlay: '0.72', + disabled: ' 0.32', + }, spacing: { 0: '0px', 1: '1px',