Login:Components:WizardForm: remove types for props and add changes to types

This commit is contained in:
Darya Umrikhina 2024-07-19 15:13:41 +04:00
parent ad867802e2
commit 26cef3bb89

View File

@ -26,19 +26,13 @@
"use client"; "use client";
import { TCulturesOption, TTimeZoneOption } from "@/types"; import { TCulturesOption, TTimeZoneOption, WizardFormProps } from "@/types";
import { getSelectZone, getUserTimezone, mapTimezonesToArray } from "@/utils"; import { getSelectZone, getUserTimezone, mapTimezonesToArray } from "@/utils";
import { import {
DEFAULT_SELECT_LANGUAGE, DEFAULT_SELECT_LANGUAGE,
DEFAULT_SELECT_TIMEZONE, DEFAULT_SELECT_TIMEZONE,
URL_LICENSE, URL_LICENSE,
} from "@/utils/constants"; } from "@/utils/constants";
import {
TPasswordHash,
TPasswordSettings,
TPortalCultures,
TTimeZone,
} from "@docspace/shared/api/settings/types";
import { import {
convertLanguage, convertLanguage,
createPasswordHash, createPasswordHash,
@ -80,17 +74,7 @@ import { setCookie } from "@docspace/shared/utils/cookie";
import { InputSize, InputType } from "@docspace/shared/components/text-input"; import { InputSize, InputType } from "@docspace/shared/components/text-input";
import useDeviceType from "@/hooks/useDeviceType"; import useDeviceType from "@/hooks/useDeviceType";
import { DeviceType } from "@docspace/shared/enums"; import { DeviceType } from "@docspace/shared/enums";
import { Nullable } from "@docspace/shared/types";
type WizardFormProps = {
passwordSettings?: TPasswordSettings;
machineName?: string;
isRequiredLicense?: boolean;
portalTimeZones?: TTimeZone[];
portalCultures?: TPortalCultures;
culture?: string;
wizardToken?: string;
passwordHash?: TPasswordHash;
};
const emailSettings = new EmailSettings(); const emailSettings = new EmailSettings();
emailSettings.allowDomainPunycode = true; emailSettings.allowDomainPunycode = true;
@ -122,7 +106,7 @@ function WizardForm(props: WizardFormProps) {
const [hasErrorPass, setHasErrorPass] = useState(false); const [hasErrorPass, setHasErrorPass] = useState(false);
const [hasErrorLicense, setHasErrorLicense] = useState(false); const [hasErrorLicense, setHasErrorLicense] = useState(false);
const [invalidLicense, setInvalidLicense] = useState(false); const [invalidLicense, setInvalidLicense] = useState(false);
const [licenseUpload, setLicenseUpload] = useState<string | null>(null); const [licenseUpload, setLicenseUpload] = useState<Nullable<string>>(null);
const [agreeTerms, setAgreeTerms] = useState(false); const [agreeTerms, setAgreeTerms] = useState(false);
const [hasErrorAgree, setHasErrorAgree] = useState(false); const [hasErrorAgree, setHasErrorAgree] = useState(false);
const [isCreated, setIsCreated] = useState(false); const [isCreated, setIsCreated] = useState(false);
@ -132,7 +116,7 @@ function WizardForm(props: WizardFormProps) {
const theme = useTheme(); const theme = useTheme();
const { currentDeviceType } = useDeviceType(); const { currentDeviceType } = useDeviceType();
const refPassInput = useRef<PasswordInputHandle>(null); const refPassInput = useRef<Nullable<PasswordInputHandle>>(null);
const userCulture = culture || "en"; const userCulture = culture || "en";
const isMobileView = currentDeviceType === DeviceType.mobile; const isMobileView = currentDeviceType === DeviceType.mobile;