Skip to content

Commit

Permalink
Remove depositNetworkBannerMobile feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sshmaxime committed Mar 18, 2024
1 parent 6dbc64c commit 52d5703
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 31 deletions.
7 changes: 7 additions & 0 deletions .changeset/sweet-eagles-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@ledgerhq/types-live": patch
"live-mobile": patch
"@ledgerhq/live-common": patch
---

Remove depositNetworkBannerMobile feature flag
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ import {
hasClosedNetworkBannerSelector,
hasClosedWithdrawBannerSelector,
} from "~/reducers/settings";
import { urls } from "~/utils/urls";

export default function ReceiveFundsNavigator() {
const { colors } = useTheme();
const { t } = useTranslation();
const route = useRoute();
const depositNetworkBannerMobile = useFeature("depositNetworkBannerMobile");
const depositWithdrawBannerMobile = useFeature("depositWithdrawBannerMobile");
const hasClosedWithdrawBanner = useSelector(hasClosedWithdrawBannerSelector);
const hasClosedNetworkBanner = useSelector(hasClosedNetworkBannerSelector);
Expand Down Expand Up @@ -108,8 +108,8 @@ export default function ReceiveFundsNavigator() {
{hasClosedNetworkBanner && (
<HelpButton
eventButton="Choose a network article"
url={depositNetworkBannerMobile?.params?.url || ""}
enabled={depositNetworkBannerMobile?.enabled ?? false}
url={urls.chooseNetwork}
enabled={true}
/>
)}
<NavigationHeaderCloseButtonAdvanced onClose={onClose} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import { useSafeAreaInsets } from "react-native-safe-area-context";
import * as Animatable from "react-native-animatable";
import { setCloseNetworkBanner } from "~/actions/settings";
import { hasClosedNetworkBannerSelector } from "~/reducers/settings";
import useFeature from "@ledgerhq/live-common/featureFlags/useFeature";
import BigCurrencyRow from "~/components/BigCurrencyRow";
import { findAccountByCurrency } from "~/logic/deposit";
import { AccountLike } from "@ledgerhq/types-live";
import { urls } from "~/utils/urls";

type CryptoWithAccounts = { crypto: CryptoCurrency; accounts: AccountLike[] };

Expand Down Expand Up @@ -49,8 +49,6 @@ export default function SelectNetwork({ navigation, route }: Props) {
const hasClosedNetworkBanner = useSelector(hasClosedNetworkBannerSelector);
const [displayBanner, setBanner] = useState(!hasClosedNetworkBanner);

const depositNetworkBannerMobile = useFeature("depositNetworkBannerMobile");

const { t } = useTranslation();

const cryptoCurrencies = useMemo(() => {
Expand Down Expand Up @@ -148,15 +146,14 @@ export default function SelectNetwork({ navigation, route }: Props) {
setBanner(false);
}, [dispatch]);

const clickLearn = useCallback(() => {
const clickLearn = () => {
track("button_clicked", {
button: "Choose a network article",
type: "card",
page: "Choose a network",
});
// @ts-expect-error TYPINGS
Linking.openURL(depositNetworkBannerMobile?.params?.url);
}, [depositNetworkBannerMobile?.params?.url]);
Linking.openURL(urls.chooseNetwork);
};

const renderItem = useCallback(
({ item }: { item: CryptoWithAccounts }) => (
Expand Down Expand Up @@ -200,17 +197,15 @@ export default function SelectNetwork({ navigation, route }: Props) {
keyboardDismissMode="on-drag"
/>
</Flex>
{depositNetworkBannerMobile?.enabled ? (
displayBanner ? (
<AnimatedView animation="fadeInUp" delay={50} duration={300}>
<NetworkBanner hideBanner={hideBanner} onPress={clickLearn} />
</AnimatedView>
) : (
<AnimatedView animation="fadeOutDown" delay={50} duration={300}>
<NetworkBanner hideBanner={hideBanner} onPress={clickLearn} />
</AnimatedView>
)
) : null}
{displayBanner ? (
<AnimatedView animation="fadeInUp" delay={50} duration={300}>
<NetworkBanner hideBanner={hideBanner} onPress={clickLearn} />
</AnimatedView>
) : (
<AnimatedView animation="fadeOutDown" delay={50} duration={300}>
<NetworkBanner hideBanner={hideBanner} onPress={clickLearn} />
</AnimatedView>
)}
</>
);
}
Expand Down
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 @@ -146,6 +146,7 @@ export const urls = {
developerPage:
"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",
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 },
},

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

depositWithdrawBannerMobile: {
enabled: false,
params: { url: "https://www.ledger.com/ledger-live" },
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;
depositNetworkBannerMobile: Feature_DepositNetworkBannerMobile;
depositWithdrawBannerMobile: Feature_DepositWithdrawBannerMobile;
mockFeature: Feature_MockFeature;
multibuyNavigation: Feature_MultibuyNavigation;
Expand Down Expand Up @@ -351,10 +350,6 @@ export type Feature_BuyDeviceFromLive = Feature<{
url: string | null;
}>;

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

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

0 comments on commit 52d5703

Please sign in to comment.