Commit c7ea77d2 authored by vignesh mohankumar's avatar vignesh mohankumar Committed by GitHub

chore: rm redesign flags from CurrencyInputPanel (#4966)

* chore: remove flags from CurrencyInputPanel

* one more rm

* unused

* unused
parent 00d67437
...@@ -2,7 +2,6 @@ import { Trans } from '@lingui/macro' ...@@ -2,7 +2,6 @@ import { Trans } from '@lingui/macro'
// eslint-disable-next-line no-restricted-imports // eslint-disable-next-line no-restricted-imports
import { t } from '@lingui/macro' import { t } from '@lingui/macro'
import { Currency, CurrencyAmount, Percent } from '@uniswap/sdk-core' import { Currency, CurrencyAmount, Percent } from '@uniswap/sdk-core'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import { useMemo } from 'react' import { useMemo } from 'react'
import { useTheme } from 'styled-components/macro' import { useTheme } from 'styled-components/macro'
...@@ -18,7 +17,6 @@ export function FiatValue({ ...@@ -18,7 +17,6 @@ export function FiatValue({
priceImpact?: Percent priceImpact?: Percent
}) { }) {
const theme = useTheme() const theme = useTheme()
const redesignFlagEnabled = useRedesignFlag() === RedesignVariant.Enabled
const priceImpactColor = useMemo(() => { const priceImpactColor = useMemo(() => {
if (!priceImpact) return undefined if (!priceImpact) return undefined
if (priceImpact.lessThan('0')) return theme.deprecated_green1 if (priceImpact.lessThan('0')) return theme.deprecated_green1
...@@ -31,14 +29,8 @@ export function FiatValue({ ...@@ -31,14 +29,8 @@ export function FiatValue({
const p = Number(fiatValue?.toFixed()) const p = Number(fiatValue?.toFixed())
const visibleDecimalPlaces = p < 1.05 ? 4 : 2 const visibleDecimalPlaces = p < 1.05 ? 4 : 2
const textColor = redesignFlagEnabled
? theme.textSecondary
: fiatValue
? theme.deprecated_text3
: theme.deprecated_text4
return ( return (
<ThemedText.DeprecatedBody fontSize={14} color={textColor}> <ThemedText.DeprecatedBody fontSize={14} color={theme.textSecondary}>
{fiatValue && <>${fiatValue?.toFixed(visibleDecimalPlaces, { groupSeparator: ',' })}</>} {fiatValue && <>${fiatValue?.toFixed(visibleDecimalPlaces, { groupSeparator: ',' })}</>}
{priceImpact ? ( {priceImpact ? (
<span style={{ color: priceImpactColor }}> <span style={{ color: priceImpactColor }}>
......
...@@ -7,11 +7,10 @@ import { TraceEvent } from 'analytics/TraceEvent' ...@@ -7,11 +7,10 @@ import { TraceEvent } from 'analytics/TraceEvent'
import { AutoColumn } from 'components/Column' import { AutoColumn } from 'components/Column'
import { LoadingOpacityContainer, loadingOpacityMixin } from 'components/Loader/styled' import { LoadingOpacityContainer, loadingOpacityMixin } from 'components/Loader/styled'
import { isSupportedChain } from 'constants/chains' import { isSupportedChain } from 'constants/chains'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import { darken } from 'polished' import { darken } from 'polished'
import { ReactNode, useCallback, useState } from 'react' import { ReactNode, useCallback, useState } from 'react'
import { Lock } from 'react-feather' import { Lock } from 'react-feather'
import styled, { css, useTheme } from 'styled-components/macro' import styled, { useTheme } from 'styled-components/macro'
import { formatCurrencyAmount } from 'utils/formatCurrencyAmount' import { formatCurrencyAmount } from 'utils/formatCurrencyAmount'
import { ReactComponent as DropDown } from '../../assets/images/dropdown.svg' import { ReactComponent as DropDown } from '../../assets/images/dropdown.svg'
...@@ -25,45 +24,31 @@ import { RowBetween, RowFixed } from '../Row' ...@@ -25,45 +24,31 @@ import { RowBetween, RowFixed } from '../Row'
import CurrencySearchModal from '../SearchModal/CurrencySearchModal' import CurrencySearchModal from '../SearchModal/CurrencySearchModal'
import { FiatValue } from './FiatValue' import { FiatValue } from './FiatValue'
const InputPanel = styled.div<{ hideInput?: boolean; redesignFlag: boolean }>` const InputPanel = styled.div<{ hideInput?: boolean }>`
${({ theme }) => theme.flexColumnNoWrap} ${({ theme }) => theme.flexColumnNoWrap}
position: relative; position: relative;
border-radius: ${({ hideInput }) => (hideInput ? '16px' : '20px')}; border-radius: ${({ hideInput }) => (hideInput ? '16px' : '20px')};
background-color: ${({ theme, redesignFlag, hideInput }) =>
redesignFlag ? 'transparent' : hideInput ? 'transparent' : theme.deprecated_bg2};
z-index: 1; z-index: 1;
width: ${({ hideInput }) => (hideInput ? '100%' : 'initial')}; width: ${({ hideInput }) => (hideInput ? '100%' : 'initial')};
transition: height 1s ease; transition: height 1s ease;
will-change: height; will-change: height;
` `
const FixedContainer = styled.div<{ redesignFlag: boolean }>` const FixedContainer = styled.div`
width: 100%; width: 100%;
height: 100%; height: 100%;
position: absolute; position: absolute;
border-radius: 20px; border-radius: 20px;
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? 'transparent' : theme.deprecated_bg2)};
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
z-index: 2; z-index: 2;
` `
const Container = styled.div<{ hideInput: boolean; disabled: boolean; redesignFlag: boolean }>` const Container = styled.div<{ hideInput: boolean }>`
min-height: ${({ redesignFlag }) => redesignFlag && '44px'}; min-height: 44px;
border-radius: ${({ hideInput }) => (hideInput ? '16px' : '20px')}; border-radius: ${({ hideInput }) => (hideInput ? '16px' : '20px')};
border: 1px solid ${({ theme, redesignFlag }) => (redesignFlag ? 'transparent' : theme.deprecated_bg0)};
background-color: ${({ theme, redesignFlag }) => (redesignFlag ? 'transparent' : theme.deprecated_bg1)};
width: ${({ hideInput }) => (hideInput ? '100%' : 'initial')}; width: ${({ hideInput }) => (hideInput ? '100%' : 'initial')};
${({ theme, hideInput, disabled, redesignFlag }) =>
!redesignFlag &&
!disabled &&
`
:focus,
:hover {
border: 1px solid ${hideInput ? ' transparent' : theme.deprecated_bg3};
}
`}
` `
const CurrencySelect = styled(ButtonGray)<{ const CurrencySelect = styled(ButtonGray)<{
...@@ -71,22 +56,14 @@ const CurrencySelect = styled(ButtonGray)<{ ...@@ -71,22 +56,14 @@ const CurrencySelect = styled(ButtonGray)<{
selected: boolean selected: boolean
hideInput?: boolean hideInput?: boolean
disabled?: boolean disabled?: boolean
redesignFlag: boolean
}>` }>`
align-items: center; align-items: center;
background-color: ${({ selected, theme, redesignFlag }) => background-color: ${({ selected, theme }) => (selected ? theme.backgroundInteractive : theme.accentAction)};
redesignFlag
? selected
? theme.backgroundInteractive
: theme.accentAction
: selected
? theme.deprecated_bg2
: theme.deprecated_primary1};
opacity: ${({ disabled }) => (!disabled ? 1 : 0.4)}; opacity: ${({ disabled }) => (!disabled ? 1 : 0.4)};
box-shadow: ${({ selected }) => (selected ? 'none' : '0px 6px 10px rgba(0, 0, 0, 0.075)')}; box-shadow: ${({ selected }) => (selected ? 'none' : '0px 6px 10px rgba(0, 0, 0, 0.075)')};
color: ${({ selected, theme }) => (selected ? theme.deprecated_text1 : theme.deprecated_white)}; color: ${({ selected, theme }) => (selected ? theme.deprecated_text1 : theme.deprecated_white)};
cursor: pointer; cursor: pointer;
height: ${({ hideInput, redesignFlag }) => (redesignFlag ? 'unset' : hideInput ? '2.8rem' : '2.4rem')}; height: unset;
border-radius: 16px; border-radius: 16px;
outline: none; outline: none;
user-select: none; user-select: none;
...@@ -94,72 +71,52 @@ const CurrencySelect = styled(ButtonGray)<{ ...@@ -94,72 +71,52 @@ const CurrencySelect = styled(ButtonGray)<{
font-size: 24px; font-size: 24px;
font-weight: 400; font-weight: 400;
width: ${({ hideInput }) => (hideInput ? '100%' : 'initial')}; width: ${({ hideInput }) => (hideInput ? '100%' : 'initial')};
padding: ${({ selected, redesignFlag }) => padding: ${({ selected }) => (selected ? '4px 8px 4px 4px' : '6px 6px 6px 8px')};
redesignFlag ? (selected ? '4px 8px 4px 4px' : '6px 6px 6px 8px') : '0 8px'}; gap: 8px;
gap: ${({ redesignFlag }) => (redesignFlag ? '8px' : '0px')};
justify-content: space-between; justify-content: space-between;
margin-left: ${({ hideInput }) => (hideInput ? '0' : '12px')}; margin-left: ${({ hideInput }) => (hideInput ? '0' : '12px')};
${({ redesignFlag, selected }) => &:hover,
!redesignFlag && &:active {
css` background-color: ${({ theme, selected }) => (selected ? theme.backgroundInteractive : theme.accentAction)};
&:hover { }
background-color: ${({ theme }) => (selected ? theme.deprecated_bg3 : darken(0.05, theme.deprecated_primary1))};
}
&:active {
background-color: ${({ theme }) => (selected ? theme.deprecated_bg3 : darken(0.05, theme.deprecated_primary1))};
}
`}
${({ redesignFlag, selected }) =>
redesignFlag &&
css`
&:hover,
&:active {
background-color: ${({ theme }) => (selected ? theme.backgroundInteractive : theme.accentAction)};
}
&:before { &:before {
background-size: 100%; background-size: 100%;
border-radius: inherit; border-radius: inherit;
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
content: ''; content: '';
} }
&:hover:before { &:hover:before {
background-color: ${({ theme }) => theme.stateOverlayHover}; background-color: ${({ theme }) => theme.stateOverlayHover};
} }
&:active:before { &:active:before {
background-color: ${({ theme }) => theme.stateOverlayPressed}; background-color: ${({ theme }) => theme.stateOverlayPressed};
} }
`}
visibility: ${({ visible }) => (visible ? 'visible' : 'hidden')}; visibility: ${({ visible }) => (visible ? 'visible' : 'hidden')};
` `
const InputRow = styled.div<{ selected: boolean; redesignFlag: boolean }>` const InputRow = styled.div`
${({ theme }) => theme.flexRowNoWrap} ${({ theme }) => theme.flexRowNoWrap}
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
padding: ${({ selected, redesignFlag }) =>
redesignFlag ? '0px' : selected ? ' 1rem 1rem 0.75rem 1rem' : '1rem 1rem 1rem 1rem'};
` `
const LabelRow = styled.div<{ redesignFlag: boolean }>` const LabelRow = styled.div`
${({ theme }) => theme.flexRowNoWrap} ${({ theme }) => theme.flexRowNoWrap}
align-items: center; align-items: center;
color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.textSecondary : theme.deprecated_text1)}; color: ${({ theme }) => theme.textSecondary};
font-size: 0.75rem; font-size: 0.75rem;
line-height: 1rem; line-height: 1rem;
padding: ${({ redesignFlag }) => (redesignFlag ? '0px' : '0 1rem 1rem')};
span:hover { span:hover {
cursor: pointer; cursor: pointer;
...@@ -167,11 +124,10 @@ const LabelRow = styled.div<{ redesignFlag: boolean }>` ...@@ -167,11 +124,10 @@ const LabelRow = styled.div<{ redesignFlag: boolean }>`
} }
` `
const FiatRow = styled(LabelRow)<{ redesignFlag: boolean }>` const FiatRow = styled(LabelRow)`
justify-content: flex-end; justify-content: flex-end;
min-height: ${({ redesignFlag }) => redesignFlag && '20px'}; min-height: 20px;
padding: ${({ redesignFlag }) => redesignFlag && '8px 0px 0px 0px'}; padding: 8px 0px 0px 0px;
height: ${({ redesignFlag }) => !redesignFlag && '24px'};
` `
const Aligner = styled.span` const Aligner = styled.span`
...@@ -181,34 +137,30 @@ const Aligner = styled.span` ...@@ -181,34 +137,30 @@ const Aligner = styled.span`
width: 100%; width: 100%;
` `
const StyledDropDown = styled(DropDown)<{ selected: boolean; redesignFlag: boolean }>` const StyledDropDown = styled(DropDown)<{ selected: boolean }>`
margin: 0 0.25rem 0 0.35rem; margin: 0 0.25rem 0 0.35rem;
height: 35%; height: 35%;
margin-left: ${({ redesignFlag }) => redesignFlag && '8px'}; margin-left: 8px;
path { path {
stroke: ${({ selected, theme }) => (selected ? theme.deprecated_text1 : theme.deprecated_white)}; stroke: ${({ selected, theme }) => (selected ? theme.deprecated_text1 : theme.deprecated_white)};
stroke-width: ${({ redesignFlag }) => (redesignFlag ? '2px' : '1.5px')}; stroke-width: 2px;
} }
` `
const StyledTokenName = styled.span<{ active?: boolean; redesignFlag: boolean }>` const StyledTokenName = styled.span<{ active?: boolean }>`
${({ active }) => (active ? ' margin: 0 0.25rem 0 0.25rem;' : ' margin: 0 0.25rem 0 0.25rem;')} ${({ active }) => (active ? ' margin: 0 0.25rem 0 0.25rem;' : ' margin: 0 0.25rem 0 0.25rem;')}
font-size: ${({ redesignFlag }) => (redesignFlag ? '20px' : '18px')}; font-size: 20px;
font-weight: ${({ redesignFlag }) => (redesignFlag ? '600' : '500')}; font-weight: 600;
` `
const StyledBalanceMax = styled.button<{ disabled?: boolean; redesignFlag: boolean }>` const StyledBalanceMax = styled.button<{ disabled?: boolean }>`
background-color: transparent; background-color: transparent;
background-color: ${({ theme, redesignFlag }) => !redesignFlag && theme.deprecated_primary5};
border: none; border: none;
text-transform: ${({ redesignFlag }) => !redesignFlag && 'uppercase'}; color: ${({ theme }) => theme.accentAction};
border-radius: ${({ redesignFlag }) => !redesignFlag && '12px'};
color: ${({ theme, redesignFlag }) => (redesignFlag ? theme.accentAction : theme.deprecated_primary1)};
cursor: pointer; cursor: pointer;
font-size: ${({ redesignFlag }) => (redesignFlag ? '14px' : '11px')}; font-size: 14px;
font-weight: ${({ redesignFlag }) => (redesignFlag ? '600' : '500')}; font-weight: 600;
margin-left: ${({ redesignFlag }) => (redesignFlag ? '0px' : '0.25rem')};
opacity: ${({ disabled }) => (!disabled ? 1 : 0.4)}; opacity: ${({ disabled }) => (!disabled ? 1 : 0.4)};
padding: 4px 6px; padding: 4px 6px;
pointer-events: ${({ disabled }) => (!disabled ? 'initial' : 'none')}; pointer-events: ${({ disabled }) => (!disabled ? 'initial' : 'none')};
...@@ -222,12 +174,12 @@ const StyledBalanceMax = styled.button<{ disabled?: boolean; redesignFlag: boole ...@@ -222,12 +174,12 @@ const StyledBalanceMax = styled.button<{ disabled?: boolean; redesignFlag: boole
} }
` `
const StyledNumericalInput = styled(NumericalInput)<{ $loading: boolean; redesignFlag: boolean }>` const StyledNumericalInput = styled(NumericalInput)<{ $loading: boolean }>`
${loadingOpacityMixin}; ${loadingOpacityMixin};
text-align: left; text-align: left;
font-size: ${({ redesignFlag }) => redesignFlag && '36px'}; font-size: 36px;
line-height: ${({ redesignFlag }) => redesignFlag && '44px'}; line-height: 44px;
font-variant: ${({ redesignFlag }) => redesignFlag && 'small-caps'}; font-variant: small-caps;
` `
interface SwapCurrencyInputPanelProps { interface SwapCurrencyInputPanelProps {
...@@ -277,8 +229,6 @@ export default function SwapCurrencyInputPanel({ ...@@ -277,8 +229,6 @@ export default function SwapCurrencyInputPanel({
}: SwapCurrencyInputPanelProps) { }: SwapCurrencyInputPanelProps) {
const [modalOpen, setModalOpen] = useState(false) const [modalOpen, setModalOpen] = useState(false)
const { account, chainId } = useWeb3React() const { account, chainId } = useWeb3React()
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
const selectedCurrencyBalance = useCurrencyBalance(account ?? undefined, currency ?? undefined) const selectedCurrencyBalance = useCurrencyBalance(account ?? undefined, currency ?? undefined)
const theme = useTheme() const theme = useTheme()
...@@ -289,9 +239,9 @@ export default function SwapCurrencyInputPanel({ ...@@ -289,9 +239,9 @@ export default function SwapCurrencyInputPanel({
const chainAllowed = isSupportedChain(chainId) const chainAllowed = isSupportedChain(chainId)
return ( return (
<InputPanel id={id} hideInput={hideInput} {...rest} redesignFlag={redesignFlagEnabled}> <InputPanel id={id} hideInput={hideInput} {...rest}>
{locked && ( {locked && (
<FixedContainer redesignFlag={redesignFlagEnabled}> <FixedContainer>
<AutoColumn gap="sm" justify="center"> <AutoColumn gap="sm" justify="center">
<Lock /> <Lock />
<ThemedText.DeprecatedLabel fontSize="12px" textAlign="center" padding="0 12px"> <ThemedText.DeprecatedLabel fontSize="12px" textAlign="center" padding="0 12px">
...@@ -300,12 +250,8 @@ export default function SwapCurrencyInputPanel({ ...@@ -300,12 +250,8 @@ export default function SwapCurrencyInputPanel({
</AutoColumn> </AutoColumn>
</FixedContainer> </FixedContainer>
)} )}
<Container hideInput={hideInput} disabled={!chainAllowed} redesignFlag={redesignFlagEnabled}> <Container hideInput={hideInput}>
<InputRow <InputRow style={hideInput ? { padding: '0', borderRadius: '8px' } : {}}>
style={hideInput ? { padding: '0', borderRadius: '8px' } : {}}
selected={!onCurrencySelect}
redesignFlag={redesignFlagEnabled}
>
{!hideInput && ( {!hideInput && (
<StyledNumericalInput <StyledNumericalInput
className="token-amount-input" className="token-amount-input"
...@@ -313,7 +259,6 @@ export default function SwapCurrencyInputPanel({ ...@@ -313,7 +259,6 @@ export default function SwapCurrencyInputPanel({
onUserInput={onUserInput} onUserInput={onUserInput}
disabled={!chainAllowed} disabled={!chainAllowed}
$loading={loading} $loading={loading}
redesignFlag={redesignFlagEnabled}
/> />
)} )}
...@@ -322,7 +267,6 @@ export default function SwapCurrencyInputPanel({ ...@@ -322,7 +267,6 @@ export default function SwapCurrencyInputPanel({
visible={currency !== undefined} visible={currency !== undefined}
selected={!!currency} selected={!!currency}
hideInput={hideInput} hideInput={hideInput}
redesignFlag={redesignFlagEnabled}
className="open-currency-select-button" className="open-currency-select-button"
onClick={() => { onClick={() => {
if (onCurrencySelect) { if (onCurrencySelect) {
...@@ -340,15 +284,11 @@ export default function SwapCurrencyInputPanel({ ...@@ -340,15 +284,11 @@ export default function SwapCurrencyInputPanel({
<CurrencyLogo style={{ marginRight: '2px' }} currency={currency} size={'24px'} /> <CurrencyLogo style={{ marginRight: '2px' }} currency={currency} size={'24px'} />
) : null} ) : null}
{pair ? ( {pair ? (
<StyledTokenName className="pair-name-container" redesignFlag={redesignFlagEnabled}> <StyledTokenName className="pair-name-container">
{pair?.token0.symbol}:{pair?.token1.symbol} {pair?.token0.symbol}:{pair?.token1.symbol}
</StyledTokenName> </StyledTokenName>
) : ( ) : (
<StyledTokenName <StyledTokenName className="token-symbol-container" active={Boolean(currency && currency.symbol)}>
className="token-symbol-container"
active={Boolean(currency && currency.symbol)}
redesignFlag={redesignFlagEnabled}
>
{(currency && currency.symbol && currency.symbol.length > 20 {(currency && currency.symbol && currency.symbol.length > 20
? currency.symbol.slice(0, 4) + ? currency.symbol.slice(0, 4) +
'...' + '...' +
...@@ -357,12 +297,12 @@ export default function SwapCurrencyInputPanel({ ...@@ -357,12 +297,12 @@ export default function SwapCurrencyInputPanel({
</StyledTokenName> </StyledTokenName>
)} )}
</RowFixed> </RowFixed>
{onCurrencySelect && <StyledDropDown selected={!!currency} redesignFlag={redesignFlagEnabled} />} {onCurrencySelect && <StyledDropDown selected={!!currency} />}
</Aligner> </Aligner>
</CurrencySelect> </CurrencySelect>
</InputRow> </InputRow>
{!hideInput && !hideBalance && currency && ( {!hideInput && !hideBalance && currency && (
<FiatRow redesignFlag={redesignFlagEnabled}> <FiatRow>
<RowBetween> <RowBetween>
<LoadingOpacityContainer $loading={loading}> <LoadingOpacityContainer $loading={loading}>
<FiatValue fiatValue={fiatValue} priceImpact={priceImpact} /> <FiatValue fiatValue={fiatValue} priceImpact={priceImpact} />
...@@ -370,8 +310,8 @@ export default function SwapCurrencyInputPanel({ ...@@ -370,8 +310,8 @@ export default function SwapCurrencyInputPanel({
{account ? ( {account ? (
<RowFixed style={{ height: '17px' }}> <RowFixed style={{ height: '17px' }}>
<ThemedText.DeprecatedBody <ThemedText.DeprecatedBody
color={redesignFlag ? theme.textSecondary : theme.deprecated_text3} color={theme.textSecondary}
fontWeight={redesignFlag ? 400 : 500} fontWeight={400}
fontSize={14} fontSize={14}
style={{ display: 'inline' }} style={{ display: 'inline' }}
> >
...@@ -389,7 +329,7 @@ export default function SwapCurrencyInputPanel({ ...@@ -389,7 +329,7 @@ export default function SwapCurrencyInputPanel({
name={EventName.SWAP_MAX_TOKEN_AMOUNT_SELECTED} name={EventName.SWAP_MAX_TOKEN_AMOUNT_SELECTED}
element={ElementName.MAX_TOKEN_AMOUNT_BUTTON} element={ElementName.MAX_TOKEN_AMOUNT_BUTTON}
> >
<StyledBalanceMax onClick={onMax} redesignFlag={redesignFlagEnabled}> <StyledBalanceMax onClick={onMax}>
<Trans>Max</Trans> <Trans>Max</Trans>
</StyledBalanceMax> </StyledBalanceMax>
</TraceEvent> </TraceEvent>
......
...@@ -7,7 +7,6 @@ import { TraceEvent } from 'analytics/TraceEvent' ...@@ -7,7 +7,6 @@ import { TraceEvent } from 'analytics/TraceEvent'
import { AutoColumn } from 'components/Column' import { AutoColumn } from 'components/Column'
import { LoadingOpacityContainer, loadingOpacityMixin } from 'components/Loader/styled' import { LoadingOpacityContainer, loadingOpacityMixin } from 'components/Loader/styled'
import { isSupportedChain } from 'constants/chains' import { isSupportedChain } from 'constants/chains'
import { RedesignVariant, useRedesignFlag } from 'featureFlags/flags/redesign'
import { darken } from 'polished' import { darken } from 'polished'
import { ReactNode, useCallback, useState } from 'react' import { ReactNode, useCallback, useState } from 'react'
import { Lock } from 'react-feather' import { Lock } from 'react-feather'
...@@ -115,10 +114,10 @@ const LabelRow = styled.div` ...@@ -115,10 +114,10 @@ const LabelRow = styled.div`
} }
` `
const FiatRow = styled(LabelRow)<{ redesignFlag: boolean }>` const FiatRow = styled(LabelRow)`
justify-content: flex-end; justify-content: flex-end;
padding: ${({ redesignFlag }) => redesignFlag && '0px 1rem 0.75rem'}; padding: 0px 1rem 0.75rem;
height: ${({ redesignFlag }) => (redesignFlag ? '32px' : '16px')}; height: 32px;
` `
const Aligner = styled.span` const Aligner = styled.span`
...@@ -220,8 +219,6 @@ export default function CurrencyInputPanel({ ...@@ -220,8 +219,6 @@ export default function CurrencyInputPanel({
const { account, chainId } = useWeb3React() const { account, chainId } = useWeb3React()
const selectedCurrencyBalance = useCurrencyBalance(account ?? undefined, currency ?? undefined) const selectedCurrencyBalance = useCurrencyBalance(account ?? undefined, currency ?? undefined)
const theme = useTheme() const theme = useTheme()
const redesignFlag = useRedesignFlag()
const redesignFlagEnabled = redesignFlag === RedesignVariant.Enabled
const handleDismissSearch = useCallback(() => { const handleDismissSearch = useCallback(() => {
setModalOpen(false) setModalOpen(false)
...@@ -293,7 +290,7 @@ export default function CurrencyInputPanel({ ...@@ -293,7 +290,7 @@ export default function CurrencyInputPanel({
</CurrencySelect> </CurrencySelect>
</InputRow> </InputRow>
{!hideInput && !hideBalance && currency && ( {!hideInput && !hideBalance && currency && (
<FiatRow redesignFlag={redesignFlagEnabled}> <FiatRow>
<RowBetween> <RowBetween>
<LoadingOpacityContainer $loading={loading}> <LoadingOpacityContainer $loading={loading}>
<FiatValue fiatValue={fiatValue} priceImpact={priceImpact} /> <FiatValue fiatValue={fiatValue} priceImpact={priceImpact} />
......
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