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,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