Changeset View
Changeset View
Standalone View
Standalone View
native/account/registration/connect-ethereum.react.js
Show All 18 Lines | |||||
import RegistrationContainer from './registration-container.react.js'; | import RegistrationContainer from './registration-container.react.js'; | ||||
import RegistrationContentContainer from './registration-content-container.react.js'; | import RegistrationContentContainer from './registration-content-container.react.js'; | ||||
import type { RegistrationNavigationProp } from './registration-navigator.react.js'; | import type { RegistrationNavigationProp } from './registration-navigator.react.js'; | ||||
import type { CoolOrNerdMode } from './registration-types.js'; | import type { CoolOrNerdMode } from './registration-types.js'; | ||||
import { | import { | ||||
type NavigationRoute, | type NavigationRoute, | ||||
ExistingEthereumAccountRouteName, | ExistingEthereumAccountRouteName, | ||||
UsernameSelectionRouteName, | UsernameSelectionRouteName, | ||||
AvatarSelectionRouteName, | |||||
} from '../../navigation/route-names.js'; | } from '../../navigation/route-names.js'; | ||||
import { useSelector } from '../../redux/redux-utils.js'; | import { useSelector } from '../../redux/redux-utils.js'; | ||||
import { useStyles } from '../../themes/colors.js'; | import { useStyles } from '../../themes/colors.js'; | ||||
import EthereumLogoDark from '../../vectors/ethereum-logo-dark.react.js'; | import EthereumLogoDark from '../../vectors/ethereum-logo-dark.react.js'; | ||||
import SIWEPanel from '../siwe-panel.react.js'; | import SIWEPanel from '../siwe-panel.react.js'; | ||||
const exactSearchUserLoadingStatusSelector = createLoadingStatusSelector( | const exactSearchUserLoadingStatusSelector = createLoadingStatusSelector( | ||||
exactSearchUserActionTypes, | exactSearchUserActionTypes, | ||||
▲ Show 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | async (result: SIWEResult) => { | ||||
dispatchActionPromise(exactSearchUserActionTypes, searchPromise); | dispatchActionPromise(exactSearchUserActionTypes, searchPromise); | ||||
const { userInfo } = await searchPromise; | const { userInfo } = await searchPromise; | ||||
if (userInfo) { | if (userInfo) { | ||||
navigate<'ExistingEthereumAccount'>({ | navigate<'ExistingEthereumAccount'>({ | ||||
name: ExistingEthereumAccountRouteName, | name: ExistingEthereumAccountRouteName, | ||||
params: result, | params: result, | ||||
}); | }); | ||||
} else { | return; | ||||
// show avatar selection screen | |||||
} | } | ||||
const newUserSelections = { | |||||
...userSelections, | |||||
accountSelections: { | |||||
accountType: 'ethereum', | |||||
...result, | |||||
}, | |||||
}; | |||||
navigate<'AvatarSelection'>({ | |||||
name: AvatarSelectionRouteName, | |||||
params: { userSelections: newUserSelections }, | |||||
}); | |||||
}, | }, | ||||
[exactSearchUserCall, dispatchActionPromise, navigate], | [userSelections, exactSearchUserCall, dispatchActionPromise, navigate], | ||||
); | ); | ||||
let siwePanel; | let siwePanel; | ||||
if (panelState !== 'closed') { | if (panelState !== 'closed') { | ||||
siwePanel = ( | siwePanel = ( | ||||
<SIWEPanel | <SIWEPanel | ||||
onClosing={onPanelClosing} | onClosing={onPanelClosing} | ||||
onClosed={onPanelClosed} | onClosed={onPanelClosed} | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |