diff --git a/src/config/lexics/public.tsx b/src/config/lexics/public.tsx index 72a7c501..d92ee766 100644 --- a/src/config/lexics/public.tsx +++ b/src/config/lexics/public.tsx @@ -1,3 +1,28 @@ export const publicLexics = { - authorization: 500, + form_address1: 12914, + form_address2: 12915, + form_card_code: 12918, + form_card_expiration: 2023, + form_card_number: 2022, + form_city: 11401, + form_country: 835, + form_email: 12912, + form_firstname: 645, + form_lastname: 858, + form_password: 751, + form_phone: 1656, + form_postal_code: 12913, + form_region: 12932, + login: 1367, + next: 12916, + please_fill_out_this_field: 12933, + register: 1305, + select_language: 1005, + step_title_card: 12917, + step_title_login: 500, + step_title_registration: 1306, + step_title_subscription: 12919, + subscription_done: 2668, + subscription_extra: 6036, + subscription_for: 12920, } diff --git a/src/features/Combobox/index.tsx b/src/features/Combobox/index.tsx index 6bdd71f7..9081d22d 100644 --- a/src/features/Combobox/index.tsx +++ b/src/features/Combobox/index.tsx @@ -4,6 +4,7 @@ import isEmpty from 'lodash/isEmpty' import map from 'lodash/map' import '@reach/combobox/styles.css' +import { T9n } from 'features/T9n' import { Label } from 'features/Common/Input/styled' import { Props, Option } from './types' @@ -22,10 +23,12 @@ export const Combobox = (props: Props) => { disabled, id, label, + labelLexic, labelWidth, openOnFocus, pattern, required, + title, } = props const { onInputBlur, @@ -43,7 +46,11 @@ export const Combobox = (props: Props) => { labelWidth={labelWidth} htmlFor={id} > - {label} + { + labelLexic + ? + : label + } (props: Props) => { required={required} disabled={disabled} value={query} + title={title} pattern={pattern} onChange={onQueryChange} onBlur={onInputBlur} diff --git a/src/features/Combobox/types.tsx b/src/features/Combobox/types.tsx index 89255672..32d97caf 100644 --- a/src/features/Combobox/types.tsx +++ b/src/features/Combobox/types.tsx @@ -11,8 +11,10 @@ export type Props = Pick, ( | 'required' | 'disabled' | 'pattern' + | 'title' )> & { label?: string, + labelLexic?: string, labelWidth?: number, onChange?: (event: ChangeEvent) => void, onSelect?: (option: T | null) => void, diff --git a/src/features/Common/Input/index.tsx b/src/features/Common/Input/index.tsx index 01879e5f..cd27b715 100644 --- a/src/features/Common/Input/index.tsx +++ b/src/features/Common/Input/index.tsx @@ -1,5 +1,7 @@ import React, { ChangeEvent } from 'react' +import { T9n } from 'features/T9n' + import { TInputWrapper, InputWrapper, @@ -11,7 +13,8 @@ type TInput = { defaultValue?: string, id: string, inputWidth?: number, - label: string, + label?: string, + labelLexic?: string, labelWidth?: number, maxLength?: number, onChange?: (event: ChangeEvent) => void, @@ -27,6 +30,7 @@ export const Input = ({ id, inputWidth, label, + labelLexic, labelWidth, maxLength, onChange, @@ -46,7 +50,11 @@ export const Input = ({ htmlFor={id} labelWidth={labelWidth} > - {label} + { + labelLexic + ? + : label + } { - const { changeLang } = useLexicsStore() + const { changeLang, translate } = useLexicsStore() const { close, isOpen, @@ -33,7 +33,11 @@ export const LanguageSelect = () => { return ( - + {isOpen && ( { diff --git a/src/features/Login/index.tsx b/src/features/Login/index.tsx index 1ccdcd37..26d30feb 100644 --- a/src/features/Login/index.tsx +++ b/src/features/Login/index.tsx @@ -6,6 +6,7 @@ import { T9n } from 'features/T9n' import { Logo } from 'features/Logo' import { Input, ButtonSolid } from 'features/Common' import { formIds } from 'features/Register/components/RegistrationStep/config' +import { useLexicsStore } from 'features/LexicsStore' import { useForm } from './hooks' import { @@ -20,32 +21,40 @@ const labelWidth = 60 export const Login = () => { const { handleSubmit } = useForm() + const { translate } = useLexicsStore() + const defaultMessage = translate('please_fill_out_this_field') return (
- + + + - Войти + + + - Зарегистрироваться +
diff --git a/src/features/Register/components/CardStep/index.tsx b/src/features/Register/components/CardStep/index.tsx index ec8cc083..b7ce68b3 100644 --- a/src/features/Register/components/CardStep/index.tsx +++ b/src/features/Register/components/CardStep/index.tsx @@ -1,44 +1,58 @@ import React from 'react' +import { T9n } from 'features/T9n' import { Input, ButtonSolid } from 'features/Common' import { BlockTitle, ButtonsBlock, Form, } from 'features/Login/styled' +import { useLexicsStore } from 'features/LexicsStore' import { Card, Row } from '../../styled' -export const CardStep = () => ( -
- Привязка карты +export const CardStep = () => { + const { translate } = useLexicsStore() + const defaultMessage = translate('please_fill_out_this_field') + return ( + + + + - - - + - - - - - Далее - -
-) + + + + + + + + + + + + ) +} diff --git a/src/features/Register/components/RegistrationStep/index.tsx b/src/features/Register/components/RegistrationStep/index.tsx index 2819bc7e..132c313d 100644 --- a/src/features/Register/components/RegistrationStep/index.tsx +++ b/src/features/Register/components/RegistrationStep/index.tsx @@ -1,5 +1,6 @@ import React from 'react' +import { T9n } from 'features/T9n' import { Combobox } from 'features/Combobox' import { Input, ButtonSolid } from 'features/Common' import { @@ -7,6 +8,7 @@ import { ButtonsBlock, Form, } from 'features/Login/styled' +import { useLexicsStore } from 'features/LexicsStore' import { formIds } from './config' import { passwordRegex } from '../../helpers/isValidPassword' @@ -15,7 +17,7 @@ import { useForm } from './hooks/useForm' const commonFieldRegex = '^.{0,500}$' const postalCodeRegex = '^\\d{5}(?:[-\\s]\\d{4})?$' -const labelWidth = 78 +const labelWidth = 116 export const RegistrationStep = () => { const { @@ -28,64 +30,72 @@ export const RegistrationStep = () => { onCountrySelect, selectedCountry, } = useForm() + const { translate } = useLexicsStore() + const defaultMessage = translate('please_fill_out_this_field') return (
- Регистрация + + + { options={cities} onSelect={onCitySelect} pattern={commonFieldRegex} + title={defaultMessage} /> - Далее + + + ) diff --git a/src/features/Register/components/SubscriptionsStep/index.tsx b/src/features/Register/components/SubscriptionsStep/index.tsx index 58b3d8ea..a423fca7 100644 --- a/src/features/Register/components/SubscriptionsStep/index.tsx +++ b/src/features/Register/components/SubscriptionsStep/index.tsx @@ -1,5 +1,6 @@ import React, { Fragment } from 'react' +import { T9n } from 'features/T9n' import { ButtonSolid } from 'features/Common/Button' import { ArrowLeft, ArrowRight } from 'features/Common/Arrows' import { ButtonsBlock } from 'features/Login/styled' @@ -22,7 +23,9 @@ import { export const SubscriptionStep = () => ( - Выбор подписки + + + @@ -33,7 +36,9 @@ export const SubscriptionStep = () => ( - Дополнительно + + + @@ -44,9 +49,11 @@ export const SubscriptionStep = () => ( - Готово + + + - Базовая + 2 дополнительно за + Базовая + 2 дополнительно 6997 ₽ / МЕС