Commit 9e31756c authored by cartcrom's avatar cartcrom Committed by GitHub

chore: remove miniportfolio and mgtm flags (#6416)

* chore: remove miniportfolio and mgtm flags

* fix: tiny css fix
parent 3900cdd0
......@@ -3,7 +3,6 @@ import { Trace, TraceEvent } from '@uniswap/analytics'
import { BrowserEvent, InterfaceElementName, InterfaceSectionName, SharedEventName } from '@uniswap/analytics-events'
import Column from 'components/Column'
import { AutoRow } from 'components/Row'
import { useMiniPortfolioEnabled } from 'featureFlags/flags/miniPortfolio'
import { useIsNftPage } from 'hooks/useIsNftPage'
import { useAtomValue } from 'jotai/utils'
import { useState } from 'react'
......@@ -87,13 +86,14 @@ const Pages: Array<Page> = [
},
]
function MiniPortfolio({ account }: { account: string }) {
export default function MiniPortfolio({ account }: { account: string }) {
const isNftPage = useIsNftPage()
const [currentPage, setCurrentPage] = useState(isNftPage ? 1 : 0)
const shouldDisableNFTRoutes = useAtomValue(shouldDisableNFTRoutesAtom)
const Page = Pages[currentPage].component
return (
<Trace section={InterfaceSectionName.MINI_PORTFOLIO}>
<Wrapper>
<Nav>
{Pages.map(({ title, loggingElementName, key }, index) => {
......@@ -121,16 +121,6 @@ function MiniPortfolio({ account }: { account: string }) {
<Page account={account} />
</PageWrapper>
</Wrapper>
)
}
export default function MiniPortfolioWrapper({ account }: { account: string }) {
const flagEnabled = useMiniPortfolioEnabled()
if (!flagEnabled) return null
return (
<Trace section={InterfaceSectionName.MINI_PORTFOLIO}>
<MiniPortfolio account={account} />
</Trace>
)
}
......@@ -7,7 +7,6 @@ import { BaseButton } from 'components/Button'
import { AutoColumn } from 'components/Column'
import { OpacityHoverState } from 'components/Common'
import Row from 'components/Row'
import { useMgtmEnabled } from 'featureFlags/flags/mgtm'
import { useScreenSize } from 'hooks/useScreenSize'
import { X } from 'react-feather'
import { useLocation } from 'react-router-dom'
......@@ -87,11 +86,10 @@ const BannerButton = styled(BaseButton)`
export default function UniswapWalletBanner() {
const [hideUniswapWalletBanner, toggleHideUniswapWalletBanner] = useHideUniswapWalletBanner()
const mgtmEnabled = useMgtmEnabled()
const location = useLocation()
const isLandingScreen = location.search === '?intro=true' || location.pathname === '/'
const shouldDisplay = Boolean(mgtmEnabled && !hideUniswapWalletBanner && !isLandingScreen)
const shouldDisplay = Boolean(!hideUniswapWalletBanner && !isLandingScreen)
const screenSize = useScreenSize()
......
import { BaseVariant, FeatureFlag, featureFlagSettings, useUpdateFlag } from 'featureFlags'
import { MgtmVariant, useMgtmFlag } from 'featureFlags/flags/mgtm'
import { useMiniPortfolioFlag } from 'featureFlags/flags/miniPortfolio'
import { DetailsV2Variant, useDetailsV2Flag } from 'featureFlags/flags/nftDetails'
import { NftGraphqlVariant, useNftGraphqlFlag } from 'featureFlags/flags/nftlGraphql'
import { PayWithAnyTokenVariant, usePayWithAnyTokenFlag } from 'featureFlags/flags/payWithAnyToken'
......@@ -206,18 +204,6 @@ export default function FeatureFlagModal() {
<X size={24} />
</CloseButton>
</Header>
<FeatureFlagOption
variant={MgtmVariant}
value={useMgtmFlag()}
featureFlag={FeatureFlag.mgtm}
label="Mobile Wallet go-to-market assets"
/>
<FeatureFlagOption
variant={BaseVariant}
value={useMiniPortfolioFlag()}
featureFlag={FeatureFlag.miniPortfolio}
label="MiniPortfolio"
/>
<FeatureFlagOption
variant={PayWithAnyTokenVariant}
value={usePayWithAnyTokenFlag()}
......
......@@ -3,7 +3,6 @@ import { InterfaceElementName } from '@uniswap/analytics-events'
import { openDownloadApp } from 'components/AccountDrawer/DownloadButton'
import FeatureFlagModal from 'components/FeatureFlagModal/FeatureFlagModal'
import { PrivacyPolicyModal } from 'components/PrivacyPolicy'
import { useMgtmEnabled } from 'featureFlags/flags/mgtm'
import { useOnClickOutside } from 'hooks/useOnClickOutside'
import { Box } from 'nft/components/Box'
import { Column, Row } from 'nft/components/Flex'
......@@ -48,7 +47,7 @@ const PrimaryMenuRow = ({
<Row onClick={close}>{children}</Row>
</NavLink>
) : (
<Row as="a" href={href} target="_blank" rel="noopener noreferrer" className={styles.MenuRow}>
<Row cursor="pointer" as="a" href={href} target="_blank" rel="noopener noreferrer" className={styles.MenuRow}>
{children}
</Row>
)}
......@@ -130,8 +129,6 @@ export const MenuDropdown = () => {
const ref = useRef<HTMLDivElement>(null)
useOnClickOutside(ref, isOpen ? toggleOpen : undefined)
const mgtmEnabled = useMgtmEnabled()
return (
<>
<Box position="relative" ref={ref}>
......@@ -153,10 +150,7 @@ export const MenuDropdown = () => {
</PrimaryMenuRow.Text>
</PrimaryMenuRow>
</Box>
<Box
display={mgtmEnabled ? 'flex' : 'none'}
onClick={() => openDownloadApp(InterfaceElementName.UNISWAP_WALLET_MODAL_DOWNLOAD_BUTTON)}
>
<Box onClick={() => openDownloadApp(InterfaceElementName.UNISWAP_WALLET_MODAL_DOWNLOAD_BUTTON)}>
<PrimaryMenuRow close={toggleOpen}>
<Icon>
<AppleLogo width="24px" height="24px" fill={theme.textPrimary} />
......
......@@ -11,7 +11,6 @@ import { Connection, ConnectionType, getConnections, networkConnection } from 'c
import { useGetConnection } from 'connection'
import { ErrorCode } from 'connection/utils'
import { isSupportedChain } from 'constants/chains'
import { useMgtmEnabled } from 'featureFlags/flags/mgtm'
import { useCallback, useEffect, useRef, useState } from 'react'
import { Settings } from 'react-feather'
import { useAppDispatch } from 'state/hooks'
......@@ -177,8 +176,6 @@ export default function WalletModal({ openSettings }: { openSettings: () => void
[dispatch, setPendingError, toggleWalletDrawer]
)
const mgtmEnabled = useMgtmEnabled()
return (
<Wrapper data-testid="wallet-modal">
<AutoRow justify="space-between" width="100%" marginBottom="16px">
......@@ -193,8 +190,7 @@ export default function WalletModal({ openSettings }: { openSettings: () => void
<AutoColumn gap="16px">
<OptionGrid data-testid="option-grid">
{connections.map((connection) =>
// Hides Uniswap Wallet if mgtm is disabled
connection.shouldDisplay() && !(connection.type === ConnectionType.UNIWALLET && !mgtmEnabled) ? (
connection.shouldDisplay() ? (
<Option
key={connection.getName()}
connection={connection}
......
......@@ -9,7 +9,5 @@ export enum FeatureFlag {
swapWidget = 'swap_widget_replacement_enabled',
statsigDummy = 'web_dummy_gate_amplitude_id',
nftGraphql = 'nft_graphql_migration',
mgtm = 'web_mobile_go_to_market_enabled',
miniPortfolio = 'miniPortfolio',
detailsV2 = 'details_v2',
}
/* eslint-disable import/no-unused-modules */
import { BaseVariant, FeatureFlag, useBaseFlag } from '../index'
export function useMgtmFlag(): BaseVariant {
return useBaseFlag(FeatureFlag.mgtm)
}
export function useMgtmEnabled(): boolean {
return useMgtmFlag() === BaseVariant.Enabled
}
export { BaseVariant as MgtmVariant }
import { BaseVariant, FeatureFlag, useBaseFlag } from '../index'
export function useMiniPortfolioFlag(): BaseVariant {
return useBaseFlag(FeatureFlag.miniPortfolio, BaseVariant.Enabled)
}
export function useMiniPortfolioEnabled(): boolean {
return useMiniPortfolioFlag() === BaseVariant.Enabled
}
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