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