@ -8,6 +8,7 @@ import { UserUtils } from '../../session/utils';
import { useDispatch , useSelector } from 'react-redux' ;
import { useDispatch , useSelector } from 'react-redux' ;
import { disableRecoveryPhrasePrompt } from '../../state/ducks/userConfig' ;
import { disableRecoveryPhrasePrompt } from '../../state/ducks/userConfig' ;
import { getShowRecoveryPhrasePrompt } from '../../state/selectors/userConfig' ;
import { getShowRecoveryPhrasePrompt } from '../../state/selectors/userConfig' ;
import { recoveryPhraseModal } from '../../state/ducks/modalDialog' ;
const Tab = ( {
const Tab = ( {
isSelected ,
isSelected ,
@ -69,9 +70,9 @@ export const LeftPaneSectionHeader = (props: Props) => {
} ;
} ;
export const LeftPaneBanner = ( ) = > {
export const LeftPaneBanner = ( ) = > {
const [ completion , setCompletion ] = useState ( 8 0) ;
const [ completion , setCompletion ] = useState ( 9 0) ;
const [ bodyText , setBodyText ] = useState ( window . i18n ( 'recoveryPhrase Secure Message') ) ;
const [ bodyText , setBodyText ] = useState ( window . i18n ( 'recoveryPhrase Reveal Message') ) ;
const [ buttonText , setButtonText ] = useState ( window . i18n ( 'recoveryPhrase Secure ButtonText') ) ;
const [ buttonText , setButtonText ] = useState ( window . i18n ( 'recoveryPhrase Reveal ButtonText') ) ;
const [ recoveryPhraseHidden , setRecoveryPhraseHidden ] = useState ( true ) ;
const [ recoveryPhraseHidden , setRecoveryPhraseHidden ] = useState ( true ) ;
const [ isCompleted , setIsCompleted ] = useState ( false ) ;
const [ isCompleted , setIsCompleted ] = useState ( false ) ;
const [ bannerTitle , setBannerTitle ] = useState ( window . i18n ( 'recoveryPhraseSecureTitle' ) ) ;
const [ bannerTitle , setBannerTitle ] = useState ( window . i18n ( 'recoveryPhraseSecureTitle' ) ) ;
@ -79,20 +80,18 @@ export const LeftPaneBanner = () => {
const secondsBeforeRemoval = 2 * 1000 ;
const secondsBeforeRemoval = 2 * 1000 ;
const completionText = ` ${ completion } % ` ;
const completionText = ` ${ completion } % ` ;
const dispatch = useDispatch ( ) ;
const handleShowRecoveryClick = ( ) = > {
const handleShowRecoveryClick = ( ) = > {
setRecoveryPhraseHidden ( false ) ;
// setRecoveryPhraseHidden(false);
setBodyText ( window . i18n ( 'recoveryPhraseInfoMessage' ) ) ;
// setBodyText(window.i18n('recoveryPhraseInfoMessage'));
setButtonText ( window . i18n ( 'copy' ) ) ;
// setButtonText(window.i18n('copy'));
} ;
const handleSecureClick = ( ) = > {
// show a modal
if ( completion === 80 ) {
dispatch ( recoveryPhraseModal ( { } ) )
setCompletion ( 90 ) ;
setBodyText ( window . i18n ( 'recoveryPhraseRevealMessage' ) ) ;
setButtonText ( window . i18n ( 'recoveryPhraseRevealButtonText' ) ) ;
}
} ;
} ;
const BannerInner = ( props : any ) = > {
const BannerInner = ( props : any ) = > {
const dispatch = useDispatch ( ) ;
const dispatch = useDispatch ( ) ;
@ -111,9 +110,7 @@ export const LeftPaneBanner = () => {
} ;
} ;
const onClick =
const onClick =
completion === 80
completion === 90
? handleSecureClick
: completion === 90
? recoveryPhraseHidden
? recoveryPhraseHidden
? handleShowRecoveryClick
? handleShowRecoveryClick
: handleCopyPhraseClick
: handleCopyPhraseClick