diff --git a/package.json b/package.json index 2e3d7a14f..37ea8af44 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "@types/debounce": "^1.2.0", "@types/events": "^3.0.0", "@types/node": "^14.11.10", + "@types/qrcode.react": "^1.0.1", "@types/query-string": "^6.3.0", "@types/react": "^16.9.41", "@types/react-copy-to-clipboard": "^4.3.0", diff --git a/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx b/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx index c5f37e0b2..727094782 100644 --- a/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx +++ b/resources/scripts/components/dashboard/forms/SetupTwoFactorModal.tsx @@ -11,6 +11,7 @@ import tw from 'twin.macro'; import Button from '@/components/elements/Button'; import asModal from '@/hoc/asModal'; import ModalContext from '@/context/ModalContext'; +import QRCode from 'qrcode.react'; interface Values { code: string; @@ -18,7 +19,6 @@ interface Values { const SetupTwoFactorModal = () => { const [ token, setToken ] = useState(''); - const [ loading, setLoading ] = useState(true); const [ recoveryTokens, setRecoveryTokens ] = useState([]); const { dismiss, setPropOverrides } = useContext(ModalContext); @@ -108,11 +108,7 @@ const SetupTwoFactorModal = () => { css={tw`w-64 h-64 rounded`} /> : - setLoading(false)} - css={tw`w-full h-full shadow-none rounded-none`} - /> + } @@ -124,7 +120,6 @@ const SetupTwoFactorModal = () => { type={'text'} title={'Code From Authenticator'} description={'Enter the code from your authenticator device after scanning the QR image.'} - autoFocus={!loading} />
diff --git a/yarn.lock b/yarn.lock index 22ede6e37..c1557072e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1228,6 +1228,13 @@ version "15.7.1" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6" +"@types/qrcode.react@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/qrcode.react/-/qrcode.react-1.0.1.tgz#0904e7a075a6274a5258f19567b4f64013c159d8" + integrity sha512-PcVCjpsiT2KFKfJibOgTQtkt0QQT/6GbQUp1Np/hMPhwUzMJ2DRUkR9j7tXN9Q8X06qukw+RbaJ8lJ22SBod+Q== + dependencies: + "@types/react" "*" + "@types/query-string@^6.3.0": version "6.3.0" resolved "https://registry.yarnpkg.com/@types/query-string/-/query-string-6.3.0.tgz#b6fa172a01405abcaedac681118e78429d62ea39"