@@ -11,33 +11,33 @@ interface TwoFactorRecoveryCodesProps {
1111}
1212
1313export default function TwoFactorRecoveryCodes ( { recoveryCodesList, fetchRecoveryCodes } : TwoFactorRecoveryCodesProps ) {
14- const [ codesAeVisible , setCodesAeVisible ] = useState < boolean > ( false ) ;
14+ const [ codesAreVisible , setCodesAreVisible ] = useState < boolean > ( false ) ;
1515 const codesSectionRef = useRef < HTMLDivElement | null > ( null ) ;
1616
1717 const toggleCodesVisibility = useCallback ( async ( ) => {
18- if ( ! codesAeVisible && ! recoveryCodesList . length ) {
18+ if ( ! codesAreVisible && ! recoveryCodesList . length ) {
1919 await fetchRecoveryCodes ( ) ;
2020 }
2121
22- setCodesAeVisible ( ! codesAeVisible ) ;
22+ setCodesAreVisible ( ! codesAreVisible ) ;
2323
24- if ( ! codesAeVisible ) {
24+ if ( ! codesAreVisible ) {
2525 setTimeout ( ( ) => {
2626 codesSectionRef . current ?. scrollIntoView ( {
2727 behavior : 'smooth' ,
2828 block : 'nearest' ,
2929 } ) ;
3030 } ) ;
3131 }
32- } , [ codesAeVisible , recoveryCodesList . length , fetchRecoveryCodes ] ) ;
32+ } , [ codesAreVisible , recoveryCodesList . length , fetchRecoveryCodes ] ) ;
3333
3434 useEffect ( ( ) => {
3535 if ( ! recoveryCodesList . length ) {
3636 fetchRecoveryCodes ( ) ;
3737 }
3838 } , [ recoveryCodesList . length , fetchRecoveryCodes ] ) ;
3939
40- const RecoveryCodeIconComponent = codesAeVisible ? EyeOff : Eye ;
40+ const RecoveryCodeIconComponent = codesAreVisible ? EyeOff : Eye ;
4141
4242 return (
4343 < Card >
@@ -52,12 +52,12 @@ export default function TwoFactorRecoveryCodes({ recoveryCodesList, fetchRecover
5252 </ CardHeader >
5353 < CardContent >
5454 < div className = "flex flex-col gap-3 select-none sm:flex-row sm:items-center sm:justify-between" >
55- < Button onClick = { toggleCodesVisibility } className = "w-fit" aria-expanded = { codesAeVisible } aria-controls = "recovery-codes-section" >
55+ < Button onClick = { toggleCodesVisibility } className = "w-fit" aria-expanded = { codesAreVisible } aria-controls = "recovery-codes-section" >
5656 < RecoveryCodeIconComponent className = "size-4" aria-hidden = "true" />
57- { codesAeVisible ? 'Hide' : 'View' } Recovery Codes
57+ { codesAreVisible ? 'Hide' : 'View' } Recovery Codes
5858 </ Button >
5959
60- { codesAeVisible && (
60+ { codesAreVisible && (
6161 < Form { ...regenerateRecoveryCodes . form ( ) } options = { { preserveScroll : true } } onSuccess = { fetchRecoveryCodes } >
6262 { ( { processing } ) => (
6363 < Button variant = "secondary" type = "submit" disabled = { processing } aria-describedby = "regenerate-warning" >
@@ -69,8 +69,8 @@ export default function TwoFactorRecoveryCodes({ recoveryCodesList, fetchRecover
6969 </ div >
7070 < div
7171 id = "recovery-codes-section"
72- className = { `relative overflow-hidden transition-all duration-300 ${ codesAeVisible ? 'h-auto opacity-100' : 'h-0 opacity-0' } ` }
73- aria-hidden = { ! codesAeVisible }
72+ className = { `relative overflow-hidden transition-all duration-300 ${ codesAreVisible ? 'h-auto opacity-100' : 'h-0 opacity-0' } ` }
73+ aria-hidden = { ! codesAreVisible }
7474 >
7575 < div className = "mt-3 space-y-3" >
7676 < div
0 commit comments