diff --git a/apps/evm/src/components/ConnectButton/ConnectButton.style.tsx b/apps/evm/src/components/ConnectButton/ConnectButton.style.tsx new file mode 100644 index 00000000..8a55aecd --- /dev/null +++ b/apps/evm/src/components/ConnectButton/ConnectButton.style.tsx @@ -0,0 +1,33 @@ +import { DrawerClose, hexToRgba } from '@gobob/ui'; +import styled from 'styled-components'; + +type StyledCloseButtonProps = { + $isOpen?: boolean; +}; + +const StyledCloseButton = styled(DrawerClose)` + background-color: transparent; + border: 0; + border-top-left-radius: ${({ theme }) => theme.rounded('lg')}; + border-bottom-left-radius: ${({ theme }) => theme.rounded('lg')}; + width: 3.5rem; + height: 100%; + position: absolute; + left: 0; + top: 0; + bottom: 0; + z-index: -1; + display: flex; + padding-top: ${({ theme }) => theme.spacing('3xl')}; + padding-left: ${({ theme }) => theme.spacing('lg')}; + + transform: ${({ $isOpen }) => ($isOpen ? 'translateX(-95%)' : 'translateX(0%)')}; + ${({ theme }) => theme.transition('common', 'normal')} + + &:hover, &:focus-visible { + background-color: ${({ theme }) => hexToRgba(theme.color('grey-300'), 40)}; + transform: ${({ $isOpen }) => $isOpen && 'translateX(-75%)'}; + } +`; + +export { StyledCloseButton }; diff --git a/apps/evm/src/components/ConnectButton/ConnectButton.tsx b/apps/evm/src/components/ConnectButton/ConnectButton.tsx index 165d4534..fbb76250 100644 --- a/apps/evm/src/components/ConnectButton/ConnectButton.tsx +++ b/apps/evm/src/components/ConnectButton/ConnectButton.tsx @@ -1,17 +1,28 @@ 'use client'; import { useAccount as useSatsAccount } from '@gobob/sats-wagmi'; -import { Button, DrawerButton, DrawerContent, DrawerOverlay, DrawerPortal, DrawerRoot, DrawerTitle } from '@gobob/ui'; +import { + Button, + ChevronDoubleRight, + DrawerButton, + DrawerContent, + DrawerOverlay, + DrawerPortal, + DrawerRoot, + DrawerTitle +} from '@gobob/ui'; import { Trans } from '@lingui/macro'; import { useStore } from '@tanstack/react-store'; -import { useState } from 'react'; import { useTheme } from 'styled-components'; import { useMediaQuery } from 'usehooks-ts'; import { useAccount } from 'wagmi'; +import { useState } from 'react'; import { Profile } from '../Profile'; import { ProfileTag } from '../ProfileTag'; +import { StyledCloseButton } from './ConnectButton.style'; + import { useConnectModal } from '@/connect-ui'; import { chainL1, chainL2, isValidChain } from '@/constants'; import { store } from '@/lib/store'; @@ -20,6 +31,8 @@ const ConnectButton = (): JSX.Element => { const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down('s')); + const [isProfileDrawerOpen, setProfileDrawerOpen] = useState(false); + const { address: evmAddress, chain } = useAccount(); const { address: btcAddress } = useSatsAccount(); @@ -29,7 +42,6 @@ const ConnectButton = (): JSX.Element => { const isReceiveModalOpen = useStore(store, (state) => state.shared.isReceiveModalOpen); const { isOpen: isConnectModalOpen } = useConnectModal(); - const [isOpen, setOpen] = useState(false); const { open } = useConnectModal(); const isLoggedIn = !!(evmAddress || btcAddress); @@ -40,20 +52,20 @@ const ConnectButton = (): JSX.Element => { }; return ( - ); } - const handleClose = () => setOpen(false); + const handleClose = () => setProfileDrawerOpen(false); return ( @@ -61,10 +73,13 @@ const ConnectButton = (): JSX.Element => { + + + - + diff --git a/apps/evm/src/components/Layout/Header.tsx b/apps/evm/src/components/Layout/Header.tsx index b0360b33..0460ecd0 100644 --- a/apps/evm/src/components/Layout/Header.tsx +++ b/apps/evm/src/components/Layout/Header.tsx @@ -31,7 +31,7 @@ import { useUserAgent } from '@/user-agent'; const Header = (): JSX.Element => { const { i18n } = useLingui(); - const [isOpen, setOpen] = useState(false); + const [isPopoverOpen, setPopoverOpen] = useState(false); const theme = useTheme(); const isMobileViewport = useMediaQuery(theme.breakpoints.down('md')); @@ -41,57 +41,61 @@ const Header = (): JSX.Element => { return ( - - - - - - - - - - - -