import { CSSProperties, useCallback, useMemo, useState } from 'react' import { Button, Card, Col, Row, Space, Typography } from 'antd' import IonIcon from '@sentre/antd-ionicon' import { RootDispatch, useRootDispatch } from 'store' import { openWallet } from 'store/wallet.reducer' import { useWalletAddress } from 'hooks/useWallet' import { isGuestAddress } from 'shared/util' import { useAppSide, useAppWidth } from 'hooks/useUI' const GuestMode = () => { const [position, setPosition] = useState<'bottom' | 'top'>('bottom') const dispatch = useRootDispatch() const walletAddress = useWalletAddress() const width = useAppWidth() const side = useAppSide() const onConnectWallet = useCallback(() => dispatch(openWallet()), [dispatch]) const onPosition = useCallback( () => setPosition(position === 'bottom' ? 'top' : 'bottom'), [position], ) const style: CSSProperties = useMemo( () => ({ width: width - 24, position: 'fixed', visibility: isGuestAddress(walletAddress) ? 'visible' : 'hidden', [side]: 12, [position]: 12, }), [walletAddress, side, position, width], ) const iconName = useMemo( () => position === 'bottom' ? 'chevron-up-outline' : 'chevron-down-outline', [position], ) return (
In the Guest Mode, some functions are restricted. Please{' '} DO NOT {' '} send tokens to Guest Wallet.
) } export default GuestMode