Commit a345cff6 authored by Charles Bachmeier's avatar Charles Bachmeier Committed by GitHub

fix: cleanup styles for overflow modal (#4458)

* improvements to overflow modal

* add active state to overflow modal

* fix right aligned models
Co-authored-by: default avatarCharlie <charlie@uniswap.org>
parent 85d8566c
import { style } from '@vanilla-extract/css' import { style } from '@vanilla-extract/css'
import { sprinkles, themeVars } from '../../nft/css/sprinkles.css' import { sprinkles, themeVars, vars } from '../../nft/css/sprinkles.css'
export const hover = style([
sprinkles({
transition: '250',
borderRadius: '12',
}),
{
':hover': {
background: vars.color.lightGrayOverlay,
},
},
])
export const MenuRow = style([ export const MenuRow = style([
hover,
sprinkles({ sprinkles({
color: 'blackBlue', color: 'blackBlue',
paddingY: '12', paddingY: '8',
width: 'max', paddingX: '8',
marginRight: '52', width: 'full',
whiteSpace: 'nowrap',
}), }),
{ {
lineHeight: '24px', lineHeight: '24px',
...@@ -22,8 +36,10 @@ export const PrimaryText = style([ ...@@ -22,8 +36,10 @@ export const PrimaryText = style([
]) ])
export const SecondaryText = style([ export const SecondaryText = style([
hover,
sprinkles({ sprinkles({
paddingY: '8', paddingY: '8',
paddingX: '8',
color: 'darkGray', color: 'darkGray',
}), }),
{ {
...@@ -34,6 +50,7 @@ export const SecondaryText = style([ ...@@ -34,6 +50,7 @@ export const SecondaryText = style([
export const Separator = style([ export const Separator = style([
sprinkles({ sprinkles({
height: '0', height: '0',
marginX: '16',
}), }),
{ {
borderTop: 'solid', borderTop: 'solid',
...@@ -45,6 +62,6 @@ export const Separator = style([ ...@@ -45,6 +62,6 @@ export const Separator = style([
export const IconRow = style([ export const IconRow = style([
sprinkles({ sprinkles({
paddingX: '16', paddingX: '16',
paddingY: '8', marginTop: '4',
}), }),
]) ])
...@@ -124,14 +124,14 @@ export const MenuDropdown = () => { ...@@ -124,14 +124,14 @@ export const MenuDropdown = () => {
return ( return (
<> <>
<Box position="relative" ref={ref}> <Box position="relative" ref={ref}>
<NavIcon onClick={toggleOpen}> <NavIcon isActive={isOpen} onClick={toggleOpen}>
<EllipsisIcon width={28} height={28} /> <EllipsisIcon width={28} height={28} />
</NavIcon> </NavIcon>
{isOpen && ( {isOpen && (
<NavDropdown top={60}> <NavDropdown top={60}>
<Column gap="12"> <Column gap="16">
<Column paddingX="16" gap="4"> <Column paddingX="8" gap="4">
{nftFlag === NftVariant.Enabled && ( {nftFlag === NftVariant.Enabled && (
<PrimaryMenuRow to="/nft/sell" close={toggleOpen}> <PrimaryMenuRow to="/nft/sell" close={toggleOpen}>
<Icon> <Icon>
...@@ -150,11 +150,11 @@ export const MenuDropdown = () => { ...@@ -150,11 +150,11 @@ export const MenuDropdown = () => {
<Icon> <Icon>
<BarChartIcon width={24} height={24} /> <BarChartIcon width={24} height={24} />
</Icon> </Icon>
<PrimaryMenuRow.Text>View token analytics</PrimaryMenuRow.Text> <PrimaryMenuRow.Text>View token analytics</PrimaryMenuRow.Text>
</PrimaryMenuRow> </PrimaryMenuRow>
</Column> </Column>
<Separator /> <Separator />
<Column paddingX="16" gap="4"> <Column paddingX="8">
<SecondaryLinkedText href="https://help.uniswap.org/en/">Help center ↗</SecondaryLinkedText> <SecondaryLinkedText href="https://help.uniswap.org/en/">Help center ↗</SecondaryLinkedText>
<SecondaryLinkedText href="https://docs.uniswap.org/">Documentation ↗</SecondaryLinkedText> <SecondaryLinkedText href="https://docs.uniswap.org/">Documentation ↗</SecondaryLinkedText>
<SecondaryLinkedText <SecondaryLinkedText
...@@ -162,20 +162,20 @@ export const MenuDropdown = () => { ...@@ -162,20 +162,20 @@ export const MenuDropdown = () => {
toggleOpen() toggleOpen()
togglePrivacyPolicy() togglePrivacyPolicy()
}} }}
>{`Legal & Privacy`}</SecondaryLinkedText> >{`Legal & Privacy`}</SecondaryLinkedText>
{(isDevelopmentEnv() || isStagingEnv()) && ( {(isDevelopmentEnv() || isStagingEnv()) && (
<SecondaryLinkedText onClick={openFeatureFlagsModal}>{`Feature Flags`}</SecondaryLinkedText> <SecondaryLinkedText onClick={openFeatureFlagsModal}>{`Feature Flags`}</SecondaryLinkedText>
)} )}
</Column> </Column>
<IconRow> <IconRow>
<Icon href="https://discord.com/invite/FCfyBSbCU5"> <Icon href="https://discord.com/invite/FCfyBSbCU5">
<DiscordIconMenu width={24} height={24} color={themeVars.colors.darkGray} /> <DiscordIconMenu className={styles.hover} width={24} height={24} color={themeVars.colors.darkGray} />
</Icon> </Icon>
<Icon href="https://twitter.com/Uniswap"> <Icon href="https://twitter.com/Uniswap">
<TwitterIconMenu width={24} height={24} color={themeVars.colors.darkGray} /> <TwitterIconMenu className={styles.hover} width={24} height={24} color={themeVars.colors.darkGray} />
</Icon> </Icon>
<Icon href="https://github.com/Uniswap"> <Icon href="https://github.com/Uniswap">
<GithubIconMenu width={24} height={24} color={themeVars.colors.darkGray} /> <GithubIconMenu className={styles.hover} width={24} height={24} color={themeVars.colors.darkGray} />
</Icon> </Icon>
</IconRow> </IconRow>
</Column> </Column>
......
...@@ -146,7 +146,7 @@ export const MobileSideBar = () => { ...@@ -146,7 +146,7 @@ export const MobileSideBar = () => {
return ( return (
<> <>
<NavIcon onClick={toggleOpen}> <NavIcon isActive={isOpen} onClick={toggleOpen}>
<HamburgerIcon width={28} height={28} /> <HamburgerIcon width={28} height={28} />
</NavIcon> </NavIcon>
{isOpen && ( {isOpen && (
......
...@@ -5,11 +5,12 @@ import { sprinkles } from '../../nft/css/sprinkles.css' ...@@ -5,11 +5,12 @@ import { sprinkles } from '../../nft/css/sprinkles.css'
export const NavDropdown = style([ export const NavDropdown = style([
sprinkles({ sprinkles({
position: 'absolute', position: 'absolute',
background: 'white95', background: 'lightGray',
borderRadius: '12', borderRadius: '12',
borderStyle: 'solid', borderStyle: 'solid',
borderColor: 'medGray', borderColor: 'medGray',
paddingY: '20', paddingTop: '16',
paddingBottom: '24',
borderWidth: '1px', borderWidth: '1px',
}), }),
{ {
......
...@@ -25,7 +25,7 @@ export const NavDropdown = ({ ...@@ -25,7 +25,7 @@ export const NavDropdown = ({
style={{ style={{
top: `${top}px`, top: `${top}px`,
left: centerHorizontally ? '50%' : leftAligned ? '0px' : 'auto', left: centerHorizontally ? '50%' : leftAligned ? '0px' : 'auto',
right: centerHorizontally || leftAligned ? 'auto' : '10px', right: centerHorizontally || leftAligned ? 'auto' : '0px',
transform: centerHorizontally ? 'translateX(-50%)' : 'unset', transform: centerHorizontally ? 'translateX(-50%)' : 'unset',
zIndex: 3, zIndex: 3,
}} }}
......
...@@ -8,7 +8,6 @@ export const navIcon = style([ ...@@ -8,7 +8,6 @@ export const navIcon = style([
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
color: 'blackBlue', color: 'blackBlue',
background: 'none',
border: 'none', border: 'none',
justifyContent: 'center', justifyContent: 'center',
textAlign: 'center', textAlign: 'center',
......
...@@ -5,12 +5,13 @@ import * as styles from './NavIcon.css' ...@@ -5,12 +5,13 @@ import * as styles from './NavIcon.css'
interface NavIconProps { interface NavIconProps {
children: ReactNode children: ReactNode
isActive?: boolean
onClick: () => void onClick: () => void
} }
export const NavIcon = ({ children, onClick }: NavIconProps) => { export const NavIcon = ({ children, isActive, onClick }: NavIconProps) => {
return ( return (
<Box as="button" className={styles.navIcon} onClick={onClick}> <Box as="button" className={styles.navIcon} background={isActive ? 'accentActiveSoft' : 'none'} onClick={onClick}>
{children} {children}
</Box> </Box>
) )
......
...@@ -146,6 +146,7 @@ export const vars = createGlobalTheme(':root', { ...@@ -146,6 +146,7 @@ export const vars = createGlobalTheme(':root', {
// new uniswap colors: // new uniswap colors:
blue400: '#4C82FB', blue400: '#4C82FB',
blue200: '#ADBCFF30',
pink400: '#FB118E', pink400: '#FB118E',
red700: '#530f10', red700: '#530f10',
red400: '#FA2C38', red400: '#FA2C38',
...@@ -162,6 +163,7 @@ export const vars = createGlobalTheme(':root', { ...@@ -162,6 +163,7 @@ export const vars = createGlobalTheme(':root', {
accentActionSoft: 'rgba(76, 130, 251, 0.24)', accentActionSoft: 'rgba(76, 130, 251, 0.24)',
accentTextLightTertiary: 'rgba(255, 255, 255, 0.12)', accentTextLightTertiary: 'rgba(255, 255, 255, 0.12)',
lightGrayOverlay: '#99A1BD14', lightGrayOverlay: '#99A1BD14',
accentActiveSoft: '#4c82fb3d',
}, },
border: { border: {
transculent: '1.5px solid rgba(0, 0, 0, 0.1)', transculent: '1.5px solid rgba(0, 0, 0, 0.1)',
......
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