Commit e3918d03 authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

fix: spacing and other small cosmetic errors in for account dropdown (#5829)

* consolidate padding in connection menu

* reduce button vertical spacing

* reduce button vertical spacing

* add 'ETH Balance' header

* reduce cc icon size to 20px
parent 9719af66
...@@ -21,7 +21,6 @@ import { ProfilePageStateType } from 'nft/types' ...@@ -21,7 +21,6 @@ import { ProfilePageStateType } from 'nft/types'
import { useCallback, useEffect, useMemo, useState } from 'react' import { useCallback, useEffect, useMemo, useState } from 'react'
import { Copy, CreditCard, ExternalLink as ExternalLinkIcon, Info, Power } from 'react-feather' import { Copy, CreditCard, ExternalLink as ExternalLinkIcon, Info, Power } from 'react-feather'
import { useNavigate } from 'react-router-dom' import { useNavigate } from 'react-router-dom'
import { Text } from 'rebass'
import { useCurrencyBalanceString } from 'state/connection/hooks' import { useCurrencyBalanceString } from 'state/connection/hooks'
import { useAppDispatch } from 'state/hooks' import { useAppDispatch } from 'state/hooks'
import { useFiatOnrampAck } from 'state/user/hooks' import { useFiatOnrampAck } from 'state/user/hooks'
...@@ -57,7 +56,7 @@ const BuyCryptoButton = styled(ThemeButton)<{ $animateBorder: boolean }>` ...@@ -57,7 +56,7 @@ const BuyCryptoButton = styled(ThemeButton)<{ $animateBorder: boolean }>`
border-style: solid; border-style: solid;
border-width: 1px; border-width: 1px;
height: 40px; height: 40px;
margin-top: 12px; margin-top: 8px;
animation-direction: alternate; animation-direction: alternate;
animation-duration: ${({ theme }) => theme.transition.duration.slow}; animation-duration: ${({ theme }) => theme.transition.duration.slow};
animation-fill-mode: none; animation-fill-mode: none;
...@@ -70,7 +69,7 @@ const WalletButton = styled(ThemeButton)` ...@@ -70,7 +69,7 @@ const WalletButton = styled(ThemeButton)`
border-radius: 12px; border-radius: 12px;
padding-top: 10px; padding-top: 10px;
padding-bottom: 10px; padding-bottom: 10px;
margin-top: 12px; margin-top: 4px;
color: white; color: white;
border: none; border: none;
` `
...@@ -168,6 +167,9 @@ const StyledLoadingButtonSpinner = styled(LoadingButtonSpinner)` ...@@ -168,6 +167,9 @@ const StyledLoadingButtonSpinner = styled(LoadingButtonSpinner)`
fill: ${({ theme }) => theme.accentAction}; fill: ${({ theme }) => theme.accentAction};
` `
const BalanceWrapper = styled.div` const BalanceWrapper = styled.div`
display: flex;
flex-direction: column;
gap: 8px;
padding: 16px 0; padding: 16px 0;
` `
...@@ -177,10 +179,6 @@ const HeaderWrapper = styled.div` ...@@ -177,10 +179,6 @@ const HeaderWrapper = styled.div`
justify-content: space-between; justify-content: space-between;
` `
const AuthenticatedHeaderWrapper = styled.div`
padding: 0 16px;
`
const AuthenticatedHeader = () => { const AuthenticatedHeader = () => {
const { account, chainId, connector, ENSName } = useWeb3React() const { account, chainId, connector, ENSName } = useWeb3React()
const [isCopied, setCopied] = useCopyClipboard() const [isCopied, setCopied] = useCopyClipboard()
...@@ -280,7 +278,7 @@ const AuthenticatedHeader = () => { ...@@ -280,7 +278,7 @@ const AuthenticatedHeader = () => {
const closeFiatOnrampUnavailableTooltip = useCallback(() => setShow(false), [setShow]) const closeFiatOnrampUnavailableTooltip = useCallback(() => setShow(false), [setShow])
return ( return (
<AuthenticatedHeaderWrapper> <>
<HeaderWrapper> <HeaderWrapper>
<StatusWrapper> <StatusWrapper>
<FlexContainer> <FlexContainer>
...@@ -309,9 +307,10 @@ const AuthenticatedHeader = () => { ...@@ -309,9 +307,10 @@ const AuthenticatedHeader = () => {
</HeaderWrapper> </HeaderWrapper>
<Column> <Column>
<BalanceWrapper> <BalanceWrapper>
<Text fontSize={36} fontWeight={400}> <ThemedText.SubHeaderSmall>ETH Balance</ThemedText.SubHeaderSmall>
<ThemedText.HeadlineLarge fontSize={36} fontWeight={400}>
{balanceString} {nativeCurrencySymbol} {balanceString} {nativeCurrencySymbol}
</Text> </ThemedText.HeadlineLarge>
{amountUSD !== undefined && <USDText>{formatUSDPrice(amountUSD)} USD</USDText>} {amountUSD !== undefined && <USDText>{formatUSDPrice(amountUSD)} USD</USDText>}
</BalanceWrapper> </BalanceWrapper>
<ProfileButton <ProfileButton
...@@ -335,7 +334,11 @@ const AuthenticatedHeader = () => { ...@@ -335,7 +334,11 @@ const AuthenticatedHeader = () => {
<ThemedText.BodyPrimary>{error}</ThemedText.BodyPrimary> <ThemedText.BodyPrimary>{error}</ThemedText.BodyPrimary>
) : ( ) : (
<> <>
{fiatOnrampAvailabilityLoading ? <StyledLoadingButtonSpinner /> : <CreditCard />}{' '} {fiatOnrampAvailabilityLoading ? (
<StyledLoadingButtonSpinner />
) : (
<CreditCard height="20px" width="20px" />
)}{' '}
<Trans>Buy crypto</Trans> <Trans>Buy crypto</Trans>
</> </>
)} )}
...@@ -371,7 +374,7 @@ const AuthenticatedHeader = () => { ...@@ -371,7 +374,7 @@ const AuthenticatedHeader = () => {
</UNIButton> </UNIButton>
)} )}
</Column> </Column>
</AuthenticatedHeaderWrapper> </>
) )
} }
......
...@@ -91,7 +91,6 @@ const IconWrap = styled.span` ...@@ -91,7 +91,6 @@ const IconWrap = styled.span`
const DefaultMenuWrap = styled.div` const DefaultMenuWrap = styled.div`
width: 100%; width: 100%;
height: 100%; height: 100%;
padding: 0 8px;
` `
const DefaultText = styled.span` const DefaultText = styled.span`
......
...@@ -19,7 +19,7 @@ const WalletWrapper = styled.div` ...@@ -19,7 +19,7 @@ const WalletWrapper = styled.div`
background-color: ${({ theme }) => theme.backgroundSurface}; background-color: ${({ theme }) => theme.backgroundSurface};
border: ${({ theme }) => `1px solid ${theme.backgroundOutline}`}; border: ${({ theme }) => `1px solid ${theme.backgroundOutline}`};
box-shadow: ${({ theme }) => theme.deepShadow}; box-shadow: ${({ theme }) => theme.deepShadow};
padding: 16px 0; padding: 16px;
@media only screen and (max-width: ${({ theme }) => `${theme.breakpoint.sm}px`}) { @media only screen and (max-width: ${({ theme }) => `${theme.breakpoint.sm}px`}) {
width: 100%; width: 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment