diff --git a/src/pages/ValidatorOnboarding/ContinueButton.tsx b/src/pages/ValidatorOnboarding/ContinueButton.tsx index 592e3a2b..a06b4ac3 100644 --- a/src/pages/ValidatorOnboarding/ContinueButton.tsx +++ b/src/pages/ValidatorOnboarding/ContinueButton.tsx @@ -8,13 +8,21 @@ import { RootState } from '../../redux/store' type ContinueButton = { continueHandler: () => void activeStep: number + isConfirmPhraseStage: boolean } -const ContinueButton = ({ continueHandler, activeStep }: ContinueButton) => { - const isCopyPastedPhrase = useSelector( - (state: RootState) => state.keyGeneration.isCopyPastedPhrase, +const ContinueButton = ({ continueHandler, activeStep, isConfirmPhraseStage }: ContinueButton) => { + const { isCopyPastedPhrase, isRightPhrase } = useSelector( + (state: RootState) => state.keyGeneration, ) + const isDisabled = () => { + if (isConfirmPhraseStage && !isRightPhrase) { + return true + } + return false + } + return ( @@ -35,7 +43,7 @@ const ContinueButton = ({ continueHandler, activeStep }: ContinueButton) => { marginTop: isCopyPastedPhrase ? '0px' : '40px', }} > - diff --git a/src/pages/ValidatorOnboarding/ValidatorOnboarding.tsx b/src/pages/ValidatorOnboarding/ValidatorOnboarding.tsx index 302870c5..0c41651d 100644 --- a/src/pages/ValidatorOnboarding/ValidatorOnboarding.tsx +++ b/src/pages/ValidatorOnboarding/ValidatorOnboarding.tsx @@ -87,7 +87,11 @@ const ValidatorOnboarding = () => { {activeStep === 4 && } {activeStep === 5 && } - + ) diff --git a/src/redux/ValidatorOnboarding/KeyGeneration/slice.ts b/src/redux/ValidatorOnboarding/KeyGeneration/slice.ts index 3556df45..87be99a3 100644 --- a/src/redux/ValidatorOnboarding/KeyGeneration/slice.ts +++ b/src/redux/ValidatorOnboarding/KeyGeneration/slice.ts @@ -3,6 +3,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit' type KeyGenerationState = { words: string[] isCopyPastedPhrase: boolean + isRightPhrase: boolean } type wordProps = { @@ -13,6 +14,7 @@ type wordProps = { const initialState: KeyGenerationState = { words: Array(24).fill(''), isCopyPastedPhrase: false, + isRightPhrase: false, } const keyGenerationSlice = createSlice({ @@ -30,13 +32,13 @@ const keyGenerationSlice = createSlice({ setIsCopyPastedPhrase: (state, action: PayloadAction) => { state.isCopyPastedPhrase = action.payload }, + setIsRightPhrase: (state, action: PayloadAction) => { + state.isRightPhrase = action.payload + }, }, }) -export const { - setWord, - setMnemonic, - setIsCopyPastedPhrase, -} = keyGenerationSlice.actions +export const { setWord, setMnemonic, setIsCopyPastedPhrase, setIsRightPhrase } = + keyGenerationSlice.actions export default keyGenerationSlice.reducer