mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 15:27:46 +00:00
misc: migrated to switch component
This commit is contained in:
@@ -4,13 +4,13 @@ import TotpRegistration from "@app/components/mfa/TotpRegistration";
|
|||||||
import { createNotification } from "@app/components/notifications";
|
import { createNotification } from "@app/components/notifications";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
|
||||||
ContentLoader,
|
ContentLoader,
|
||||||
DeleteActionModal,
|
DeleteActionModal,
|
||||||
EmailServiceSetupModal,
|
EmailServiceSetupModal,
|
||||||
FormControl,
|
FormControl,
|
||||||
Select,
|
Select,
|
||||||
SelectItem
|
SelectItem,
|
||||||
|
Switch
|
||||||
} from "@app/components/v2";
|
} from "@app/components/v2";
|
||||||
import { useToggle } from "@app/hooks";
|
import { useToggle } from "@app/hooks";
|
||||||
import { useGetUser, userKeys, useUpdateUserMfa } from "@app/hooks/api";
|
import { useGetUser, userKeys, useUpdateUserMfa } from "@app/hooks/api";
|
||||||
@@ -140,7 +140,7 @@ export const MFASection = () => {
|
|||||||
<div className="mb-6 max-w-6xl rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
|
<div className="mb-6 max-w-6xl rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
|
||||||
<p className="mb-4 text-xl font-semibold text-mineshaft-100">Two-factor Authentication</p>
|
<p className="mb-4 text-xl font-semibold text-mineshaft-100">Two-factor Authentication</p>
|
||||||
{user && (
|
{user && (
|
||||||
<Checkbox
|
<Switch
|
||||||
className="data-[state=checked]:bg-primary"
|
className="data-[state=checked]:bg-primary"
|
||||||
id="isTwoFAEnabled"
|
id="isTwoFAEnabled"
|
||||||
isChecked={user?.isMfaEnabled}
|
isChecked={user?.isMfaEnabled}
|
||||||
@@ -153,7 +153,7 @@ export const MFASection = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Enable 2-factor authentication
|
Enable 2-factor authentication
|
||||||
</Checkbox>
|
</Switch>
|
||||||
)}
|
)}
|
||||||
{user?.isMfaEnabled && (
|
{user?.isMfaEnabled && (
|
||||||
<FormControl label="Selected 2FA method" className="mt-3">
|
<FormControl label="Selected 2FA method" className="mt-3">
|
||||||
|
|||||||
Reference in New Issue
Block a user