Commit 7f4413c7 authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by Connor McEwen

fix: click area should match button effect (#4887)

parent 55beaf65
...@@ -36,6 +36,23 @@ import WalletModal from '../WalletModal' ...@@ -36,6 +36,23 @@ import WalletModal from '../WalletModal'
// https://stackoverflow.com/a/31617326 // https://stackoverflow.com/a/31617326
const FULL_BORDER_RADIUS = 9999 const FULL_BORDER_RADIUS = 9999
const ChevronWrapper = styled.button`
background-color: transparent;
border: none;
cursor: pointer;
display: flex;
padding: 10px 16px 10px 4px;
:hover {
color: ${({ theme }) => theme.accentActionSoft};
}
:hover,
:active,
:focus {
border: none;
}
`
const Web3StatusGeneric = styled(ButtonSecondary)` const Web3StatusGeneric = styled(ButtonSecondary)`
${({ theme }) => theme.flexRowNoWrap} ${({ theme }) => theme.flexRowNoWrap}
width: 100%; width: 100%;
...@@ -62,14 +79,13 @@ const Web3StatusError = styled(Web3StatusGeneric)` ...@@ -62,14 +79,13 @@ const Web3StatusError = styled(Web3StatusGeneric)`
} }
` `
const Web3StatusConnectButton = styled.button<{ faded?: boolean }>` const Web3StatusConnectWrapper = styled.div<{ faded?: boolean }>`
${({ theme }) => theme.flexRowNoWrap} ${({ theme }) => theme.flexRowNoWrap}
align-items: center; align-items: center;
background-color: ${({ theme }) => theme.accentActionSoft}; background-color: ${({ theme }) => theme.accentActionSoft};
border-radius: ${FULL_BORDER_RADIUS}px; border-radius: ${FULL_BORDER_RADIUS}px;
border: none; border: none;
cursor: pointer; padding: 0;
padding: 0 12px;
height: 40px; height: 40px;
:hover, :hover,
...@@ -156,24 +172,35 @@ function Sock() { ...@@ -156,24 +172,35 @@ function Sock() {
const VerticalDivider = styled.div` const VerticalDivider = styled.div`
height: 20px; height: 20px;
margin: 0px 4px; margin: 0px;
width: 1px; width: 1px;
background-color: ${({ theme }) => theme.accentAction}; background-color: ${({ theme }) => theme.accentAction};
` `
const StyledConnect = styled.div` const StyledConnectButton = styled.button`
background-color: transparent;
border: none;
border-top-left-radius: ${FULL_BORDER_RADIUS}px;
border-bottom-left-radius: ${FULL_BORDER_RADIUS}px;
color: ${({ theme }) => theme.accentAction}; color: ${({ theme }) => theme.accentAction};
cursor: pointer;
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
margin-right: 8px; padding: 10px 8px 10px 12px;
&:hover {
color: ${({ theme }) => theme.accentActionSoft};
transition: ${({ transition: ${({
theme: { theme: {
transition: { duration, timing }, transition: { duration, timing },
}, },
}) => `${duration.fast} color ${timing.in}`}; }) => `${duration.fast} color ${timing.in}`};
:hover,
:active,
:focus {
border: none;
}
:hover {
color: ${({ theme }) => theme.accentActionSoft};
} }
` `
...@@ -258,7 +285,6 @@ function Web3StatusInner() { ...@@ -258,7 +285,6 @@ function Web3StatusInner() {
...CHEVRON_PROPS, ...CHEVRON_PROPS,
color: theme.accentAction, color: theme.accentAction,
'data-testid': 'navbar-wallet-dropdown', 'data-testid': 'navbar-wallet-dropdown',
onClick: toggleWalletDropdown,
} }
return ( return (
<TraceEvent <TraceEvent
...@@ -268,13 +294,15 @@ function Web3StatusInner() { ...@@ -268,13 +294,15 @@ function Web3StatusInner() {
element={ElementName.CONNECT_WALLET_BUTTON} element={ElementName.CONNECT_WALLET_BUTTON}
> >
{navbarFlagEnabled ? ( {navbarFlagEnabled ? (
<Web3StatusConnectButton faded={!account}> <Web3StatusConnectWrapper faded={!account}>
<StyledConnect data-testid="navbar-connect-wallet" onClick={toggleWalletModal}> <StyledConnectButton data-testid="navbar-connect-wallet" onClick={toggleWalletModal}>
<Trans>Connect</Trans> <Trans>Connect</Trans>
</StyledConnect> </StyledConnectButton>
<VerticalDivider /> <VerticalDivider />
<ChevronWrapper onClick={toggleWalletDropdown}>
{walletIsOpen ? <ChevronUp {...chevronProps} /> : <ChevronDown {...chevronProps} />} {walletIsOpen ? <ChevronUp {...chevronProps} /> : <ChevronDown {...chevronProps} />}
</Web3StatusConnectButton> </ChevronWrapper>
</Web3StatusConnectWrapper>
) : ( ) : (
<Web3StatusConnect onClick={toggleWallet} faded={!account}> <Web3StatusConnect onClick={toggleWallet} faded={!account}>
<Text> <Text>
......
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