Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
9e31756c
Unverified
Commit
9e31756c
authored
Apr 21, 2023
by
cartcrom
Committed by
GitHub
Apr 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remove miniportfolio and mgtm flags (#6416)
* chore: remove miniportfolio and mgtm flags * fix: tiny css fix
parent
3900cdd0
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
92 deletions
+32
-92
index.tsx
src/components/AccountDrawer/MiniPortfolio/index.tsx
+28
-38
UniswapWalletBanner.tsx
src/components/Banner/UniswapWalletBanner.tsx
+1
-3
FeatureFlagModal.tsx
src/components/FeatureFlagModal/FeatureFlagModal.tsx
+0
-14
MenuDropdown.tsx
src/components/NavBar/MenuDropdown.tsx
+2
-8
index.tsx
src/components/WalletModal/index.tsx
+1
-5
featureFlags.ts
src/featureFlags/flags/featureFlags.ts
+0
-2
mgtm.ts
src/featureFlags/flags/mgtm.ts
+0
-13
miniPortfolio.ts
src/featureFlags/flags/miniPortfolio.ts
+0
-9
No files found.
src/components/AccountDrawer/MiniPortfolio/index.tsx
View file @
9e31756c
...
@@ -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
>
)
)
}
}
src/components/Banner/UniswapWalletBanner.tsx
View file @
9e31756c
...
@@ -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
()
...
...
src/components/FeatureFlagModal/FeatureFlagModal.tsx
View file @
9e31756c
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
()
}
...
...
src/components/NavBar/MenuDropdown.tsx
View file @
9e31756c
...
@@ -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
}
/>
...
...
src/components/WalletModal/index.tsx
View file @
9e31756c
...
@@ -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
}
...
...
src/featureFlags/flags/featureFlags.ts
View file @
9e31756c
...
@@ -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
'
,
}
}
src/featureFlags/flags/mgtm.ts
deleted
100644 → 0
View file @
3900cdd0
/* 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
}
src/featureFlags/flags/miniPortfolio.ts
deleted
100644 → 0
View file @
3900cdd0
import
{
BaseVariant
,
FeatureFlag
,
useBaseFlag
}
from
'
../index
'
export
function
useMiniPortfolioFlag
():
BaseVariant
{
return
useBaseFlag
(
FeatureFlag
.
miniPortfolio
,
BaseVariant
.
Enabled
)
}
export
function
useMiniPortfolioEnabled
():
boolean
{
return
useMiniPortfolioFlag
()
===
BaseVariant
.
Enabled
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment