From 2e618fb2aa07d42da2eba004b8e923d016c050d0 Mon Sep 17 00:00:00 2001 From: eddie <66155195+just-toby@users.noreply.github.com> Date: Wed, 15 Nov 2023 11:17:02 -0800 Subject: [PATCH] fix: remove 3 launched feature flags (#7589) * fix: remove 3 launched feature flags * fix: remove unused componnent * fix: remove another apple logo --- src/assets/svg/apple_logo.svg | 77 ------------------- .../AccountDrawer/DownloadButton.tsx | 6 +- .../AccountDrawer/UniwalletModal.tsx | 14 +--- .../AndroidAnnouncementBanner/index.tsx | 5 +- .../FeatureFlagModal/FeatureFlagModal.tsx | 21 ----- src/components/Logo/AppleLogo.tsx | 8 -- src/components/NavBar/MenuDropdown.tsx | 42 ++++------ src/components/WalletModal/index.tsx | 4 +- src/connection/index.ts | 5 +- src/connection/types.ts | 2 +- src/featureFlags/flags/androidGALaunch.ts | 10 --- src/featureFlags/flags/uniswapXEthOutput.ts | 9 --- src/featureFlags/flags/uniswapXExactOutput.ts | 9 --- src/featureFlags/index.tsx | 3 - .../hooks/routing/useRoutingAPIArguments.ts | 8 -- .../Landing/__snapshots__/index.test.tsx.snap | 16 +--- src/pages/Landing/index.tsx | 20 +---- src/state/routing/slice.ts | 19 +---- src/state/routing/types.ts | 2 - src/state/routing/useRoutingAPITrade.test.ts | 8 -- src/utils/openDownloadApp.ts | 9 +-- src/utils/userAgent.ts | 1 - 22 files changed, 35 insertions(+), 263 deletions(-) delete mode 100644 src/assets/svg/apple_logo.svg delete mode 100644 src/components/Logo/AppleLogo.tsx delete mode 100644 src/featureFlags/flags/androidGALaunch.ts delete mode 100644 src/featureFlags/flags/uniswapXEthOutput.ts delete mode 100644 src/featureFlags/flags/uniswapXExactOutput.ts diff --git a/src/assets/svg/apple_logo.svg b/src/assets/svg/apple_logo.svg deleted file mode 100644 index fed43b342a..0000000000 --- a/src/assets/svg/apple_logo.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/components/AccountDrawer/DownloadButton.tsx b/src/components/AccountDrawer/DownloadButton.tsx index 72325c092d..2b0b702e16 100644 --- a/src/components/AccountDrawer/DownloadButton.tsx +++ b/src/components/AccountDrawer/DownloadButton.tsx @@ -1,5 +1,4 @@ import { InterfaceElementName } from '@uniswap/analytics-events' -import { useAndroidGALaunchFlagEnabled } from 'featureFlags/flags/androidGALaunch' import { PropsWithChildren, useCallback } from 'react' import styled from 'styled-components' import { ClickableStyle } from 'theme/components' @@ -42,12 +41,11 @@ export function DownloadButton({ text?: string element: InterfaceElementName }) { - const isAndroidGALaunched = useAndroidGALaunchFlagEnabled() const onButtonClick = useCallback(() => { // handles any actions required by the parent, i.e. cancelling wallet connection attempt or dismissing an ad onClick?.() - openDownloadApp({ element, isAndroidGALaunched }) - }, [element, isAndroidGALaunched, onClick]) + openDownloadApp({ element }) + }, [element, onClick]) return ( diff --git a/src/components/AccountDrawer/UniwalletModal.tsx b/src/components/AccountDrawer/UniwalletModal.tsx index 11b6e2632e..88223de89d 100644 --- a/src/components/AccountDrawer/UniwalletModal.tsx +++ b/src/components/AccountDrawer/UniwalletModal.tsx @@ -9,7 +9,6 @@ import { uniwalletWCV2ConnectConnection } from 'connection' import { ActivationStatus, useActivationState } from 'connection/activate' import { ConnectionType } from 'connection/types' import { UniwalletConnect as UniwalletConnectV2 } from 'connection/WalletConnectV2' -import { useAndroidGALaunchFlagEnabled } from 'featureFlags/flags/androidGALaunch' import { QRCodeSVG } from 'qrcode.react' import { useEffect, useState } from 'react' import styled, { useTheme } from 'styled-components' @@ -43,9 +42,8 @@ export default function UniwalletModal() { const { activationState, cancelActivation } = useActivationState() const [uri, setUri] = useState() - const isAndroidGALaunched = useAndroidGALaunchFlagEnabled() // Displays the modal if not on iOS/Android, a Uniswap Wallet Connection is pending, & qrcode URI is available - const onLaunchedMobilePlatform = isIOS || (isAndroidGALaunched && isAndroid) + const onLaunchedMobilePlatform = isIOS || isAndroid const open = !onLaunchedMobilePlatform && activationState.status === ActivationStatus.PENDING && @@ -105,8 +103,6 @@ const InfoSectionWrapper = styled(RowBetween)` ` function InfoSection() { - const isAndroidGALaunched = useAndroidGALaunchFlagEnabled() - return ( @@ -114,13 +110,7 @@ function InfoSection() { Don't have a Uniswap wallet? - {isAndroidGALaunched ? ( - Safely store and swap tokens with the Uniswap app. Available on iOS and Android. - ) : ( - - Download in the App Store to safely store your tokens and NFTs, swap tokens, and connect to crypto apps. - - )} + Safely store and swap tokens with the Uniswap app. Available on iOS and Android. diff --git a/src/components/Banner/AndroidAnnouncementBanner/index.tsx b/src/components/Banner/AndroidAnnouncementBanner/index.tsx index 2902aa6a44..420a769796 100644 --- a/src/components/Banner/AndroidAnnouncementBanner/index.tsx +++ b/src/components/Banner/AndroidAnnouncementBanner/index.tsx @@ -1,6 +1,5 @@ import { Trans } from '@lingui/macro' import { InterfaceElementName } from '@uniswap/analytics-events' -import { useAndroidGALaunchFlagEnabled } from 'featureFlags/flags/androidGALaunch' import { useScreenSize } from 'hooks/useScreenSize' import { useLocation } from 'react-router-dom' import { useHideAndroidAnnouncementBanner } from 'state/user/hooks' @@ -31,14 +30,12 @@ export default function AndroidAnnouncementBanner() { const shouldDisplay = Boolean(!hideAndroidAnnouncementBanner && !isLandingScreen) const isDarkMode = useIsDarkMode() - const isAndroidGALaunched = useAndroidGALaunchFlagEnabled() const onClick = () => openDownloadApp({ element: InterfaceElementName.UNISWAP_WALLET_BANNER_DOWNLOAD_BUTTON, - isAndroidGALaunched, }) - if (!isAndroidGALaunched || isMobileSafari) return null + if (isMobileSafari) return null return ( diff --git a/src/components/FeatureFlagModal/FeatureFlagModal.tsx b/src/components/FeatureFlagModal/FeatureFlagModal.tsx index 1eead470e1..aca7d0f8e1 100644 --- a/src/components/FeatureFlagModal/FeatureFlagModal.tsx +++ b/src/components/FeatureFlagModal/FeatureFlagModal.tsx @@ -3,7 +3,6 @@ import Column from 'components/Column' import { BaseVariant, FeatureFlag, featureFlagSettings, useUpdateConfig, useUpdateFlag } from 'featureFlags' import { DynamicConfigName } from 'featureFlags/dynamicConfig' import { useQuickRouteChains } from 'featureFlags/dynamicConfig/quickRouteChains' -import { useAndroidGALaunchFlag } from 'featureFlags/flags/androidGALaunch' import { useCurrencyConversionFlag } from 'featureFlags/flags/currencyConversion' import { useFallbackProviderEnabledFlag } from 'featureFlags/flags/fallbackProvider' import { useInfoExploreFlag } from 'featureFlags/flags/infoExplore' @@ -16,8 +15,6 @@ import { useProgressIndicatorV2Flag } from 'featureFlags/flags/progressIndicator import { useQuickRouteMainnetFlag } from 'featureFlags/flags/quickRouteMainnet' import { TraceJsonRpcVariant, useTraceJsonRpcFlag } from 'featureFlags/flags/traceJsonRpc' import { useUniswapXDefaultEnabledFlag } from 'featureFlags/flags/uniswapXDefault' -import { useUniswapXEthOutputFlag } from 'featureFlags/flags/uniswapXEthOutput' -import { useUniswapXExactOutputFlag } from 'featureFlags/flags/uniswapXExactOutput' import { useUniswapXSyntheticQuoteFlag } from 'featureFlags/flags/uniswapXUseSyntheticQuote' import { useFeesEnabledFlag } from 'featureFlags/flags/useFees' import { useUpdateAtom } from 'jotai/utils' @@ -305,12 +302,6 @@ export default function FeatureFlagModal() { featureFlag={FeatureFlag.progressIndicatorV2} label="Refreshed swap progress indicator" /> - - - ) => ( - - - -) diff --git a/src/components/NavBar/MenuDropdown.tsx b/src/components/NavBar/MenuDropdown.tsx index 500f790fcd..793e13ceb4 100644 --- a/src/components/NavBar/MenuDropdown.tsx +++ b/src/components/NavBar/MenuDropdown.tsx @@ -1,9 +1,7 @@ import { t, Trans } from '@lingui/macro' import { InterfaceElementName } from '@uniswap/analytics-events' -import { ReactComponent as AppleLogo } from 'assets/svg/apple_logo.svg' import FeatureFlagModal from 'components/FeatureFlagModal/FeatureFlagModal' import { PrivacyPolicyModal } from 'components/PrivacyPolicy' -import { useAndroidGALaunchFlagEnabled } from 'featureFlags/flags/androidGALaunch' import { useOnClickOutside } from 'hooks/useOnClickOutside' import { Box } from 'nft/components/Box' import { Column, Row } from 'nft/components/Flex' @@ -132,8 +130,6 @@ export const MenuDropdown = () => { const ref = useRef(null) useOnClickOutside(ref, isOpen ? toggleOpen : undefined) - const isAndroidGALaunched = useAndroidGALaunchFlagEnabled() - return ( <> @@ -175,35 +171,23 @@ export const MenuDropdown = () => { onClick={() => openDownloadApp({ element: InterfaceElementName.UNISWAP_WALLET_NAVBAR_MENU_DOWNLOAD_BUTTON, - isAndroidGALaunched, }) } > - {isAndroidGALaunched ? ( - <> - - - -
- - Download Uniswap - - - Available on iOS and Android - -
- - ) : ( - <> - - - - - Download Uniswap app - - - )} + <> + + + +
+ + Download Uniswap + + + Available on iOS and Android + +
+
diff --git a/src/components/WalletModal/index.tsx b/src/components/WalletModal/index.tsx index 405d40a6aa..1cf805e901 100644 --- a/src/components/WalletModal/index.tsx +++ b/src/components/WalletModal/index.tsx @@ -6,7 +6,6 @@ import { AutoRow } from 'components/Row' import { connections, deprecatedNetworkConnection, networkConnection } from 'connection' import { ActivationStatus, useActivationState } from 'connection/activate' import { isSupportedChain } from 'constants/chains' -import { useAndroidGALaunchFlagEnabled } from 'featureFlags/flags/androidGALaunch' import { useFallbackProviderEnabled } from 'featureFlags/flags/fallbackProvider' import { useEffect } from 'react' import styled from 'styled-components' @@ -41,7 +40,6 @@ const PrivacyPolicyWrapper = styled.div` export default function WalletModal({ openSettings }: { openSettings: () => void }) { const { connector, chainId } = useWeb3React() - const isAndroidGALaunched = useAndroidGALaunchFlagEnabled() const { activationState } = useActivationState() const fallbackProviderEnabled = useFallbackProviderEnabled() @@ -68,7 +66,7 @@ export default function WalletModal({ openSettings }: { openSettings: () => void {connections - .filter((connection) => connection.shouldDisplay(isAndroidGALaunched)) + .filter((connection) => connection.shouldDisplay()) .map((connection) => (