// @ts-nocheck import React from 'react'; import styled from 'styled-components'; import classNames from 'classnames'; import { Form, useFormikContext } from 'formik'; import { Button, FormGroup, Intent } from '@blueprintjs/core'; import { TimezonePicker, getTimezoneMetadata } from '@blueprintjs/timezone'; import { ErrorMessage } from 'formik'; import { useHistory } from 'react-router-dom'; import { getAllCountries } from '@bigcapital/utils'; import { FieldRequiredHint, FormattedMessage as T, FFormGroup, FInputGroup, FSelect, Stack, Group, } from '@/components'; import { inputIntent } from '@/utils'; import { CLASSES } from '@/constants/classes'; import { getAllCurrenciesOptions } from '@/constants/currencies'; import { getFiscalYear } from '@/constants/fiscalYearOptions'; import { getLanguages } from '@/constants/languagesOptions'; import { useGeneralFormContext } from './GeneralFormProvider'; import { shouldBaseCurrencyUpdate } from './utils'; import { SelectButton } from '@/components/Forms/Select'; const Countries = getAllCountries(); /** * Preferences general form. */ export default function PreferencesGeneralForm({ isSubmitting }) { const history = useHistory(); const FiscalYear = getFiscalYear(); const Languages = getLanguages(); const Currencies = getAllCurrenciesOptions(); const { dateFormats, baseCurrencyMutateAbility } = useGeneralFormContext(); const baseCurrencyDisabled = baseCurrencyMutateAbility.length > 0; // Handle close click. const handleCloseClick = () => { history.go(-1); }; return (
); } const CardFooterActions = styled.div` --x-color-border: #e0e7ea; --x-color-border: rgba(255, 255, 255, 0.15); padding-top: 16px; border-top: 1px solid var(--x-color-border); margin-top: 30px; .bp4-button { min-width: 70px; + .bp4-button { margin-left: 10px; } } `; function TimezoneField() { const { values, setFieldValue, touched, errors } = useFormikContext(); const value = values?.timezone; const error = errors?.timezone; const isTouched = touched?.timezone; const compositeLabel = React.useMemo(() => { const placeholder =