feat: [info] remove balance summaries from TDP (#7430)

This commit is contained in:
Kristie Huang 2023-10-06 13:07:29 -04:00 committed by GitHub
parent 1b7f0d11fd
commit 48379c66ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

@ -23,6 +23,7 @@ import TokenSafetyMessage from 'components/TokenSafety/TokenSafetyMessage'
import TokenSafetyModal from 'components/TokenSafety/TokenSafetyModal'
import { NATIVE_CHAIN_ID, nativeOnChain } from 'constants/tokens'
import { checkWarning } from 'constants/tokenSafety'
import { useInfoTDPEnabled } from 'featureFlags/flags/infoTDP'
import { TokenPriceQuery } from 'graphql/data/__generated__/types-and-hooks'
import { Chain, TokenQuery, TokenQueryData } from 'graphql/data/Token'
import { QueryToken } from 'graphql/data/Token'
@ -128,6 +129,7 @@ export default function TokenDetails({
}, {} as { [key: string]: string | undefined }) ?? {},
[tokenQueryData]
)
const isInfoTDPEnabled = useInfoTDPEnabled()
const { token: detailedToken, didFetchFromChain } = useRelevantToken(address, pageChainId, tokenQueryData)
@ -255,9 +257,9 @@ export default function TokenDetails({
/>
</div>
{tokenWarning && <TokenSafetyMessage tokenAddress={address} warning={tokenWarning} />}
{detailedToken && <BalanceSummary token={detailedToken} />}
{!isInfoTDPEnabled && detailedToken && <BalanceSummary token={detailedToken} />}
</RightPanel>
{detailedToken && <MobileBalanceSummaryFooter token={detailedToken} />}
{!isInfoTDPEnabled && detailedToken && <MobileBalanceSummaryFooter token={detailedToken} />}
<TokenSafetyModal
isOpen={openTokenSafetyModal || !!continueSwap}

@ -3,3 +3,7 @@ import { BaseVariant, FeatureFlag, useBaseFlag } from '../index'
export function useInfoTDPFlag(): BaseVariant {
return useBaseFlag(FeatureFlag.infoTDP)
}
export function useInfoTDPEnabled(): boolean {
return useInfoTDPFlag() === BaseVariant.Enabled
}