File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
resources/scripts/components/dashboard/forms Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 6363 "@types/debounce" : " ^1.2.0" ,
6464 "@types/events" : " ^3.0.0" ,
6565 "@types/node" : " ^14.11.10" ,
66+ "@types/qrcode.react" : " ^1.0.1" ,
6667 "@types/query-string" : " ^6.3.0" ,
6768 "@types/react" : " ^16.9.41" ,
6869 "@types/react-copy-to-clipboard" : " ^4.3.0" ,
Original file line number Diff line number Diff line change @@ -11,14 +11,14 @@ import tw from 'twin.macro';
1111import Button from '@/components/elements/Button' ;
1212import asModal from '@/hoc/asModal' ;
1313import ModalContext from '@/context/ModalContext' ;
14+ import QRCode from 'qrcode.react' ;
1415
1516interface Values {
1617 code : string ;
1718}
1819
1920const SetupTwoFactorModal = ( ) => {
2021 const [ token , setToken ] = useState ( '' ) ;
21- const [ loading , setLoading ] = useState ( true ) ;
2222 const [ recoveryTokens , setRecoveryTokens ] = useState < string [ ] > ( [ ] ) ;
2323
2424 const { dismiss, setPropOverrides } = useContext ( ModalContext ) ;
@@ -108,11 +108,7 @@ const SetupTwoFactorModal = () => {
108108 css = { tw `w-64 h-64 rounded` }
109109 />
110110 :
111- < img
112- src = { `https://api.qrserver.com/v1/create-qr-code/?size=500x500&data=${ token } ` }
113- onLoad = { ( ) => setLoading ( false ) }
114- css = { tw `w-full h-full shadow-none rounded-none` }
115- />
111+ < QRCode renderAs = { 'svg' } value = { token } css = { tw `w-full h-full shadow-none rounded-none` } />
116112 }
117113 </ div >
118114 </ div >
@@ -124,7 +120,6 @@ const SetupTwoFactorModal = () => {
124120 type = { 'text' }
125121 title = { 'Code From Authenticator' }
126122 description = { 'Enter the code from your authenticator device after scanning the QR image.' }
127- autoFocus = { ! loading }
128123 />
129124 </ div >
130125 < div css = { tw `mt-6 md:mt-0 text-right` } >
Original file line number Diff line number Diff line change 12281228 version "15.7.1"
12291229 resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.1.tgz#f1a11e7babb0c3cad68100be381d1e064c68f1f6"
12301230
1231+ " @types/qrcode.react@^1.0.1 " :
1232+ version "1.0.1"
1233+ resolved "https://registry.yarnpkg.com/@types/qrcode.react/-/qrcode.react-1.0.1.tgz#0904e7a075a6274a5258f19567b4f64013c159d8"
1234+ integrity sha512-PcVCjpsiT2KFKfJibOgTQtkt0QQT/6GbQUp1Np/hMPhwUzMJ2DRUkR9j7tXN9Q8X06qukw+RbaJ8lJ22SBod+Q==
1235+ dependencies :
1236+ " @types/react" " *"
1237+
12311238" @types/query-string@^6.3.0 " :
12321239 version "6.3.0"
12331240 resolved "https://registry.yarnpkg.com/@types/query-string/-/query-string-6.3.0.tgz#b6fa172a01405abcaedac681118e78429d62ea39"
You can’t perform that action at this time.
0 commit comments