From 819dfaa85b1d65492fb0371f5ad4045d0f17bf6c Mon Sep 17 00:00:00 2001 From: jdabbech-ledger Date: Fri, 29 Nov 2024 12:32:06 +0100 Subject: [PATCH 1/2] :sparkles: (llm): Remove default NanoX pair screen --- .../page/onboarding/onboardingSteps.page.ts | 5 - .../e2e/specs/onboarding.spec.ts | 4 - .../BleDevicePairingFlow/BleDevicePairing.tsx | 4 +- .../src/components/SelectDevice2/index.tsx | 8 +- .../src/screens/Onboarding/steps/pairNew.tsx | 119 ++++++++---------- .../{ConnectNano.tsx => ConnectDevice.tsx} | 48 +++---- .../steps/setupDevice/scenes/PairNew.tsx | 35 ------ .../steps/setupDevice/scenes/index.tsx | 3 +- 8 files changed, 77 insertions(+), 149 deletions(-) rename apps/ledger-live-mobile/src/screens/Onboarding/steps/setupDevice/scenes/{ConnectNano.tsx => ConnectDevice.tsx} (76%) delete mode 100644 apps/ledger-live-mobile/src/screens/Onboarding/steps/setupDevice/scenes/PairNew.tsx diff --git a/apps/ledger-live-mobile/e2e/page/onboarding/onboardingSteps.page.ts b/apps/ledger-live-mobile/e2e/page/onboarding/onboardingSteps.page.ts index 04ac0df25cac..626988076416 100644 --- a/apps/ledger-live-mobile/e2e/page/onboarding/onboardingSteps.page.ts +++ b/apps/ledger-live-mobile/e2e/page/onboarding/onboardingSteps.page.ts @@ -21,7 +21,6 @@ export default class OnboardingStepsPage { buyLedgerButton = () => getElementById("onboarding-noLedgerYetModal-buy"); exploreWithoutDeviceButton = () => getElementById(this.exploreWithoutDeviceButtonId); connectLedgerButton = () => getElementById("Existing Wallet | Connect"); - pairNanoButton = () => getElementById("Onboarding-PairNewNano"); maybeLaterButton = () => getElementById("notifications-prompt-later"); setupLedger = "onboarding-setupLedger"; @@ -157,10 +156,6 @@ export default class OnboardingStepsPage { await tapById(this.quizzFinalCta); } - async selectPairMyNano() { - await tapByElement(this.pairNanoButton()); - } - async declineNotifications() { await tapByElement(this.maybeLaterButton()); } diff --git a/apps/ledger-live-mobile/e2e/specs/onboarding.spec.ts b/apps/ledger-live-mobile/e2e/specs/onboarding.spec.ts index a4f0f1e0e21d..6856a05e1e42 100644 --- a/apps/ledger-live-mobile/e2e/specs/onboarding.spec.ts +++ b/apps/ledger-live-mobile/e2e/specs/onboarding.spec.ts @@ -20,7 +20,6 @@ describe("Onboarding", () => { await app.onboarding.startOnboarding(); await app.onboarding.chooseToAccessYourWallet(); await app.onboarding.chooseToConnectYourLedger(); - await app.onboarding.selectPairMyNano(); await app.common.selectAddDevice(); await app.common.addDeviceViaBluetooth(); await app.portfolio.waitForPortfolioPageToLoad(); @@ -33,7 +32,6 @@ describe("Onboarding", () => { await app.onboarding.chooseSetupLedger(); await app.onboarding.chooseDevice("nanoX"); await app.onboarding.goesThroughRestorePhrase(); - await app.onboarding.selectPairMyNano(); await app.common.selectAddDevice(); await app.common.addDeviceViaBluetooth(); await app.portfolio.waitForPortfolioPageToLoad(); @@ -52,7 +50,6 @@ describe("Onboarding", () => { await app.onboarding.checkDeviceNotCompatible(); } else { await app.onboarding.goesThroughRestorePhrase(); - await app.onboarding.selectPairMyNano(); await app.common.addDeviceViaUSB("nanoSP"); await app.portfolio.waitForPortfolioPageToLoad(); } @@ -64,7 +61,6 @@ describe("Onboarding", () => { await app.onboarding.chooseSetupLedger(); await app.onboarding.chooseDevice("nanoX"); await app.onboarding.goesThroughCreateWallet(); - await app.onboarding.selectPairMyNano(); await app.common.selectAddDevice(); await app.common.addDeviceViaBluetooth(); await app.portfolio.waitForPortfolioPageToLoad(); diff --git a/apps/ledger-live-mobile/src/components/BleDevicePairingFlow/BleDevicePairing.tsx b/apps/ledger-live-mobile/src/components/BleDevicePairingFlow/BleDevicePairing.tsx index c1c925055051..cd54cb52570f 100644 --- a/apps/ledger-live-mobile/src/components/BleDevicePairingFlow/BleDevicePairing.tsx +++ b/apps/ledger-live-mobile/src/components/BleDevicePairingFlow/BleDevicePairing.tsx @@ -169,14 +169,14 @@ const BleDevicePairing = ({ deviceToPair, onPaired, onRetry }: BleDevicePairingP ( - } + )} backgroundColor={colors.opacityDefault.c05} size={64} variant="circle" diff --git a/apps/ledger-live-mobile/src/components/SelectDevice2/index.tsx b/apps/ledger-live-mobile/src/components/SelectDevice2/index.tsx index d0b90db40271..90fe8fc0091a 100644 --- a/apps/ledger-live-mobile/src/components/SelectDevice2/index.tsx +++ b/apps/ledger-live-mobile/src/components/SelectDevice2/index.tsx @@ -166,9 +166,9 @@ export default function SelectDevice({ useEffect(() => { const filter = ({ id }: { id: string }) => ["hid", "httpdebug"].includes(id); + const setDeviceFromId = (id: string) => (id.startsWith("usb") ? setUSBDevice : setProxyDevice); const sub = discoverDevices(filter).subscribe(e => { - const setDevice = e.id.startsWith("usb") ? setUSBDevice : setProxyDevice; - + const setDevice = setDeviceFromId(e.id); if (e.type === "remove") setDevice(undefined); if (e.type === "add") { const { name, deviceModel, id, wired } = e; @@ -316,6 +316,10 @@ export default function SelectDevice({ retryRequestOnIssue={retryRequestOnIssue} cannotRetryRequest={cannotRetryRequest} /> + {/* @Fixme Add a hidden text element to render screen correctly on ios sim release e2e test */} + + {"Hidden text element to pass detox ios release onboarding.spec"} + {isPairingDevices ? ( >; -const scenes = [PairNew, ConnectNano] as Step[]; +const StyledSafeAreaView = styled(SafeAreaView)` + flex: 1; + background-color: ${p => p.theme.colors.background.main}; +`; + +const ImageHeader = () => { + const navigation = useNavigation(); + return ( + + + ) : null} ); }; -ConnectNanoScene.id = "ConnectNanoScene"; -ConnectNanoScene.contentContainerStyle = { padding: 16, flex: 1 }; - -const Next = ({ onNext }: { onNext: () => void }) => { - const dispatch = useDispatch(); - - return __DEV__ ? ( - - ) : null; -}; - -ConnectNanoScene.Next = Next; - -export default ConnectNanoScene; +export default ConnectDevice; diff --git a/apps/ledger-live-mobile/src/screens/Onboarding/steps/setupDevice/scenes/PairNew.tsx b/apps/ledger-live-mobile/src/screens/Onboarding/steps/setupDevice/scenes/PairNew.tsx deleted file mode 100644 index 0ab62269e7f7..000000000000 --- a/apps/ledger-live-mobile/src/screens/Onboarding/steps/setupDevice/scenes/PairNew.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from "react"; -import { useTranslation } from "react-i18next"; -import { Text } from "@ledgerhq/native-ui"; -import Button from "~/components/PreventDoubleClickButton"; - -const PairNewScene = ({ deviceModelId }: { deviceModelId?: string }) => { - const { t } = useTranslation(); - - return ( - <> - - {t(`onboarding.stepPairNew.${deviceModelId ?? "generic"}.title`)} - - - {t(`onboarding.stepPairNew.${deviceModelId ?? "generic"}.desc`)} - - - ); -}; - -PairNewScene.id = "PairNewScene"; - -const Next = ({ onNext, deviceModelId }: { onNext: () => void; deviceModelId?: string }) => { - const { t } = useTranslation(); - - return ( - - ); -}; - -PairNewScene.Next = Next; - -export default PairNewScene; diff --git a/apps/ledger-live-mobile/src/screens/Onboarding/steps/setupDevice/scenes/index.tsx b/apps/ledger-live-mobile/src/screens/Onboarding/steps/setupDevice/scenes/index.tsx index 1b534f421ec2..8cb5d6158590 100644 --- a/apps/ledger-live-mobile/src/screens/Onboarding/steps/setupDevice/scenes/index.tsx +++ b/apps/ledger-live-mobile/src/screens/Onboarding/steps/setupDevice/scenes/index.tsx @@ -6,8 +6,7 @@ export { default as RecoveryPhrase } from "./RecoveryPhrase"; export { default as RecoveryPhraseInstructions } from "./RecoveryPhraseInstructions"; export { default as RecoveryPhraseSetup } from "./RecoveryPhraseSetup"; export { default as HideRecoveryPhrase } from "./HideRecoveryPhrase"; -export { default as PairNew } from "./PairNew"; -export { default as ConnectNano } from "./ConnectNano"; +export { default as ConnectDevice } from "./ConnectDevice"; export { default as QuizzFinal } from "./QuizzFinal"; export { default as SyncDesktop } from "./SyncDesktop"; From 73913b662fa4d1deb4805958ad79225081073a45 Mon Sep 17 00:00:00 2001 From: jdabbech-ledger Date: Fri, 29 Nov 2024 12:34:11 +0100 Subject: [PATCH 2/2] :bookmark: (llm): Changeset --- .changeset/brave-icons-glow.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/brave-icons-glow.md diff --git a/.changeset/brave-icons-glow.md b/.changeset/brave-icons-glow.md new file mode 100644 index 000000000000..9408be508483 --- /dev/null +++ b/.changeset/brave-icons-glow.md @@ -0,0 +1,5 @@ +--- +"live-mobile": minor +--- + +Remove default nanoX pairing desc screen