diff --git a/native/account/registration/connect-ethereum.react.js b/native/account/registration/connect-ethereum.react.js --- a/native/account/registration/connect-ethereum.react.js +++ b/native/account/registration/connect-ethereum.react.js @@ -11,6 +11,7 @@ import type { NavigationRoute } from '../../navigation/route-names.js'; import { useStyles } from '../../themes/colors.js'; import EthereumLogoDark from '../../vectors/ethereum-logo-dark.react.js'; +import SIWEPanel from '../siwe-panel.react.js'; export type ConnectEthereumParams = { +userSelections: { @@ -19,14 +20,13 @@ }, }; +type PanelState = 'closed' | 'opening' | 'open' | 'closing'; + type Props = { +navigation: RegistrationNavigationProp<'ConnectEthereum'>, +route: NavigationRoute<'ConnectEthereum'>, }; function ConnectEthereum(props: Props): React.Node { - const onConnect = React.useCallback(() => {}, []); - const onSkip = React.useCallback(() => {}, []); - const isNerdMode = props.route.params.userSelections.coolOrNerdMode === 'nerd'; const styles = useStyles(unboundStyles); @@ -72,6 +72,41 @@ ); } + const [panelState, setPanelState] = React.useState('closed'); + const openPanel = React.useCallback(() => { + setPanelState('opening'); + }, []); + const onPanelClosed = React.useCallback(() => { + setPanelState('closed'); + }, []); + const onPanelClosing = React.useCallback(() => { + setPanelState('closing'); + }, []); + + const siwePanelSetLoading = React.useCallback( + (loading: boolean) => { + if (panelState === 'closing' || panelState === 'closed') { + return; + } + setPanelState(loading ? 'opening' : 'open'); + }, + [panelState], + ); + + let siwePanel; + if (panelState !== 'closed') { + siwePanel = ( + + ); + } + + const onSkip = React.useCallback(() => {}, []); + return ( @@ -85,9 +120,9 @@ + {siwePanel} ); }