Login:Src:Components: get currentColorScheme from useTheme

This commit is contained in:
Darya Umrikhina 2024-08-14 19:20:17 +04:00
parent 07ff333d4c
commit 6bf142767d
2 changed files with 5 additions and 6 deletions

View File

@ -28,13 +28,13 @@
import { useContext, useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useTheme } from "styled-components";
import { Text } from "@docspace/shared/components/text";
import { Link, LinkTarget, LinkType } from "@docspace/shared/components/link";
import { FormWrapper } from "@docspace/shared/components/form-wrapper";
import { Button, ButtonSize } from "@docspace/shared/components/button";
import { toastr } from "@docspace/shared/components/toast";
import { TColorScheme } from "@docspace/shared/themes";
import { deleteSelf } from "@docspace/shared/api/people";
import { TError } from "@/types";
@ -45,16 +45,16 @@ import { ConfirmRouteContext } from "../ConfirmRoute";
type ProfileRemoveFormProps = {
legalTerms: string;
greetingSettings: string;
currentColorScheme?: TColorScheme;
};
const ProfileRemoveForm = ({
legalTerms,
greetingSettings,
currentColorScheme,
}: ProfileRemoveFormProps) => {
const { linkData } = useContext(ConfirmRouteContext);
const { t } = useTranslation(["Confirm", "Common"]);
const { currentColorScheme } = useTheme();
const [isProfileDeleted, setIsProfileDeleted] = useState(false);
const [isLoading, setIsLoading] = useState(false);

View File

@ -30,6 +30,7 @@
import { ChangeEvent, useContext, useState } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useTheme } from "styled-components";
import { Link, LinkTarget } from "@docspace/shared/components/link";
import { combineUrl } from "@docspace/shared/utils/combineUrl";
@ -44,7 +45,6 @@ import {
} from "@docspace/shared/components/text-input";
import { Button, ButtonSize } from "@docspace/shared/components/button";
import { toastr } from "@docspace/shared/components/toast";
import { TColorScheme } from "@docspace/shared/themes";
import { TPasswordHash } from "@docspace/shared/api/settings/types";
import { loginWithTfaCode } from "@docspace/shared/api/user";
import { validateTfaCode } from "@docspace/shared/api/settings";
@ -67,7 +67,6 @@ type TfaActivationFormProps = {
qrCode: string;
passwordHash: TPasswordHash;
userName?: string;
currentColorScheme?: TColorScheme;
};
const TfaActivationForm = ({
@ -75,10 +74,10 @@ const TfaActivationForm = ({
qrCode,
passwordHash,
userName,
currentColorScheme,
}: TfaActivationFormProps) => {
const { linkData } = useContext(ConfirmRouteContext);
const { t } = useTranslation(["Confirm", "Common"]);
const { currentColorScheme } = useTheme();
const [code, setCode] = useState("");
const [isLoading, setIsLoading] = useState(false);