0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(experience): display secret code first when binding totp on mobile devices (#4743)

This commit is contained in:
Xiao Yijun 2023-10-25 14:05:53 +08:00 committed by GitHub
parent 1c8ef14167
commit 30047e3c19
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
import SectionLayout from '@/Layout/SectionLayout';
import Button from '@/components/Button';
import TextLink from '@/components/TextLink';
import usePlatform from '@/hooks/use-platform';
import useTextHandler from '@/hooks/use-text-handler';
import { type TotpBindingState } from '@/types/guard';
@ -11,7 +12,8 @@ import * as styles from './index.module.scss';
const SecretSection = ({ secret, secretQrCode }: TotpBindingState) => {
const { t } = useTranslation();
const [isQrCodeFormat, setIsQrCodeFormat] = useState(true);
const { isMobile } = usePlatform();
const [isQrCodeFormat, setIsQrCodeFormat] = useState(!isMobile);
const { copyText } = useTextHandler();
return (