Commit 2f7c5b1d authored by vignesh mohankumar's avatar vignesh mohankumar Committed by GitHub

chore: remove remaining redesign flag usage (#4958)

* chore: remove redesign flag in base shared components

* remove more flags

* rm pending view

* chore: remove liquidity redesign flags

* rm searchmodal

* rm searchmodal

* rm searchmodal

* numericalinput

* rm remaining

* rm flag

* fix

* fixes

* !isactive fix

* fix appbody

* hoverdefault fix
parent 8fca2860
...@@ -50,12 +50,12 @@ export const BaseButton = styled(RebassButton)< ...@@ -50,12 +50,12 @@ export const BaseButton = styled(RebassButton)<
} }
` `
export const ButtonPrimary = styled(BaseButton)<{ redesignFlag?: boolean }>` export const ButtonPrimary = styled(BaseButton)`
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.accentAction : theme.deprecated_primary1)}; background-color: ${({ theme }) => theme.accentAction};
font-size: ${({ redesignFlag }) => redesignFlag && '20px'}; font-size: 20px;
font-weight: ${({ redesignFlag }) => redesignFlag && '600'}; font-weight: 600;
padding: ${({ redesignFlag }) => redesignFlag && '16px'}; padding: 16px;
color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.accentTextLightPrimary : 'white')}; color: ${({ theme }) => theme.accentTextLightPrimary};
&:focus { &:focus {
box-shadow: 0 0 0 1pt ${({ theme }) => darken(0.05, theme.deprecated_primary1)}; box-shadow: 0 0 0 1pt ${({ theme }) => darken(0.05, theme.deprecated_primary1)};
background-color: ${({ theme }) => darken(0.05, theme.deprecated_primary1)}; background-color: ${({ theme }) => darken(0.05, theme.deprecated_primary1)};
...@@ -79,35 +79,28 @@ export const ButtonPrimary = styled(BaseButton)<{ redesignFlag?: boolean }>` ...@@ -79,35 +79,28 @@ export const ButtonPrimary = styled(BaseButton)<{ redesignFlag?: boolean }>`
} }
` `
export const ButtonLight = styled(BaseButton)<{ redesignFlag?: boolean }>` export const ButtonLight = styled(BaseButton)`
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.accentActionSoft : theme.deprecated_primary5)}; background-color: ${({ theme }) => theme.accentActionSoft};
color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.accentAction : theme.deprecated_primaryText1)}; color: ${({ theme }) => theme.accentAction};
font-size: ${({ redesignFlag }) => (redesignFlag ? '20px' : '16px')}; font-size: 20px;
font-weight: ${({ redesignFlag }) => (redesignFlag ? '600' : '500')}; font-weight: 600;
&:focus { &:focus {
box-shadow: 0 0 0 1pt box-shadow: 0 0 0 1pt ${({ theme, disabled }) => !disabled && theme.accentActionSoft};
${({ theme, disabled, redesignFlag }) => background-color: ${({ theme, disabled }) => !disabled && theme.accentActionSoft};
!disabled && (redesignFlag ? theme.accentActionSoft : darken(0.03, theme.deprecated_primary5))};
background-color: ${({ theme, disabled, redesignFlag }) =>
!disabled && (redesignFlag ? theme.accentActionSoft : darken(0.03, theme.deprecated_primary5))};
} }
&:hover { &:hover {
background-color: ${({ theme, disabled, redesignFlag }) => background-color: ${({ theme, disabled }) => !disabled && theme.accentActionSoft};
!disabled && (redesignFlag ? theme.accentActionSoft : darken(0.03, theme.deprecated_primary5))};
} }
&:active { &:active {
box-shadow: 0 0 0 1pt box-shadow: 0 0 0 1pt ${({ theme, disabled }) => !disabled && theme.accentActionSoft};
${({ theme, disabled, redesignFlag }) => background-color: ${({ theme, disabled }) => !disabled && theme.accentActionSoft};
!disabled && (redesignFlag ? theme.accentActionSoft : darken(0.05, theme.deprecated_primary5))};
background-color: ${({ theme, disabled, redesignFlag }) =>
!disabled && (redesignFlag ? theme.accentActionSoft : darken(0.05, theme.deprecated_primary5))};
} }
:disabled { :disabled {
opacity: 0.4; opacity: 0.4;
:hover { :hover {
cursor: auto; cursor: auto;
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? 'transparent' : theme.deprecated_primary5)}; background-color: transparent;
box-shadow: none; box-shadow: none;
border: 1px solid transparent; border: 1px solid transparent;
outline: none; outline: none;
...@@ -176,28 +169,22 @@ export const ButtonOutlined = styled(BaseButton)` ...@@ -176,28 +169,22 @@ export const ButtonOutlined = styled(BaseButton)`
} }
` `
export const ButtonYellow = styled(BaseButton)<{ redesignFlag?: boolean }>` export const ButtonYellow = styled(BaseButton)`
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.accentWarningSoft : theme.deprecated_yellow3)}; background-color: ${({ theme }) => theme.accentWarningSoft};
color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.accentWarning : 'white')}; color: ${({ theme }) => theme.accentWarning};
&:focus { &:focus {
box-shadow: ${({ theme, redesignFlag }) => !redesignFlag && `0 0 0 1pt ${theme.deprecated_yellow3}`}; background-color: ${({ theme }) => theme.accentWarningSoft};
background-color: ${({ theme, redesignFlag }) =>
redesignFlag ? theme.accentWarningSoft : darken(0.05, theme.deprecated_yellow3)};
} }
&:hover { &:hover {
background: ${({ theme, redesignFlag }) => redesignFlag && theme.stateOverlayHover}; background: ${({ theme }) => theme.stateOverlayHover};
mix-blend-mode: ${({ redesignFlag }) => redesignFlag && 'normal'}; mix-blend-mode: normal;
background-color: ${({ theme, redesignFlag }) => !redesignFlag && darken(0.05, theme.deprecated_yellow3)};
} }
&:active { &:active {
box-shadow: ${({ theme, redesignFlag }) => !redesignFlag && `0 0 0 1pt ${darken(0.1, theme.deprecated_yellow3)}`}; background-color: ${({ theme }) => theme.accentWarningSoft};
background-color: ${({ theme, redesignFlag }) =>
redesignFlag ? theme.accentWarningSoft : darken(0.1, theme.deprecated_yellow3)};
} }
&:disabled { &:disabled {
background-color: ${({ theme, redesignFlag }) => background-color: ${({ theme }) => theme.accentWarningSoft};
redesignFlag ? theme.accentWarningSoft : theme.deprecated_yellow3}; opacity: 60%;
opacity: ${({ redesignFlag }) => (redesignFlag ? '60%' : '50%')};
cursor: auto; cursor: auto;
} }
` `
......
...@@ -9,13 +9,12 @@ const rotate = keyframes` ...@@ -9,13 +9,12 @@ const rotate = keyframes`
} }
` `
const StyledSVG = styled.svg<{ size: string; stroke?: string; redesignFlag?: boolean }>` const StyledSVG = styled.svg<{ size: string; stroke?: string }>`
animation: 2s ${rotate} linear infinite; animation: 2s ${rotate} linear infinite;
height: ${({ size }) => size}; height: ${({ size }) => size};
width: ${({ size }) => size}; width: ${({ size }) => size};
path { path {
stroke: ${({ stroke, redesignFlag, theme }) => stroke: ${({ stroke, theme }) => theme.accentActive};
redesignFlag ? theme.accentActive : stroke ?? theme.deprecated_primary1};
} }
` `
...@@ -27,25 +26,15 @@ export default function Loader({ ...@@ -27,25 +26,15 @@ export default function Loader({
size = '16px', size = '16px',
stroke, stroke,
strokeWidth, strokeWidth,
redesignFlag,
...rest ...rest
}: { }: {
size?: string size?: string
stroke?: string stroke?: string
strokeWidth?: number strokeWidth?: number
redesignFlag?: boolean
[k: string]: any [k: string]: any
}) { }) {
return ( return (
<StyledSVG <StyledSVG viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" size={size} stroke={stroke} {...rest}>
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
size={size}
stroke={stroke}
redesignFlag={redesignFlag}
{...rest}
>
<path <path
d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 9.27455 20.9097 6.80375 19.1414 5" d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 9.27455 20.9097 6.80375 19.1414 5"
strokeWidth={strokeWidth ?? '2.5'} strokeWidth={strokeWidth ?? '2.5'}
......
import { DialogContent, DialogOverlay } from '@reach/dialog' import { DialogContent, DialogOverlay } from '@reach/dialog'
import { transparentize } from 'polished'
import React from 'react' import React from 'react'
import { animated, useSpring, useTransition } from 'react-spring' import { animated, useSpring, useTransition } from 'react-spring'
import { useGesture } from 'react-use-gesture' import { useGesture } from 'react-use-gesture'
...@@ -10,7 +9,7 @@ import { isMobile } from '../../utils/userAgent' ...@@ -10,7 +9,7 @@ import { isMobile } from '../../utils/userAgent'
const AnimatedDialogOverlay = animated(DialogOverlay) const AnimatedDialogOverlay = animated(DialogOverlay)
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
const StyledDialogOverlay = styled(AnimatedDialogOverlay)<{ redesignFlag?: boolean; scrollOverlay?: boolean }>` const StyledDialogOverlay = styled(AnimatedDialogOverlay)<{ scrollOverlay?: boolean }>`
&[data-reach-dialog-overlay] { &[data-reach-dialog-overlay] {
z-index: ${Z_INDEX.modalBackdrop}; z-index: ${Z_INDEX.modalBackdrop};
background-color: transparent; background-color: transparent;
...@@ -21,14 +20,14 @@ const StyledDialogOverlay = styled(AnimatedDialogOverlay)<{ redesignFlag?: boole ...@@ -21,14 +20,14 @@ const StyledDialogOverlay = styled(AnimatedDialogOverlay)<{ redesignFlag?: boole
overflow-y: ${({ scrollOverlay }) => scrollOverlay && 'scroll'}; overflow-y: ${({ scrollOverlay }) => scrollOverlay && 'scroll'};
justify-content: center; justify-content: center;
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.backgroundScrim : theme.deprecated_modalBG)}; background-color: ${({ theme }) => theme.backgroundScrim};
} }
` `
const AnimatedDialogContent = animated(DialogContent) const AnimatedDialogContent = animated(DialogContent)
// destructure to not pass custom props to Dialog DOM element // destructure to not pass custom props to Dialog DOM element
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
const StyledDialogContent = styled(({ minHeight, maxHeight, mobile, isOpen, redesignFlag, scrollOverlay, ...rest }) => ( const StyledDialogContent = styled(({ minHeight, maxHeight, mobile, isOpen, scrollOverlay, ...rest }) => (
<AnimatedDialogContent {...rest} /> <AnimatedDialogContent {...rest} />
)).attrs({ )).attrs({
'aria-label': 'dialog', 'aria-label': 'dialog',
...@@ -36,11 +35,10 @@ const StyledDialogContent = styled(({ minHeight, maxHeight, mobile, isOpen, rede ...@@ -36,11 +35,10 @@ const StyledDialogContent = styled(({ minHeight, maxHeight, mobile, isOpen, rede
overflow-y: auto; overflow-y: auto;
&[data-reach-dialog-content] { &[data-reach-dialog-content] {
margin: ${({ redesignFlag }) => (redesignFlag ? 'auto' : '0 0 2rem 0')}; margin: auto;
background-color: ${({ theme }) => theme.deprecated_bg0}; background-color: ${({ theme }) => theme.deprecated_bg0};
border: 1px solid ${({ theme }) => theme.deprecated_bg1}; border: 1px solid ${({ theme }) => theme.deprecated_bg1};
box-shadow: ${({ theme, redesignFlag }) => box-shadow: ${({ theme }) => theme.deepShadow};
redesignFlag ? theme.deepShadow : `0 4px 8px 0 ${transparentize(0.95, theme.shadow1)}`};
padding: 0px; padding: 0px;
width: 50vw; width: 50vw;
overflow-y: auto; overflow-y: auto;
...@@ -61,9 +59,9 @@ const StyledDialogContent = styled(({ minHeight, maxHeight, mobile, isOpen, rede ...@@ -61,9 +59,9 @@ const StyledDialogContent = styled(({ minHeight, maxHeight, mobile, isOpen, rede
`} `}
display: ${({ scrollOverlay }) => (scrollOverlay ? 'inline-table' : 'flex')}; display: ${({ scrollOverlay }) => (scrollOverlay ? 'inline-table' : 'flex')};
border-radius: 20px; border-radius: 20px;
${({ theme, redesignFlag }) => theme.deprecated_mediaWidth.deprecated_upToMedium` ${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToMedium`
width: 65vw; width: 65vw;
margin: ${redesignFlag ? 'auto' : '0'}; margin: auto;
`} `}
${({ theme, mobile }) => theme.deprecated_mediaWidth.deprecated_upToSmall` ${({ theme, mobile }) => theme.deprecated_mediaWidth.deprecated_upToSmall`
width: 85vw; width: 85vw;
...@@ -87,7 +85,6 @@ interface ModalProps { ...@@ -87,7 +85,6 @@ interface ModalProps {
maxHeight?: number maxHeight?: number
initialFocusRef?: React.RefObject<any> initialFocusRef?: React.RefObject<any>
children?: React.ReactNode children?: React.ReactNode
redesignFlag?: boolean
scrollOverlay?: boolean scrollOverlay?: boolean
} }
...@@ -98,7 +95,6 @@ export default function Modal({ ...@@ -98,7 +95,6 @@ export default function Modal({
maxHeight = 90, maxHeight = 90,
initialFocusRef, initialFocusRef,
children, children,
redesignFlag,
scrollOverlay, scrollOverlay,
}: ModalProps) { }: ModalProps) {
const fadeTransition = useTransition(isOpen, { const fadeTransition = useTransition(isOpen, {
...@@ -131,7 +127,6 @@ export default function Modal({ ...@@ -131,7 +127,6 @@ export default function Modal({
onDismiss={onDismiss} onDismiss={onDismiss}
initialFocusRef={initialFocusRef} initialFocusRef={initialFocusRef}
unstable_lockFocusAcrossFrames={false} unstable_lockFocusAcrossFrames={false}
redesignFlag={redesignFlag}
scrollOverlay={scrollOverlay} scrollOverlay={scrollOverlay}
> >
<StyledDialogContent <StyledDialogContent
...@@ -145,7 +140,6 @@ export default function Modal({ ...@@ -145,7 +140,6 @@ export default function Modal({
minHeight={minHeight} minHeight={minHeight}
maxHeight={maxHeight} maxHeight={maxHeight}
mobile={isMobile} mobile={isMobile}
redesignFlag={redesignFlag}
scrollOverlay={scrollOverlay} scrollOverlay={scrollOverlay}
> >
{/* prevents the automatic focusing of inputs on mobile by the reach dialog */} {/* prevents the automatic focusing of inputs on mobile by the reach dialog */}
......
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import React from 'react' import React from 'react'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { escapeRegExp } from '../../utils' import { escapeRegExp } from '../../utils'
const StyledInput = styled.input<{ error?: boolean; fontSize?: string; align?: string; redesignFlag: boolean }>` const StyledInput = styled.input<{ error?: boolean; fontSize?: string; align?: string }>`
color: ${({ error, theme }) => (error ? theme.deprecated_red1 : theme.deprecated_text1)}; color: ${({ error, theme }) => (error ? theme.deprecated_red1 : theme.deprecated_text1)};
width: 0; width: 0;
position: relative; position: relative;
font-weight: ${({ redesignFlag }) => (redesignFlag ? 400 : 500)}; font-weight: 400;
outline: none; outline: none;
border: none; border: none;
flex: 1 1 auto; flex: 1 1 auto;
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? 'transparent' : theme.deprecated_bg1)}; background-color: transparent;
font-size: ${({ fontSize }) => fontSize ?? '28px'}; font-size: ${({ fontSize }) => fontSize ?? '28px'};
text-align: ${({ align }) => align && align}; text-align: ${({ align }) => align && align};
white-space: nowrap; white-space: nowrap;
...@@ -36,7 +35,7 @@ const StyledInput = styled.input<{ error?: boolean; fontSize?: string; align?: s ...@@ -36,7 +35,7 @@ const StyledInput = styled.input<{ error?: boolean; fontSize?: string; align?: s
} }
::placeholder { ::placeholder {
color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.textTertiary : theme.deprecated_text4)}; color: ${({ theme }) => theme.textTertiary};
} }
` `
...@@ -56,8 +55,6 @@ export const Input = React.memo(function InnerInput({ ...@@ -56,8 +55,6 @@ export const Input = React.memo(function InnerInput({
align?: 'right' | 'left' align?: 'right' | 'left'
prependSymbol?: string | undefined prependSymbol?: string | undefined
} & Omit<React.HTMLProps<HTMLInputElement>, 'ref' | 'onChange' | 'as'>) { } & Omit<React.HTMLProps<HTMLInputElement>, 'ref' | 'onChange' | 'as'>) {
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
const enforcer = (nextUserInput: string) => { const enforcer = (nextUserInput: string) => {
if (nextUserInput === '' || inputRegex.test(escapeRegExp(nextUserInput))) { if (nextUserInput === '' || inputRegex.test(escapeRegExp(nextUserInput))) {
onUserInput(nextUserInput) onUserInput(nextUserInput)
...@@ -68,7 +65,6 @@ export const Input = React.memo(function InnerInput({ ...@@ -68,7 +65,6 @@ export const Input = React.memo(function InnerInput({
<StyledInput <StyledInput
{...rest} {...rest}
value={prependSymbol && value ? prependSymbol + value : value} value={prependSymbol && value ? prependSymbol + value : value}
redesignFlag={redesignFlagEnabled}
onChange={(event) => { onChange={(event) => {
if (prependSymbol) { if (prependSymbol) {
const value = event.target.value const value = event.target.value
...@@ -91,7 +87,7 @@ export const Input = React.memo(function InnerInput({ ...@@ -91,7 +87,7 @@ export const Input = React.memo(function InnerInput({
// text-specific options // text-specific options
type="text" type="text"
pattern="^[0-9]*[.,]?[0-9]*$" pattern="^[0-9]*[.,]?[0-9]*$"
placeholder={placeholder || (redesignFlagEnabled ? '0' : '0.0')} placeholder={placeholder || '0'}
minLength={1} minLength={1}
maxLength={79} maxLength={79}
spellCheck="false" spellCheck="false"
......
...@@ -2,22 +2,17 @@ import { Trans } from '@lingui/macro' ...@@ -2,22 +2,17 @@ import { Trans } from '@lingui/macro'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { getChainInfoOrDefault, L2ChainInfo } from 'constants/chainInfo' import { getChainInfoOrDefault, L2ChainInfo } from 'constants/chainInfo'
import { SupportedChainId } from 'constants/chains' import { SupportedChainId } from 'constants/chains'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign' import { AlertTriangle } from 'react-feather'
import { AlertOctagon, AlertTriangle } from 'react-feather'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { ExternalLink, MEDIA_WIDTHS } from 'theme' import { ExternalLink, MEDIA_WIDTHS } from 'theme'
const BodyRow = styled.div<{ $redesignFlag?: boolean }>` const BodyRow = styled.div`
color: ${({ theme, $redesignFlag }) => ($redesignFlag ? theme.textPrimary : theme.black)}; color: ${({ theme }) => theme.textPrimary};
font-size: 12px; font-size: 12px;
font-weight: ${({ $redesignFlag }) => $redesignFlag && '400'}; font-weight: 400;
font-size: ${({ $redesignFlag }) => ($redesignFlag ? '14px' : '12px')}; font-size: 14px;
line-height: ${({ $redesignFlag }) => $redesignFlag && '20px'}; line-height: 20px;
` `
const CautionOctagon = styled(AlertOctagon)`
color: ${({ theme }) => theme.deprecated_black};
`
const CautionTriangle = styled(AlertTriangle)` const CautionTriangle = styled(AlertTriangle)`
color: ${({ theme }) => theme.accentWarning}; color: ${({ theme }) => theme.accentWarning};
` `
...@@ -31,15 +26,15 @@ const TitleRow = styled.div` ...@@ -31,15 +26,15 @@ const TitleRow = styled.div`
justify-content: flex-start; justify-content: flex-start;
margin-bottom: 8px; margin-bottom: 8px;
` `
const TitleText = styled.div<{ redesignFlag?: boolean }>` const TitleText = styled.div`
color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.textPrimary : theme.black)}; color: ${({ theme }) => theme.textPrimary};
font-weight: ${({ redesignFlag }) => (redesignFlag ? '500' : '600')}; font-weight: 500;
font-size: 16px; font-size: 16px;
line-height: ${({ redesignFlag }) => (redesignFlag ? '24px' : '20px')}; line-height: 24px;
margin: 0px 12px; margin: 0px 12px;
` `
const Wrapper = styled.div<{ redesignFlag?: boolean }>` const Wrapper = styled.div`
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.backgroundSurface : theme.deprecated_yellow3)}; background-color: ${({ theme }) => theme.backgroundSurface};
border-radius: 12px; border-radius: 12px;
border: 1px solid ${({ theme }) => theme.backgroundOutline}; border: 1px solid ${({ theme }) => theme.backgroundOutline};
bottom: 60px; bottom: 60px;
...@@ -57,17 +52,16 @@ export function ChainConnectivityWarning() { ...@@ -57,17 +52,16 @@ export function ChainConnectivityWarning() {
const { chainId } = useWeb3React() const { chainId } = useWeb3React()
const info = getChainInfoOrDefault(chainId) const info = getChainInfoOrDefault(chainId)
const label = info?.label const label = info?.label
const redesignFlag = useRedesignFlag() === RedesignVariant.Enabled
return ( return (
<Wrapper redesignFlag={redesignFlag}> <Wrapper>
<TitleRow> <TitleRow>
{redesignFlag ? <CautionTriangle /> : <CautionOctagon />} <CautionTriangle />
<TitleText redesignFlag={redesignFlag}> <TitleText>
<Trans>Network Warning</Trans> <Trans>Network Warning</Trans>
</TitleText> </TitleText>
</TitleRow> </TitleRow>
<BodyRow $redesignFlag={redesignFlag}> <BodyRow>
{chainId === SupportedChainId.MAINNET ? ( {chainId === SupportedChainId.MAINNET ? (
<Trans>You may have lost your network connection.</Trans> <Trans>You may have lost your network connection.</Trans>
) : ( ) : (
......
...@@ -6,7 +6,6 @@ import { AutoColumn } from 'components/Column' ...@@ -6,7 +6,6 @@ import { AutoColumn } from 'components/Column'
import CurrencyLogo from 'components/CurrencyLogo' import CurrencyLogo from 'components/CurrencyLogo'
import { AutoRow } from 'components/Row' import { AutoRow } from 'components/Row'
import { COMMON_BASES } from 'constants/routing' import { COMMON_BASES } from 'constants/routing'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import { useTokenInfoFromActiveList } from 'hooks/useTokenInfoFromActiveList' import { useTokenInfoFromActiveList } from 'hooks/useTokenInfoFromActiveList'
import { Text } from 'rebass' import { Text } from 'rebass'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
...@@ -18,17 +17,9 @@ const MobileWrapper = styled(AutoColumn)` ...@@ -18,17 +17,9 @@ const MobileWrapper = styled(AutoColumn)`
`}; `};
` `
const BaseWrapper = styled.div<{ disable?: boolean; redesignFlag?: boolean }>` const BaseWrapper = styled.div<{ disable?: boolean }>`
border: 1px solid border: 1px solid ${({ theme, disable }) => (disable ? theme.accentAction : theme.backgroundOutline)};
${({ theme, disable, redesignFlag }) => border-radius: 16px;
disable
? redesignFlag
? theme.accentAction
: 'transparent'
: redesignFlag
? theme.backgroundOutline
: theme.deprecated_bg3};
border-radius: ${({ redesignFlag }) => (redesignFlag ? '16px' : '10px')};
display: flex; display: flex;
padding: 6px; padding: 6px;
padding-right: 12px; padding-right: 12px;
...@@ -36,15 +27,11 @@ const BaseWrapper = styled.div<{ disable?: boolean; redesignFlag?: boolean }>` ...@@ -36,15 +27,11 @@ const BaseWrapper = styled.div<{ disable?: boolean; redesignFlag?: boolean }>`
align-items: center; align-items: center;
:hover { :hover {
cursor: ${({ disable }) => !disable && 'pointer'}; cursor: ${({ disable }) => !disable && 'pointer'};
background-color: ${({ theme, disable, redesignFlag }) => background-color: ${({ theme }) => theme.hoverDefault};
(redesignFlag && theme.hoverDefault) || (!disable && theme.deprecated_bg2)};
} }
color: ${({ theme, disable, redesignFlag }) => color: ${({ theme, disable }) => disable && theme.accentAction};
disable && (redesignFlag ? theme.accentAction : theme.deprecated_text3)}; background-color: ${({ theme, disable }) => disable && theme.accentActionSoft};
background-color: ${({ theme, disable, redesignFlag }) =>
disable && (redesignFlag ? theme.accentActionSoft : theme.deprecated_bg3)};
filter: ${({ disable, redesignFlag }) => disable && !redesignFlag && 'grayscale(1)'};
` `
const formatAnalyticsEventProperties = (currency: Currency, searchQuery: string, isAddressSearch: string | false) => ({ const formatAnalyticsEventProperties = (currency: Currency, searchQuery: string, isAddressSearch: string | false) => ({
...@@ -73,8 +60,6 @@ export default function CommonBases({ ...@@ -73,8 +60,6 @@ export default function CommonBases({
isAddressSearch: string | false isAddressSearch: string | false
}) { }) {
const bases = typeof chainId !== 'undefined' ? COMMON_BASES[chainId] ?? [] : [] const bases = typeof chainId !== 'undefined' ? COMMON_BASES[chainId] ?? [] : []
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
return bases.length > 0 ? ( return bases.length > 0 ? (
<MobileWrapper gap="md"> <MobileWrapper gap="md">
...@@ -95,7 +80,6 @@ export default function CommonBases({ ...@@ -95,7 +80,6 @@ export default function CommonBases({
onKeyPress={(e) => !isSelected && e.key === 'Enter' && onSelect(currency)} onKeyPress={(e) => !isSelected && e.key === 'Enter' && onSelect(currency)}
onClick={() => !isSelected && onSelect(currency)} onClick={() => !isSelected && onSelect(currency)}
disable={isSelected} disable={isSelected}
redesignFlag={redesignFlagEnabled}
key={currencyId(currency)} key={currencyId(currency)}
> >
<CurrencyLogoFromList currency={currency} /> <CurrencyLogoFromList currency={currency} />
......
...@@ -4,7 +4,6 @@ import { ElementName, Event, EventName } from 'analytics/constants' ...@@ -4,7 +4,6 @@ import { ElementName, Event, EventName } from 'analytics/constants'
import { TraceEvent } from 'analytics/TraceEvent' import { TraceEvent } from 'analytics/TraceEvent'
import TokenSafetyIcon from 'components/TokenSafety/TokenSafetyIcon' import TokenSafetyIcon from 'components/TokenSafety/TokenSafetyIcon'
import { checkWarning } from 'constants/tokenSafety' import { checkWarning } from 'constants/tokenSafety'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react' import { CSSProperties, MutableRefObject, useCallback, useMemo } from 'react'
import { XOctagon } from 'react-feather' import { XOctagon } from 'react-feather'
import { Check } from 'react-feather' import { Check } from 'react-feather'
...@@ -128,7 +127,6 @@ export function CurrencyRow({ ...@@ -128,7 +127,6 @@ export function CurrencyRow({
const customAdded = useIsUserAddedToken(currency) const customAdded = useIsUserAddedToken(currency)
const balance = useCurrencyBalance(account ?? undefined, currency) const balance = useCurrencyBalance(account ?? undefined, currency)
const warning = currency.isNative ? null : checkWarning(currency.address) const warning = currency.isNative ? null : checkWarning(currency.address)
const redesignFlagEnabled = useRedesignFlag() === RedesignVariant.Enabled
const isBlockedToken = !!warning && !warning.canProceed const isBlockedToken = !!warning && !warning.canProceed
const blockedTokenOpacity = '0.6' const blockedTokenOpacity = '0.6'
...@@ -142,7 +140,6 @@ export function CurrencyRow({ ...@@ -142,7 +140,6 @@ export function CurrencyRow({
> >
<MenuItem <MenuItem
tabIndex={0} tabIndex={0}
redesignFlag={redesignFlagEnabled}
style={style} style={style}
className={`token-item-${key}`} className={`token-item-${key}`}
onKeyPress={(e) => (!isSelected && e.key === 'Enter' ? onSelect(!!warning) : null)} onKeyPress={(e) => (!isSelected && e.key === 'Enter' ? onSelect(!!warning) : null)}
...@@ -176,10 +173,9 @@ export function CurrencyRow({ ...@@ -176,10 +173,9 @@ export function CurrencyRow({
{showCurrencyAmount ? ( {showCurrencyAmount ? (
<RowFixed style={{ justifySelf: 'flex-end' }}> <RowFixed style={{ justifySelf: 'flex-end' }}>
{balance ? <Balance balance={balance} /> : account ? <Loader /> : null} {balance ? <Balance balance={balance} /> : account ? <Loader /> : null}
{redesignFlagEnabled && isSelected && <CheckIcon />} {isSelected && <CheckIcon />}
</RowFixed> </RowFixed>
) : ( ) : (
redesignFlagEnabled &&
isSelected && ( isSelected && (
<RowFixed style={{ justifySelf: 'flex-end' }}> <RowFixed style={{ justifySelf: 'flex-end' }}>
<CheckIcon /> <CheckIcon />
......
...@@ -5,7 +5,6 @@ import { useWeb3React } from '@web3-react/core' ...@@ -5,7 +5,6 @@ import { useWeb3React } from '@web3-react/core'
import { EventName, ModalName } from 'analytics/constants' import { EventName, ModalName } from 'analytics/constants'
import { Trace } from 'analytics/Trace' import { Trace } from 'analytics/Trace'
import { sendEvent } from 'components/analytics' import { sendEvent } from 'components/analytics'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import useDebounce from 'hooks/useDebounce' import useDebounce from 'hooks/useDebounce'
import { useOnClickOutside } from 'hooks/useOnClickOutside' import { useOnClickOutside } from 'hooks/useOnClickOutside'
import useToggle from 'hooks/useToggle' import useToggle from 'hooks/useToggle'
...@@ -29,8 +28,8 @@ import { CurrencyRow, formatAnalyticsEventProperties } from './CurrencyList' ...@@ -29,8 +28,8 @@ import { CurrencyRow, formatAnalyticsEventProperties } from './CurrencyList'
import CurrencyList from './CurrencyList' import CurrencyList from './CurrencyList'
import { PaddedColumn, SearchInput, Separator } from './styleds' import { PaddedColumn, SearchInput, Separator } from './styleds'
const ContentWrapper = styled(Column)<{ redesignFlag?: boolean }>` const ContentWrapper = styled(Column)`
background-color: ${({ theme, redesignFlag }) => redesignFlag && theme.backgroundSurface}; background-color: ${({ theme }) => theme.backgroundSurface};
width: 100%; width: 100%;
flex: 1 1; flex: 1 1;
position: relative; position: relative;
...@@ -57,9 +56,6 @@ export function CurrencySearch({ ...@@ -57,9 +56,6 @@ export function CurrencySearch({
onDismiss, onDismiss,
isOpen, isOpen,
}: CurrencySearchProps) { }: CurrencySearchProps) {
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
const { chainId } = useWeb3React() const { chainId } = useWeb3React()
const theme = useTheme() const theme = useTheme()
...@@ -177,7 +173,7 @@ export function CurrencySearch({ ...@@ -177,7 +173,7 @@ export function CurrencySearch({
}, []) }, [])
return ( return (
<ContentWrapper redesignFlag={redesignFlagEnabled}> <ContentWrapper>
<Trace name={EventName.TOKEN_SELECTOR_OPENED} modal={ModalName.TOKEN_SELECTOR} shouldLogImpression> <Trace name={EventName.TOKEN_SELECTOR_OPENED} modal={ModalName.TOKEN_SELECTOR} shouldLogImpression>
<PaddedColumn gap="16px"> <PaddedColumn gap="16px">
<RowBetween> <RowBetween>
...@@ -192,7 +188,6 @@ export function CurrencySearch({ ...@@ -192,7 +188,6 @@ export function CurrencySearch({
id="token-search-input" id="token-search-input"
placeholder={t`Search name or paste address`} placeholder={t`Search name or paste address`}
autoComplete="off" autoComplete="off"
redesignFlag={redesignFlagEnabled}
value={searchQuery} value={searchQuery}
ref={inputRef as RefObject<HTMLInputElement>} ref={inputRef as RefObject<HTMLInputElement>}
onChange={handleInput} onChange={handleInput}
...@@ -209,7 +204,7 @@ export function CurrencySearch({ ...@@ -209,7 +204,7 @@ export function CurrencySearch({
/> />
)} )}
</PaddedColumn> </PaddedColumn>
<Separator redesignFlag={redesignFlagEnabled} /> <Separator />
{searchToken && !searchTokenIsAdded ? ( {searchToken && !searchTokenIsAdded ? (
<Column style={{ padding: '20px 0', height: '100%' }}> <Column style={{ padding: '20px 0', height: '100%' }}>
<CurrencyRow <CurrencyRow
......
...@@ -22,7 +22,7 @@ export const PaddedColumn = styled(AutoColumn)` ...@@ -22,7 +22,7 @@ export const PaddedColumn = styled(AutoColumn)`
padding: 20px; padding: 20px;
` `
export const MenuItem = styled(RowBetween)<{ redesignFlag?: boolean; dim?: boolean }>` export const MenuItem = styled(RowBetween)<{ dim?: boolean }>`
padding: 4px 20px; padding: 4px 20px;
height: 56px; height: 56px;
display: grid; display: grid;
...@@ -31,13 +31,12 @@ export const MenuItem = styled(RowBetween)<{ redesignFlag?: boolean; dim?: boole ...@@ -31,13 +31,12 @@ export const MenuItem = styled(RowBetween)<{ redesignFlag?: boolean; dim?: boole
cursor: ${({ disabled }) => !disabled && 'pointer'}; cursor: ${({ disabled }) => !disabled && 'pointer'};
pointer-events: ${({ disabled }) => disabled && 'none'}; pointer-events: ${({ disabled }) => disabled && 'none'};
:hover { :hover {
background-color: ${({ theme, disabled, redesignFlag }) => background-color: ${({ theme }) => theme.hoverDefault};
(redesignFlag && theme.hoverDefault) || (!disabled && theme.deprecated_bg2)};
} }
opacity: ${({ disabled, selected, dim }) => (dim || disabled || selected ? 0.4 : 1)}; opacity: ${({ disabled, selected, dim }) => (dim || disabled || selected ? 0.4 : 1)};
` `
export const SearchInput = styled.input<{ redesignFlag?: boolean }>` export const SearchInput = styled.input`
background: no-repeat scroll 7px 7px; background: no-repeat scroll 7px 7px;
background-image: url(${searchIcon}); background-image: url(${searchIcon});
background-size: 20px 20px; background-size: 20px 20px;
...@@ -46,37 +45,36 @@ export const SearchInput = styled.input<{ redesignFlag?: boolean }>` ...@@ -46,37 +45,36 @@ export const SearchInput = styled.input<{ redesignFlag?: boolean }>`
display: flex; display: flex;
padding: 16px; padding: 16px;
padding-left: 40px; padding-left: 40px;
height: ${({ redesignFlag }) => redesignFlag && '40px'}; height: 40px;
align-items: center; align-items: center;
width: 100%; width: 100%;
white-space: nowrap; white-space: nowrap;
background-color: ${({ theme, redesignFlag }) => redesignFlag && theme.backgroundModule}; background-color: ${({ theme }) => theme.backgroundModule};
border: none; border: none;
outline: none; outline: none;
border-radius: ${({ redesignFlag }) => (redesignFlag ? '12px' : '20px')}; border-radius: 12px;
color: ${({ theme }) => theme.deprecated_text1}; color: ${({ theme }) => theme.deprecated_text1};
border-style: solid; border-style: solid;
border: 1px solid ${({ theme, redesignFlag }) => (redesignFlag ? theme.backgroundOutline : theme.deprecated_bg3)}; border: 1px solid ${({ theme }) => theme.backgroundOutline};
-webkit-appearance: none; -webkit-appearance: none;
font-size: ${({ redesignFlag }) => (redesignFlag ? '16px' : '18px')}; font-size: 16px;
::placeholder { ::placeholder {
color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.textTertiary : theme.deprecated_text3)}; color: ${({ theme }) => theme.textTertiary};
font-size: ${({ redesignFlag }) => redesignFlag && '16px'}; font-size: 16px;
} }
transition: border 100ms; transition: border 100ms;
:focus { :focus {
border: 1px solid border: 1px solid ${({ theme }) => theme.accentActiveSoft};
${({ theme, redesignFlag }) => (redesignFlag ? theme.accentActiveSoft : theme.deprecated_primary1)}; background-color: ${({ theme }) => theme.backgroundSurface};
background-color: ${({ theme, redesignFlag }) => redesignFlag && theme.backgroundSurface};
outline: none; outline: none;
} }
` `
export const Separator = styled.div<{ redesignFlag?: boolean }>` export const Separator = styled.div`
width: 100%; width: 100%;
height: 1px; height: 1px;
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.backgroundOutline : theme.deprecated_bg2)}; background-color: ${({ theme }) => theme.backgroundOutline};
` `
export const SeparatorDark = styled.div` export const SeparatorDark = styled.div`
......
...@@ -3,7 +3,6 @@ import { t, Trans } from '@lingui/macro' ...@@ -3,7 +3,6 @@ import { t, Trans } from '@lingui/macro'
import { Percent } from '@uniswap/sdk-core' import { Percent } from '@uniswap/sdk-core'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { sendEvent } from 'components/analytics' import { sendEvent } from 'components/analytics'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import { isSupportedChainId } from 'lib/hooks/routing/clientSideSmartOrderRouter' import { isSupportedChainId } from 'lib/hooks/routing/clientSideSmartOrderRouter'
import { useRef, useState } from 'react' import { useRef, useState } from 'react'
import { Settings, X } from 'react-feather' import { Settings, X } from 'react-feather'
...@@ -23,16 +22,16 @@ import { RowBetween, RowFixed } from '../Row' ...@@ -23,16 +22,16 @@ import { RowBetween, RowFixed } from '../Row'
import Toggle from '../Toggle' import Toggle from '../Toggle'
import TransactionSettings from '../TransactionSettings' import TransactionSettings from '../TransactionSettings'
const StyledMenuIcon = styled(Settings)<{ redesignFlag: boolean }>` const StyledMenuIcon = styled(Settings)`
height: 20px; height: 20px;
width: 20px; width: 20px;
> * { > * {
stroke: ${({ theme, redesignFlag }) => (redesignFlag ? theme.textSecondary : theme.deprecated_text1)}; stroke: ${({ theme }) => theme.textSecondary};
} }
` `
const StyledCloseIcon = styled(X)<{ redesignFlag: boolean }>` const StyledCloseIcon = styled(X)`
height: 20px; height: 20px;
width: 20px; width: 20px;
:hover { :hover {
...@@ -40,7 +39,7 @@ const StyledCloseIcon = styled(X)<{ redesignFlag: boolean }>` ...@@ -40,7 +39,7 @@ const StyledCloseIcon = styled(X)<{ redesignFlag: boolean }>`
} }
> * { > * {
stroke: ${({ theme, redesignFlag }) => (redesignFlag ? theme.textSecondary : theme.deprecated_text1)}; stroke: ${({ theme }) => theme.textSecondary};
} }
` `
...@@ -83,10 +82,10 @@ const StyledMenu = styled.div` ...@@ -83,10 +82,10 @@ const StyledMenu = styled.div`
text-align: left; text-align: left;
` `
const MenuFlyout = styled.span<{ redesignFlag: boolean }>` const MenuFlyout = styled.span`
min-width: 20.125rem; min-width: 20.125rem;
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.backgroundSurface : theme.deprecated_bg2)}; background-color: ${({ theme }) => theme.backgroundSurface};
border: 1px solid ${({ theme, redesignFlag }) => (redesignFlag ? theme.backgroundOutline : theme.deprecated_bg3)}; border: 1px solid ${({ theme }) => theme.backgroundOutline};
box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04), box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04),
0px 24px 32px rgba(0, 0, 0, 0.01); 0px 24px 32px rgba(0, 0, 0, 0.01);
border-radius: 12px; border-radius: 12px;
...@@ -97,7 +96,7 @@ const MenuFlyout = styled.span<{ redesignFlag: boolean }>` ...@@ -97,7 +96,7 @@ const MenuFlyout = styled.span<{ redesignFlag: boolean }>`
top: 2rem; top: 2rem;
right: 0rem; right: 0rem;
z-index: 100; z-index: 100;
color: ${({ theme, redesignFlag }) => redesignFlag && theme.textPrimary}; color: ${({ theme }) => theme.textPrimary};
${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToMedium` ${({ theme }) => theme.deprecated_mediaWidth.deprecated_upToMedium`
min-width: 18.125rem; min-width: 18.125rem;
...@@ -123,8 +122,6 @@ const ModalContentWrapper = styled.div` ...@@ -123,8 +122,6 @@ const ModalContentWrapper = styled.div`
export default function SettingsTab({ placeholderSlippage }: { placeholderSlippage: Percent }) { export default function SettingsTab({ placeholderSlippage }: { placeholderSlippage: Percent }) {
const { chainId } = useWeb3React() const { chainId } = useWeb3React()
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
const node = useRef<HTMLDivElement>() const node = useRef<HTMLDivElement>()
const open = useModalIsOpen(ApplicationModal.SETTINGS) const open = useModalIsOpen(ApplicationModal.SETTINGS)
...@@ -152,7 +149,7 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa ...@@ -152,7 +149,7 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
<Text fontWeight={500} fontSize={20}> <Text fontWeight={500} fontSize={20}>
<Trans>Are you sure?</Trans> <Trans>Are you sure?</Trans>
</Text> </Text>
<StyledCloseIcon onClick={() => setShowConfirmation(false)} redesignFlag={redesignFlagEnabled} /> <StyledCloseIcon onClick={() => setShowConfirmation(false)} />
</RowBetween> </RowBetween>
<Break /> <Break />
<AutoColumn gap="lg" style={{ padding: '0 2rem' }}> <AutoColumn gap="lg" style={{ padding: '0 2rem' }}>
...@@ -190,7 +187,7 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa ...@@ -190,7 +187,7 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
id="open-settings-dialog-button" id="open-settings-dialog-button"
aria-label={t`Transaction Settings`} aria-label={t`Transaction Settings`}
> >
<StyledMenuIcon redesignFlag={redesignFlagEnabled} /> <StyledMenuIcon />
{expertMode ? ( {expertMode ? (
<EmojiWrapper> <EmojiWrapper>
<span role="img" aria-label="wizard-icon"> <span role="img" aria-label="wizard-icon">
...@@ -200,10 +197,10 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa ...@@ -200,10 +197,10 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
) : null} ) : null}
</StyledMenuButton> </StyledMenuButton>
{open && ( {open && (
<MenuFlyout redesignFlag={redesignFlagEnabled}> <MenuFlyout>
<AutoColumn gap="md" style={{ padding: '1rem' }}> <AutoColumn gap="md" style={{ padding: '1rem' }}>
<Text fontWeight={600} fontSize={14}> <Text fontWeight={600} fontSize={14}>
<Trans>{redesignFlagEnabled ? 'Settings' : 'Transaction Settings'}</Trans> <Trans>Settings</Trans>
</Text> </Text>
<TransactionSettings placeholderSlippage={placeholderSlippage} /> <TransactionSettings placeholderSlippage={placeholderSlippage} />
<Text fontWeight={600} fontSize={14}> <Text fontWeight={600} fontSize={14}>
......
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import { darken } from 'polished' import { darken } from 'polished'
import { useState } from 'react' import { useState } from 'react'
import styled, { keyframes } from 'styled-components/macro' import styled, { keyframes } from 'styled-components/macro'
const Wrapper = styled.button<{ isActive?: boolean; activeElement?: boolean; redesignFlag: boolean }>` const Wrapper = styled.button<{ isActive?: boolean; activeElement?: boolean }>`
align-items: center; align-items: center;
background: ${({ isActive, theme, redesignFlag }) => background: ${({ isActive, theme }) => (isActive ? theme.accentActionSoft : 'transparent')};
redesignFlag && isActive border: ${({ theme, isActive }) => (isActive ? 'none' : `1px solid ${theme.backgroundOutline}`)};
? theme.accentActionSoft
: redesignFlag && !isActive
? 'transparent'
: theme.deprecated_bg1};
border: ${({ redesignFlag, theme, isActive }) =>
redesignFlag && !isActive ? `1px solid ${theme.backgroundOutline}` : 'none'};
border-radius: 20px; border-radius: 20px;
cursor: pointer; cursor: pointer;
display: flex; display: flex;
outline: none; outline: none;
padding: ${({ redesignFlag }) => (redesignFlag ? '4px' : '0.4rem 0.4rem')}; padding: 4px;
width: fit-content; width: fit-content;
` `
...@@ -64,8 +57,8 @@ const ToggleElement = styled.span<{ isActive?: boolean; bgColor?: string; isInit ...@@ -64,8 +57,8 @@ const ToggleElement = styled.span<{ isActive?: boolean; bgColor?: string; isInit
:hover { :hover {
${({ bgColor, theme, isActive }) => ToggleElementHoverStyle(!!bgColor, theme, isActive)} ${({ bgColor, theme, isActive }) => ToggleElementHoverStyle(!!bgColor, theme, isActive)}
} }
margin-left: ${({ isActive }) => (isActive ? '2.2em' : '0em')}; margin-left: ${({ isActive }) => isActive && '2.2em'};
margin-right: ${({ isActive }) => (!isActive ? '2.2em' : '0em')}; margin-right: ${({ isActive }) => !isActive && '2.2em'};
width: 24px; width: 24px;
` `
...@@ -78,8 +71,6 @@ interface ToggleProps { ...@@ -78,8 +71,6 @@ interface ToggleProps {
export default function Toggle({ id, bgColor, isActive, toggle }: ToggleProps) { export default function Toggle({ id, bgColor, isActive, toggle }: ToggleProps) {
const [isInitialToggleLoad, setIsInitialToggleLoad] = useState(true) const [isInitialToggleLoad, setIsInitialToggleLoad] = useState(true)
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
const switchToggle = () => { const switchToggle = () => {
toggle() toggle()
...@@ -87,7 +78,7 @@ export default function Toggle({ id, bgColor, isActive, toggle }: ToggleProps) { ...@@ -87,7 +78,7 @@ export default function Toggle({ id, bgColor, isActive, toggle }: ToggleProps) {
} }
return ( return (
<Wrapper id={id} isActive={isActive} onClick={switchToggle} redesignFlag={redesignFlagEnabled}> <Wrapper id={id} isActive={isActive} onClick={switchToggle}>
<ToggleElement isActive={isActive} bgColor={bgColor} isInitialToggleLoad={isInitialToggleLoad} /> <ToggleElement isActive={isActive} bgColor={bgColor} isInitialToggleLoad={isInitialToggleLoad} />
</Wrapper> </Wrapper>
) )
......
...@@ -4,7 +4,6 @@ import { useWeb3React } from '@web3-react/core' ...@@ -4,7 +4,6 @@ import { useWeb3React } from '@web3-react/core'
import Badge from 'components/Badge' import Badge from 'components/Badge'
import { getChainInfo } from 'constants/chainInfo' import { getChainInfo } from 'constants/chainInfo'
import { SupportedL2ChainId } from 'constants/chains' import { SupportedL2ChainId } from 'constants/chains'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import useCurrencyLogoURIs from 'lib/hooks/useCurrencyLogoURIs' import useCurrencyLogoURIs from 'lib/hooks/useCurrencyLogoURIs'
import { ReactNode, useCallback, useState } from 'react' import { ReactNode, useCallback, useState } from 'react'
import { AlertCircle, AlertTriangle, ArrowUpCircle, CheckCircle } from 'react-feather' import { AlertCircle, AlertTriangle, ArrowUpCircle, CheckCircle } from 'react-feather'
...@@ -24,9 +23,9 @@ import Modal from '../Modal' ...@@ -24,9 +23,9 @@ import Modal from '../Modal'
import { RowBetween, RowFixed } from '../Row' import { RowBetween, RowFixed } from '../Row'
import AnimatedConfirmation from './AnimatedConfirmation' import AnimatedConfirmation from './AnimatedConfirmation'
const Wrapper = styled.div<{ redesignFlag?: boolean }>` const Wrapper = styled.div`
background-color: ${({ redesignFlag, theme }) => redesignFlag && theme.backgroundSurface}; background-color: ${({ theme }) => theme.backgroundSurface};
outline: ${({ redesignFlag, theme }) => redesignFlag && `1px solid ${theme.backgroundOutline}`}; outline: ${({ theme }) => `1px solid ${theme.backgroundOutline}`};
width: 100%; width: 100%;
padding: 1rem; padding: 1rem;
` `
...@@ -59,11 +58,9 @@ function ConfirmationPendingContent({ ...@@ -59,11 +58,9 @@ function ConfirmationPendingContent({
pendingText: ReactNode pendingText: ReactNode
inline?: boolean // not in modal inline?: boolean // not in modal
}) { }) {
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
const theme = useTheme() const theme = useTheme()
return redesignFlagEnabled ? ( return (
<Wrapper> <Wrapper>
<AutoColumn gap="md"> <AutoColumn gap="md">
{!inline && ( {!inline && (
...@@ -88,31 +85,6 @@ function ConfirmationPendingContent({ ...@@ -88,31 +85,6 @@ function ConfirmationPendingContent({
</AutoColumn> </AutoColumn>
</AutoColumn> </AutoColumn>
</Wrapper> </Wrapper>
) : (
<Wrapper>
<AutoColumn gap="md">
{!inline && (
<RowBetween>
<div />
<CloseIcon onClick={onDismiss} />
</RowBetween>
)}
<ConfirmedIcon inline={inline}>
<CustomLightSpinner src={Circle} alt="loader" size={inline ? '40px' : '90px'} />
</ConfirmedIcon>
<AutoColumn gap="12px" justify={'center'}>
<Text fontWeight={500} fontSize={20} textAlign="center">
<Trans>Waiting For Confirmation</Trans>
</Text>
<Text fontWeight={400} fontSize={16} textAlign="center">
{pendingText}
</Text>
<Text fontWeight={500} fontSize={14} color="#565A69" textAlign="center" marginBottom="12px">
<Trans>Confirm this transaction in your wallet</Trans>
</Text>
</AutoColumn>
</AutoColumn>
</Wrapper>
) )
} }
function TransactionSubmittedContent({ function TransactionSubmittedContent({
...@@ -135,9 +107,6 @@ function TransactionSubmittedContent({ ...@@ -135,9 +107,6 @@ function TransactionSubmittedContent({
const token = currencyToAdd?.wrapped const token = currencyToAdd?.wrapped
const logoURL = useCurrencyLogoURIs(token)[0] const logoURL = useCurrencyLogoURIs(token)[0]
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
const [success, setSuccess] = useState<boolean | undefined>() const [success, setSuccess] = useState<boolean | undefined>()
const addToken = useCallback(() => { const addToken = useCallback(() => {
...@@ -153,7 +122,7 @@ function TransactionSubmittedContent({ ...@@ -153,7 +122,7 @@ function TransactionSubmittedContent({
.catch(() => setSuccess(false)) .catch(() => setSuccess(false))
}, [connector, logoURL, token]) }, [connector, logoURL, token])
return redesignFlagEnabled ? ( return (
<Wrapper> <Wrapper>
<Section inline={inline}> <Section inline={inline}>
{!inline && ( {!inline && (
...@@ -198,51 +167,6 @@ function TransactionSubmittedContent({ ...@@ -198,51 +167,6 @@ function TransactionSubmittedContent({
</AutoColumn> </AutoColumn>
</Section> </Section>
</Wrapper> </Wrapper>
) : (
<Wrapper>
<Section inline={inline}>
{!inline && (
<RowBetween>
<div />
<CloseIcon onClick={onDismiss} />
</RowBetween>
)}
<ConfirmedIcon inline={inline}>
<ArrowUpCircle strokeWidth={0.5} size={inline ? '40px' : '90px'} color={theme.deprecated_primary1} />
</ConfirmedIcon>
<AutoColumn gap="12px" justify={'center'}>
<Text fontWeight={500} fontSize={20} textAlign="center">
<Trans>Transaction Submitted</Trans>
</Text>
{chainId && hash && (
<ExternalLink href={getExplorerLink(chainId, hash, ExplorerDataType.TRANSACTION)}>
<Text fontWeight={500} fontSize={14} color={theme.deprecated_primary1}>
<Trans>View on Explorer</Trans>
</Text>
</ExternalLink>
)}
{currencyToAdd && connector.watchAsset && (
<ButtonLight mt="12px" padding="6px 12px" width="fit-content" onClick={addToken}>
{!success ? (
<RowFixed>
<Trans>Add {currencyToAdd.symbol}</Trans>
</RowFixed>
) : (
<RowFixed>
<Trans>Added {currencyToAdd.symbol} </Trans>
<CheckCircle size={'16px'} stroke={theme.deprecated_green1} style={{ marginLeft: '6px' }} />
</RowFixed>
)}
</ButtonLight>
)}
<ButtonPrimary onClick={onDismiss} style={{ margin: '20px 0 0 0' }}>
<Text fontWeight={500} fontSize={20}>
{inline ? <Trans>Return</Trans> : <Trans>Close</Trans>}
</Text>
</ButtonPrimary>
</AutoColumn>
</Section>
</Wrapper>
) )
} }
...@@ -274,50 +198,21 @@ export function ConfirmationModalContent({ ...@@ -274,50 +198,21 @@ export function ConfirmationModalContent({
} }
export function TransactionErrorContent({ message, onDismiss }: { message: ReactNode; onDismiss: () => void }) { export function TransactionErrorContent({ message, onDismiss }: { message: ReactNode; onDismiss: () => void }) {
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
const theme = useTheme() const theme = useTheme()
return redesignFlagEnabled ? ( return (
<Wrapper redesignFlag={true}> <Wrapper>
<Section> <Section>
<RowBetween> <RowBetween>
<Text fontWeight={600} fontSize={16}> <Text fontWeight={600} fontSize={16}>
<Trans>Error</Trans> <Trans>Error</Trans>
</Text> </Text>
<CloseIcon onClick={onDismiss} redesignFlag={true} /> <CloseIcon onClick={onDismiss} />
</RowBetween> </RowBetween>
<AutoColumn style={{ marginTop: 20, padding: '2rem 0' }} gap="24px" justify="center"> <AutoColumn style={{ marginTop: 20, padding: '2rem 0' }} gap="24px" justify="center">
<AlertTriangle color={theme.accentCritical} style={{ strokeWidth: 1 }} size={90} /> <AlertTriangle color={theme.accentCritical} style={{ strokeWidth: 1 }} size={90} />
<ThemedText.MediumHeader textAlign="center">{message}</ThemedText.MediumHeader> <ThemedText.MediumHeader textAlign="center">{message}</ThemedText.MediumHeader>
</AutoColumn> </AutoColumn>
</Section> </Section>
<BottomSection gap="12px">
<ButtonPrimary onClick={onDismiss} redesignFlag={true}>
<Trans>Dismiss</Trans>
</ButtonPrimary>
</BottomSection>
</Wrapper>
) : (
<Wrapper>
<Section>
<RowBetween>
<Text fontWeight={500} fontSize={20}>
<Trans>Error</Trans>
</Text>
<CloseIcon onClick={onDismiss} />
</RowBetween>
<AutoColumn style={{ marginTop: 20, padding: '2rem 0' }} gap="24px" justify="center">
<AlertTriangle color={theme.deprecated_red1} style={{ strokeWidth: 1.5 }} size={64} />
<Text
fontWeight={500}
fontSize={16}
color={theme.deprecated_red1}
style={{ textAlign: 'center', width: '85%', wordBreak: 'break-word' }}
>
{message}
</Text>
</AutoColumn>
</Section>
<BottomSection gap="12px"> <BottomSection gap="12px">
<ButtonPrimary onClick={onDismiss}> <ButtonPrimary onClick={onDismiss}>
<Trans>Dismiss</Trans> <Trans>Dismiss</Trans>
...@@ -447,14 +342,12 @@ export default function TransactionConfirmationModal({ ...@@ -447,14 +342,12 @@ export default function TransactionConfirmationModal({
currencyToAdd, currencyToAdd,
}: ConfirmationModalProps) { }: ConfirmationModalProps) {
const { chainId } = useWeb3React() const { chainId } = useWeb3React()
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
if (!chainId) return null if (!chainId) return null
// confirmation screen // confirmation screen
return ( return (
<Modal isOpen={isOpen} scrollOverlay={true} onDismiss={onDismiss} maxHeight={90} redesignFlag={redesignFlagEnabled}> <Modal isOpen={isOpen} scrollOverlay={true} onDismiss={onDismiss} maxHeight={90}>
{isL2ChainId(chainId) && (hash || attemptingTxn) ? ( {isL2ChainId(chainId) && (hash || attemptingTxn) ? (
<L2Content chainId={chainId} hash={hash} onDismiss={onDismiss} pendingText={pendingText} /> <L2Content chainId={chainId} hash={hash} onDismiss={onDismiss} pendingText={pendingText} />
) : attemptingTxn ? ( ) : attemptingTxn ? (
......
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { Connector } from '@web3-react/types' import { Connector } from '@web3-react/types'
import { ButtonEmpty, ButtonPrimary } from 'components/Button' import { ButtonEmpty, ButtonPrimary } from 'components/Button'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import { AlertTriangle } from 'react-feather' import { AlertTriangle } from 'react-feather'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { ThemedText } from 'theme' import { ThemedText } from 'theme'
...@@ -74,10 +73,7 @@ export default function PendingView({ ...@@ -74,10 +73,7 @@ export default function PendingView({
tryActivation: (connector: Connector) => void tryActivation: (connector: Connector) => void
openOptions: () => void openOptions: () => void
}) { }) {
const redesignFlag = useRedesignFlag() return (
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
return redesignFlagEnabled ? (
<PendingSection> <PendingSection>
<LoadingMessage> <LoadingMessage>
<LoadingWrapper> <LoadingWrapper>
...@@ -94,7 +90,6 @@ export default function PendingView({ ...@@ -94,7 +90,6 @@ export default function PendingView({
</ThemedText.BodyPrimary> </ThemedText.BodyPrimary>
<ButtonPrimary <ButtonPrimary
$borderRadius="12px" $borderRadius="12px"
redesignFlag={true}
onClick={() => { onClick={() => {
tryActivation(connector) tryActivation(connector)
}} }}
...@@ -111,7 +106,7 @@ export default function PendingView({ ...@@ -111,7 +106,7 @@ export default function PendingView({
<> <>
<WaitingToConnectSection> <WaitingToConnectSection>
<LoaderContainer style={{ padding: '16px 0px' }}> <LoaderContainer style={{ padding: '16px 0px' }}>
<Loader redesignFlag={true} strokeWidth={0.8} size="100px" /> <Loader strokeWidth={0.8} size="100px" />
</LoaderContainer> </LoaderContainer>
<ThemedText.MediumHeader> <ThemedText.MediumHeader>
<Trans>Waiting to connect</Trans> <Trans>Waiting to connect</Trans>
...@@ -125,47 +120,5 @@ export default function PendingView({ ...@@ -125,47 +120,5 @@ export default function PendingView({
</LoadingWrapper> </LoadingWrapper>
</LoadingMessage> </LoadingMessage>
</PendingSection> </PendingSection>
) : (
<PendingSection>
<LoadingMessage>
<LoadingWrapper>
{error ? (
<ErrorGroup>
<ThemedText.DeprecatedMediumHeader marginBottom={12}>
<Trans>Error connecting</Trans>
</ThemedText.DeprecatedMediumHeader>
<ThemedText.DeprecatedBody fontSize={14} marginBottom={36} textAlign="center">
<Trans>
The connection attempt failed. Please click try again and follow the steps to connect in your wallet.
</Trans>
</ThemedText.DeprecatedBody>
<ButtonPrimary
$borderRadius="12px"
padding="12px"
onClick={() => {
tryActivation(connector)
}}
>
<Trans>Try Again</Trans>
</ButtonPrimary>
<ButtonEmpty width="fit-content" padding="0" marginTop={20}>
<ThemedText.DeprecatedLink fontSize={12} onClick={openOptions}>
<Trans>Back to wallet selection</Trans>
</ThemedText.DeprecatedLink>
</ButtonEmpty>
</ErrorGroup>
) : (
<>
<ThemedText.DeprecatedBlack fontSize={20} marginY={16}>
<LoaderContainer>
<Loader stroke="currentColor" size="32px" />
</LoaderContainer>
<Trans>Connecting...</Trans>
</ThemedText.DeprecatedBlack>
</>
)}
</LoadingWrapper>
</LoadingMessage>
</PendingSection>
) )
} }
import { BaseVariant } from '../index'
export function useRedesignFlag(): BaseVariant {
return BaseVariant.Enabled
}
export { BaseVariant as RedesignVariant }
...@@ -8,7 +8,6 @@ import { ElementName, Event, EventName } from 'analytics/constants' ...@@ -8,7 +8,6 @@ import { ElementName, Event, EventName } from 'analytics/constants'
import { TraceEvent } from 'analytics/TraceEvent' import { TraceEvent } from 'analytics/TraceEvent'
import { sendEvent } from 'components/analytics' import { sendEvent } from 'components/analytics'
import UnsupportedCurrencyFooter from 'components/swap/UnsupportedCurrencyFooter' import UnsupportedCurrencyFooter from 'components/swap/UnsupportedCurrencyFooter'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import useParsedQueryString from 'hooks/useParsedQueryString' import useParsedQueryString from 'hooks/useParsedQueryString'
import { useCallback, useEffect, useState } from 'react' import { useCallback, useEffect, useState } from 'react'
import { AlertTriangle } from 'react-feather' import { AlertTriangle } from 'react-feather'
...@@ -88,8 +87,6 @@ export default function AddLiquidity() { ...@@ -88,8 +87,6 @@ export default function AddLiquidity() {
} = useParams<{ currencyIdA?: string; currencyIdB?: string; feeAmount?: string; tokenId?: string }>() } = useParams<{ currencyIdA?: string; currencyIdB?: string; feeAmount?: string; tokenId?: string }>()
const { account, chainId, provider } = useWeb3React() const { account, chainId, provider } = useWeb3React()
const theme = useTheme() const theme = useTheme()
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
const toggleWalletModal = useToggleWalletModal() // toggle wallet when disconnected const toggleWalletModal = useToggleWalletModal() // toggle wallet when disconnected
const expertMode = useIsExpertMode() const expertMode = useIsExpertMode()
...@@ -881,7 +878,6 @@ export default function AddLiquidity() { ...@@ -881,7 +878,6 @@ export default function AddLiquidity() {
marginRight="8px" marginRight="8px"
$borderRadius="8px" $borderRadius="8px"
width="auto" width="auto"
redesignFlag={redesignFlagEnabled}
onClick={() => { onClick={() => {
setShowCapitalEfficiencyWarning(false) setShowCapitalEfficiencyWarning(false)
getSetFullRange() getSetFullRange()
......
...@@ -5,7 +5,6 @@ import Loader from 'components/Loader' ...@@ -5,7 +5,6 @@ import Loader from 'components/Loader'
import TopLevelModals from 'components/TopLevelModals' import TopLevelModals from 'components/TopLevelModals'
import { useFeatureFlagsIsLoaded } from 'featureFlags' import { useFeatureFlagsIsLoaded } from 'featureFlags'
import { NftVariant, useNftFlag } from 'featureFlags/flags/nft' import { NftVariant, useNftFlag } from 'featureFlags/flags/nft'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import ApeModeQueryParamReader from 'hooks/useApeModeQueryParamReader' import ApeModeQueryParamReader from 'hooks/useApeModeQueryParamReader'
import { lazy, Suspense, useEffect } from 'react' import { lazy, Suspense, useEffect } from 'react'
import { Navigate, Route, Routes, useLocation } from 'react-router-dom' import { Navigate, Route, Routes, useLocation } from 'react-router-dom'
...@@ -48,12 +47,10 @@ const Collection = lazy(() => import('nft/pages/collection')) ...@@ -48,12 +47,10 @@ const Collection = lazy(() => import('nft/pages/collection'))
const Profile = lazy(() => import('nft/pages/profile/profile')) const Profile = lazy(() => import('nft/pages/profile/profile'))
const Asset = lazy(() => import('nft/pages/asset/Asset')) const Asset = lazy(() => import('nft/pages/asset/Asset'))
const AppWrapper = styled.div<{ redesignFlagEnabled: boolean }>` const AppWrapper = styled.div`
display: flex; display: flex;
flex-flow: column; flex-flow: column;
align-items: flex-start; align-items: flex-start;
font-feature-settings: ${({ redesignFlagEnabled }) =>
redesignFlagEnabled ? undefined : "'ss01' on, 'ss02' on, 'cv01' on, 'cv03' on"};
` `
const BodyWrapper = styled.div` const BodyWrapper = styled.div`
...@@ -113,7 +110,6 @@ const LazyLoadSpinner = () => ( ...@@ -113,7 +110,6 @@ const LazyLoadSpinner = () => (
export default function App() { export default function App() {
const isLoaded = useFeatureFlagsIsLoaded() const isLoaded = useFeatureFlagsIsLoaded()
const nftFlag = useNftFlag() const nftFlag = useNftFlag()
const redesignFlagEnabled = useRedesignFlag() === RedesignVariant.Enabled
const { pathname } = useLocation() const { pathname } = useLocation()
const currentPage = getCurrentPageFromLocation(pathname) const currentPage = getCurrentPageFromLocation(pathname)
...@@ -151,7 +147,7 @@ export default function App() { ...@@ -151,7 +147,7 @@ export default function App() {
<ErrorBoundary> <ErrorBoundary>
<DarkModeQueryParamReader /> <DarkModeQueryParamReader />
<ApeModeQueryParamReader /> <ApeModeQueryParamReader />
<AppWrapper redesignFlagEnabled={redesignFlagEnabled}> <AppWrapper>
<Trace page={currentPage}> <Trace page={currentPage}>
<HeaderWrapper> <HeaderWrapper>
<NavBar /> <NavBar />
......
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import React from 'react' import React from 'react'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { Z_INDEX } from 'theme/zIndex' import { Z_INDEX } from 'theme/zIndex'
export const BodyWrapper = styled.main<{ margin?: string; maxWidth?: string; redesignFlag?: boolean }>` export const BodyWrapper = styled.main<{ margin?: string; maxWidth?: string }>`
position: relative; position: relative;
margin-top: ${({ margin }) => margin ?? '0px'}; margin-top: ${({ margin }) => margin ?? '0px'};
max-width: ${({ maxWidth, redesignFlag }) => maxWidth ?? (redesignFlag ? '420px' : '480px')}; max-width: ${({ maxWidth }) => maxWidth ?? '420px'};
width: 100%; width: 100%;
background: ${({ theme, redesignFlag }) => (redesignFlag ? theme.backgroundSurface : theme.deprecated_bg0)}; background: ${({ theme }) => theme.backgroundSurface};
border-radius: ${({ redesignFlag }) => (redesignFlag ? '16px' : '24px')}; border-radius: 16px;
border: 1px solid ${({ theme, redesignFlag }) => (redesignFlag ? theme.backgroundOutline : 'transparent')}; border: 1px solid ${({ theme }) => theme.backgroundOutline};
margin-top: 1rem; margin-top: 1rem;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
z-index: ${Z_INDEX.deprecated_content}; z-index: ${Z_INDEX.deprecated_content};
font-feature-settings: ${({ redesignFlag }) => font-feature-settings: 'ss01' on, 'ss02' on, 'cv01' on, 'cv03' on;
redesignFlag ? "'ss01' on, 'ss02' on, 'cv01' on, 'cv03' on" : "'ss01' on, 'ss02' on, 'cv01' on, 'cv03' on"};
box-shadow: ${({ redesignFlag }) =>
!redesignFlag &&
'0px 0px 1px rgba(0, 0, 0, 0.01), 0px 4px 8px rgba(0, 0, 0, 0.04), 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 24px 32px rgba(0, 0, 0, 0.01)'};
` `
/** /**
* The styled container element that wraps the content of most pages and the tabs. * The styled container element that wraps the content of most pages and the tabs.
*/ */
export default function AppBody({ children, ...rest }: { children: React.ReactNode }) { export default function AppBody({ children, ...rest }: { children: React.ReactNode }) {
const redesignFlag = useRedesignFlag() return <BodyWrapper {...rest}>{children}</BodyWrapper>
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
return (
<BodyWrapper {...rest} redesignFlag={redesignFlagEnabled}>
{children}
</BodyWrapper>
)
} }
...@@ -22,8 +22,8 @@ import { Color } from './styled' ...@@ -22,8 +22,8 @@ import { Color } from './styled'
// TODO: Break this file into a components folder // TODO: Break this file into a components folder
export const CloseIcon = styled(X)<{ onClick: () => void; redesignFlag?: boolean }>` export const CloseIcon = styled(X)<{ onClick: () => void }>`
color: ${({ redesignFlag, theme }) => redesignFlag && theme.textSecondary}; color: ${({ theme }) => theme.textSecondary};
cursor: pointer; cursor: pointer;
` `
...@@ -461,8 +461,8 @@ export const SmallOnly = styled.span` ...@@ -461,8 +461,8 @@ export const SmallOnly = styled.span`
`}; `};
` `
export const Separator = styled.div<{ redesignFlag?: boolean }>` export const Separator = styled.div`
width: 100%; width: 100%;
height: 1px; height: 1px;
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.backgroundOutline : theme.deprecated_bg2)}; background-color: ${({ theme }) => theme.backgroundOutline};
` `
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