feat: rename onboarding stages for clarity
also comment on what changes need to be made within the different stagespull/3056/head
parent
a9fcb51021
commit
090ddc07a9
@ -1,4 +1,4 @@
|
|||||||
import { SignInMode, SignInTab } from './SignInTab';
|
import { SignInTab } from './SignInTab';
|
||||||
import { SignUpMode, SignUpTab } from './SignUpTab';
|
import { SignUpTab } from './SignUpTab';
|
||||||
|
|
||||||
export { SignInMode, SignInTab, SignUpMode, SignUpTab };
|
export { SignInTab, SignUpTab };
|
||||||
|
@ -1,58 +1,62 @@
|
|||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { SignInMode, SignUpMode } from '../../../components/registration/stages';
|
import {
|
||||||
import { RegistrationPhase, RegistrationState } from '../ducks/registration';
|
AccountCreation,
|
||||||
|
AccountRestoration,
|
||||||
|
Onboarding,
|
||||||
|
OnboardingState,
|
||||||
|
} from '../ducks/registration';
|
||||||
import { OnboardingStoreState } from '../store';
|
import { OnboardingStoreState } from '../store';
|
||||||
|
|
||||||
// #region Getters
|
// #region Getters
|
||||||
const getRegistration = (state: OnboardingStoreState): RegistrationState => {
|
const getRegistration = (state: OnboardingStoreState): OnboardingState => {
|
||||||
return state.registration;
|
return state.registration;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getGeneratedRecoveryPhrase = createSelector(
|
const getGeneratedRecoveryPhrase = createSelector(
|
||||||
getRegistration,
|
getRegistration,
|
||||||
(state: RegistrationState): string => state.generatedRecoveryPhrase
|
(state: OnboardingState): string => state.generatedRecoveryPhrase
|
||||||
);
|
);
|
||||||
|
|
||||||
const getHexGeneratedPubKey = createSelector(
|
const getHexGeneratedPubKey = createSelector(
|
||||||
getRegistration,
|
getRegistration,
|
||||||
(state: RegistrationState): string => state.hexGeneratedPubKey
|
(state: OnboardingState): string => state.hexGeneratedPubKey
|
||||||
);
|
);
|
||||||
|
|
||||||
const getRegistrationPhase = createSelector(
|
const getOnboardingStep = createSelector(
|
||||||
getRegistration,
|
getRegistration,
|
||||||
(state: RegistrationState): RegistrationPhase => state.registrationPhase
|
(state: OnboardingState): Onboarding => state.step
|
||||||
);
|
);
|
||||||
|
|
||||||
const getSignUpMode = createSelector(
|
const getAccountCreationStep = createSelector(
|
||||||
getRegistration,
|
getRegistration,
|
||||||
(state: RegistrationState): SignUpMode => state.signUpMode
|
(state: OnboardingState): AccountCreation => state.accountCreationStep
|
||||||
);
|
);
|
||||||
|
|
||||||
const getSignInMode = createSelector(
|
const getAccountRestorationStep = createSelector(
|
||||||
getRegistration,
|
getRegistration,
|
||||||
(state: RegistrationState): SignInMode => state.signInMode
|
(state: OnboardingState): AccountRestoration => state.accountRestorationStep
|
||||||
);
|
);
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
// #region Hooks
|
// #region Hooks
|
||||||
export const useRegGeneratedRecoveryPhrase = () => {
|
export const useOnboardGeneratedRecoveryPhrase = () => {
|
||||||
return useSelector(getGeneratedRecoveryPhrase);
|
return useSelector(getGeneratedRecoveryPhrase);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useRegHexGeneratedPubKey = () => {
|
export const useOnboardHexGeneratedPubKey = () => {
|
||||||
return useSelector(getHexGeneratedPubKey);
|
return useSelector(getHexGeneratedPubKey);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useRegRegistrationPhase = () => {
|
export const useOnboardStep = () => {
|
||||||
return useSelector(getRegistrationPhase);
|
return useSelector(getOnboardingStep);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useRegSignUpMode = () => {
|
export const useOnboardAccountCreationStep = () => {
|
||||||
return useSelector(getSignUpMode);
|
return useSelector(getAccountCreationStep);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useRegSignInMode = () => {
|
export const useOnboardAccountRestorationStep = () => {
|
||||||
return useSelector(getSignInMode);
|
return useSelector(getAccountRestorationStep);
|
||||||
};
|
};
|
||||||
// #endregion
|
// #endregion
|
||||||
|
Loading…
Reference in New Issue