Skip to content

Commit

Permalink
Merge pull request #6461 from LedgerHQ/support/LIVE-11425
Browse files Browse the repository at this point in the history
[LLM] - [LIVE-11425] - Remove `depositWithdrawBannerMobile` feature flag
  • Loading branch information
sshmaxime committed Mar 18, 2024
2 parents f324f47 + 93c9274 commit 6f033e6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { ReceiveFundsStackParamList } from "./types/ReceiveFundsNavigator";
import { NavigationHeaderBackButton } from "../NavigationHeaderBackButton";
import { Flex } from "@ledgerhq/native-ui";
import HelpButton from "~/screens/ReceiveFunds/HelpButton";
import useFeature from "@ledgerhq/live-common/featureFlags/useFeature";
import { useSelector } from "react-redux";
import {
hasClosedNetworkBannerSelector,
Expand All @@ -38,7 +37,6 @@ export default function ReceiveFundsNavigator() {
const { colors } = useTheme();
const { t } = useTranslation();
const route = useRoute();
const depositWithdrawBannerMobile = useFeature("depositWithdrawBannerMobile");
const hasClosedWithdrawBanner = useSelector(hasClosedWithdrawBannerSelector);
const hasClosedNetworkBanner = useSelector(hasClosedNetworkBannerSelector);

Expand Down Expand Up @@ -106,11 +104,7 @@ export default function ReceiveFundsNavigator() {
headerRight: () => (
<Flex alignItems="center" justifyContent="center" flexDirection="row">
{hasClosedNetworkBanner && (
<HelpButton
eventButton="Choose a network article"
url={urls.chooseNetwork}
enabled={true}
/>
<HelpButton eventButton="Choose a network article" url={urls.chooseNetwork} />
)}
<NavigationHeaderCloseButtonAdvanced onClose={onClose} />
</Flex>
Expand Down Expand Up @@ -192,11 +186,7 @@ export default function ReceiveFundsNavigator() {
headerRight: () => (
<Flex alignItems="center" justifyContent="center" flexDirection="row">
{hasClosedWithdrawBanner && (
<HelpButton
url={depositWithdrawBannerMobile?.params?.url || ""}
enabled={depositWithdrawBannerMobile?.enabled ?? false}
eventButton="How to withdraw from exchange"
/>
<HelpButton url={urls.withdrawCrypto} eventButton="How to withdraw from exchange" />
)}
<NavigationHeaderCloseButtonAdvanced
onClose={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { BaseComposite, StackNavigatorProps } from "~/components/RootNavigator/t
import styled, { BaseStyledProps } from "@ledgerhq/native-ui/components/styled";
import Clipboard from "@react-native-clipboard/clipboard";
import ConfirmationHeaderTitle from "./ConfirmationHeaderTitle";
import useFeature from "@ledgerhq/live-common/featureFlags/useFeature";
import { BankMedium } from "@ledgerhq/native-ui/assets/icons";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { hasClosedWithdrawBannerSelector } from "~/reducers/settings";
Expand Down Expand Up @@ -77,7 +76,6 @@ function ReceiveConfirmationInner({ navigation, route, account, parentAccount }:
const [hasAddedTokenAccount, setHasAddedTokenAccount] = useState(false);
const [hasCopied, setCopied] = useState(false);
const dispatch = useDispatch();
const depositWithdrawBannerMobile = useFeature("depositWithdrawBannerMobile");
const insets = useSafeAreaInsets();

const hasClosedWithdrawBanner = useSelector(hasClosedWithdrawBannerSelector);
Expand Down Expand Up @@ -115,16 +113,15 @@ function ReceiveConfirmationInner({ navigation, route, account, parentAccount }:
setBanner(false);
}, [dispatch]);

const clickLearn = useCallback(() => {
const clickLearn = () => {
track("button_clicked", {
button: "How to withdraw from exchange",
type: "card",
page: "Receive Account Qr Code",
});
// @ts-expect-error TYPINGS
Linking.openURL(depositWithdrawBannerMobile?.params?.url);
}, [depositWithdrawBannerMobile?.params?.url]);

Linking.openURL(urls.withdrawCrypto);
};
useEffect(() => {
if (route.params?.createTokenAccount && !hasAddedTokenAccount) {
const newMainAccount = { ...mainAccount };
Expand Down Expand Up @@ -387,17 +384,15 @@ function ReceiveConfirmationInner({ navigation, route, account, parentAccount }:
{t("transfer.receive.receiveConfirmation.verifyAddress")}
</Button>

{depositWithdrawBannerMobile?.enabled ? (
displayBanner ? (
<AnimatedView animation="fadeInUp" delay={50} duration={300}>
<WithdrawBanner hideBanner={hideBanner} onPress={clickLearn} />
</AnimatedView>
) : (
<AnimatedView animation="fadeOutDown" delay={50} duration={300}>
<WithdrawBanner hideBanner={hideBanner} onPress={clickLearn} />
</AnimatedView>
)
) : null}
{displayBanner ? (
<AnimatedView animation="fadeInUp" delay={50} duration={300}>
<WithdrawBanner hideBanner={hideBanner} onPress={clickLearn} />
</AnimatedView>
) : (
<AnimatedView animation="fadeOutDown" delay={50} duration={300}>
<WithdrawBanner hideBanner={hideBanner} onPress={clickLearn} />
</AnimatedView>
)}
</Flex>
</Flex>
{verified ? null : isModalOpened ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import { Box } from "@ledgerhq/native-ui";
import { track } from "~/analytics";

type Props = {
enabled: boolean;
url: string;
eventButton: string;
};
const HelpButton = ({ enabled, url, eventButton }: Props) => {
const HelpButton = ({ url, eventButton }: Props) => {
const onClickButton = useCallback(() => {
track("button_clicked", {
button: eventButton,
Expand All @@ -18,13 +17,13 @@ const HelpButton = ({ enabled, url, eventButton }: Props) => {
Linking.openURL(url);
}, [url, eventButton]);

return enabled ? (
return (
<Box mr={4}>
<TouchableOpacity onPress={onClickButton}>
<HelpMedium size={24} color={"neutral.c100"} />
</TouchableOpacity>
</Box>
) : null;
);
};

export default HelpButton;
1 change: 1 addition & 0 deletions apps/ledger-live-mobile/src/utils/urls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export const urls = {
"https://developers.ledger.com?utm_source=ledger_live_mobile&utm_medium=self_referral&utm_content=catalog",
},
chooseNetwork: "https://support.ledger.com/hc/en-us/articles/7782669175581?support=true",
withdrawCrypto: "https://support.ledger.com/hc/en-us/articles/13108505155485?docs=true",
approvedOperation:
"https://support.ledger.com/hc/en-us/articles/360020849134-Track-your-transaction?docs=true&utm_source=ledger_live_mobile&utm_medium=self_referral&utm_content=compoundTX",
recoveryPhraseInfo:
Expand Down
5 changes: 0 additions & 5 deletions libs/ledger-live-common/src/featureFlags/defaultFeatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ export const DEFAULT_FEATURES: Features = {
params: { debug: false, url: null },
},

depositWithdrawBannerMobile: {
enabled: false,
params: { url: "https://www.ledger.com/ledger-live" },
},

deviceInitialApps: {
enabled: false,
params: { apps: ["Bitcoin", "Ethereum"] },
Expand Down
5 changes: 0 additions & 5 deletions libs/ledgerjs/packages/types-live/src/feature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ export type Features = CurrencyFeatures & {
counterValue: Feature_CounterValue;
deviceInitialApps: Feature_DeviceInitialApps;
buyDeviceFromLive: Feature_BuyDeviceFromLive;
depositWithdrawBannerMobile: Feature_DepositWithdrawBannerMobile;
mockFeature: Feature_MockFeature;
multibuyNavigation: Feature_MultibuyNavigation;
referralProgramDiscoverCard: Feature_ReferralProgramDiscoverCard;
Expand Down Expand Up @@ -350,10 +349,6 @@ export type Feature_BuyDeviceFromLive = Feature<{
url: string | null;
}>;

export type Feature_DepositWithdrawBannerMobile = Feature<{
url: string;
}>;

export type Feature_Discover = Feature<{
version: string;
}>;
Expand Down

0 comments on commit 6f033e6

Please sign in to comment.