-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨feat(llm): show WS qr code / pincode (#7467)
* ✨feat(llm): show WS qr code * ✨feat(llm): add tabSelector to UI lib * ✨feat(llm): import account flow change * ✨feat(llm): add back arrow to queued drawer * ✨feat(llm): rework activation flow * ✨feat(llm): add analytics to WS flow * ✨feat(llm): clean * [FEAT]: PinCode Display / Input / error (#7492) * [FEAT]: PinCode Display and Input * [FEAT]: Error component * ✨feat(llm): change walletsync to ledgersync for tracking * ✨feat(llm): add qr code drawer from manage ws * ✨feat(llm): refactor of ws setting inte test * ✨feat(llm): fix color * ✨feat(llm): name size const for qr code --------- Co-authored-by: Martin CAYUELAS <[email protected]>
- Loading branch information
1 parent
9ca7b0c
commit 3de93cc
Showing
42 changed files
with
1,109 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"live-mobile": patch | ||
"@ledgerhq/native-ui": patch | ||
--- | ||
|
||
Add the show qr code implementation for WS flow. Create tabSelector in RN UI Lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
apps/ledger-live-mobile/src/newArch/components/Dummy/Drawer.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
...dger-live-mobile/src/newArch/features/Accounts/screens/AddAccount/components/StepFlow.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import React, { useCallback, useEffect, useState } from "react"; | ||
import SelectAddAccountMethod from "./SelectAddAccountMethod"; | ||
import ChooseSyncMethod from "LLM/features/WalletSync/screens/Synchronize/ChooseMethod"; | ||
import QrCodeMethod from "LLM/features/WalletSync/screens/Synchronize/QrCodeMethod"; | ||
import { TrackScreen } from "~/analytics"; | ||
import { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets"; | ||
import { Steps } from "../../../types/enum/addAccount"; | ||
import { AnalyticsPage } from "LLM/features/WalletSync/hooks/useLedgerSyncAnalytics"; | ||
|
||
type Props = { | ||
startingStep: Steps; | ||
currency?: CryptoCurrency | TokenCurrency | null; | ||
doesNotHaveAccount?: boolean; | ||
onStepChange?: (step: Steps) => void; | ||
onGoBack?: (callback: () => void) => void; | ||
}; | ||
|
||
const StepFlow = ({ | ||
startingStep, | ||
doesNotHaveAccount, | ||
currency, | ||
onGoBack, | ||
onStepChange, | ||
}: Props) => { | ||
const [currentStep, setCurrentStep] = useState<Steps>(startingStep); | ||
|
||
useEffect(() => { | ||
if (onStepChange) onStepChange(currentStep); | ||
}, [currentStep, onStepChange]); | ||
|
||
const navigateToChooseSyncMethod = () => setCurrentStep(Steps.ChooseSyncMethod); | ||
const navigateToQrCodeMethod = () => setCurrentStep(Steps.QrCodeMethod); | ||
|
||
const getPreviousStep = useCallback( | ||
(step: Steps): Steps => { | ||
switch (step) { | ||
case Steps.QrCodeMethod: | ||
return Steps.ChooseSyncMethod; | ||
case Steps.ChooseSyncMethod: | ||
return Steps.AddAccountMethod; | ||
default: | ||
return startingStep; | ||
} | ||
}, | ||
[startingStep], | ||
); | ||
|
||
useEffect(() => { | ||
if (onGoBack) onGoBack(() => setCurrentStep(prevStep => getPreviousStep(prevStep))); | ||
}, [getPreviousStep, onGoBack]); | ||
|
||
const getScene = () => { | ||
switch (currentStep) { | ||
case Steps.AddAccountMethod: | ||
return ( | ||
<> | ||
<TrackScreen category="Add/Import accounts" type="drawer" /> | ||
<SelectAddAccountMethod | ||
doesNotHaveAccount={doesNotHaveAccount} | ||
currency={currency} | ||
setWalletSyncDrawerVisible={navigateToChooseSyncMethod} | ||
/> | ||
</> | ||
); | ||
case Steps.ChooseSyncMethod: | ||
return ( | ||
<> | ||
<TrackScreen category={AnalyticsPage.ChooseSyncMethod} type="drawer" /> | ||
<ChooseSyncMethod onScanMethodPress={navigateToQrCodeMethod} /> | ||
</> | ||
); | ||
case Steps.QrCodeMethod: | ||
return <QrCodeMethod />; | ||
default: | ||
return null; | ||
} | ||
}; | ||
|
||
return getScene(); | ||
}; | ||
|
||
export default StepFlow; |
65 changes: 30 additions & 35 deletions
65
apps/ledger-live-mobile/src/newArch/features/Accounts/screens/AddAccount/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
apps/ledger-live-mobile/src/newArch/features/Accounts/types/enum/addAccount.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export enum Steps { | ||
AddAccountMethod = "AddAccountMethod", | ||
ChooseSyncMethod = "ChooseSyncMethod", | ||
QrCodeMethod = "QrCodeMethod", | ||
} |
Oops, something went wrong.
3de93cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Bot] Testing with 'Nitrogen' ✅ 3 txs ❌ 1 txs ($2.67) ⏲ 1min 56s
❌ 1 mutation errors
Details of the 4 mutations
Spec Algorand (6)
Details of the 2 uncovered mutations
Spec Algorand (2)
Portfolio ($2.67) – Details of the 1 currencies
TM4WJOS4MZ2TD775W7GSXZMBUF74YT6SKSBXCZY3N7OUIAPXE54MZ5FCD4
Performance ⏲ 1min 56s
Time spent for each spec: (total across mutations)