import { Fragment, useCallback } from 'react' import { Button, Card, Col, Drawer, Row, Typography } from 'antd' import IonIcon from '@sentre/antd-ionicon' import WalletProfile from './walletProfile' import WalletInfo from './walletInfo' import Settings from './settings' import { RootDispatch, RootState, useRootDispatch, useRootSelector, } from 'store' import { setVisibleActionCenter } from 'store/ui.reducer' import { openWallet } from 'store/wallet.reducer' import { useWalletAddress } from 'hooks/useWallet' import { isGuestAddress } from 'shared/util' import './index.os.less' type ActionCenterProps = { visibleNavigation: boolean } const ActionCenter = ({ visibleNavigation }: ActionCenterProps) => { const dispatch = useRootDispatch() const visibleActionCenter = useRootSelector( ({ ui }: RootState) => ui.visibleActionCenter, ) const sidebarPosition = useRootSelector( ({ ui }: RootState) => ui.sidebarPosition, ) const walletAddress = useWalletAddress() const onWalletProfile = useCallback(async () => { if (isGuestAddress(walletAddress)) return dispatch(openWallet()) return dispatch(setVisibleActionCenter(true)) }, [walletAddress, dispatch]) return ( dispatch(setVisibleActionCenter(false))} closable={false} contentWrapperStyle={{ width: 378 }} destroyOnClose placement={sidebarPosition} > Account