Skip to content

Commit

Permalink
LIVE-3509 - LLM Deeplinks updated for buy/sell live apps flow
Browse files Browse the repository at this point in the history
  • Loading branch information
LFBarreto committed Sep 6, 2022
1 parent 8902c01 commit 8186d2e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-windows-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"live-mobile": patch
---

LLM - Deeplinks updated for buy sell flows with live apps
6 changes: 6 additions & 0 deletions apps/ledger-live-mobile/docs/linking.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ They all are prefixed by **_ledgerlive://_**

`ledgerlive://buy/bitcoin` will redirect to buy page with bitcoin accounts search prefilled

- **_sell/:currency_** 🠒 Sell Crypto Flow

`ledgerlive://sell` will redirect to sell page

`ledgerlive://sell/bitcoin` will redirect to sell page with bitcoin accounts search prefilled

- **_manager_** 🠒 Manager page

`ledgerlive://manager` will redirect to manager page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createStackNavigator } from "@react-navigation/stack";
import { useTheme } from "styled-components/native";
import { Icons, Flex } from "@ledgerhq/native-ui";
import { useFeature } from "@ledgerhq/live-common/featureFlags/index";
import { findCryptoCurrencyByKeyword } from "@ledgerhq/live-common/currencies/index";
import { ScreenName } from "../../const";
import { getStackNavigatorConfig } from "../../navigation/navigatorConfig";

Expand Down Expand Up @@ -46,7 +47,10 @@ export default function ExchangeLiveAppNavigator({ route }: any) {
platform:
ptxSmartRoutingMobile?.params?.liveAppId || "multibuy",
mode: "buy",
currency: _props.route.params?.defaultCurrencyId,
currency: _props.route.params?.currency
? findCryptoCurrencyByKeyword(_props.route.params?.currency)
?.id
: _props.route.params?.defaultCurrencyId,
account: _props.route.params?.defaultAccountId,
},
}}
Expand Down Expand Up @@ -75,7 +79,10 @@ export default function ExchangeLiveAppNavigator({ route }: any) {
platform:
ptxSmartRoutingMobile?.params?.liveAppId || "multibuy",
mode: "sell",
currency: _props.route.params?.defaultCurrencyId,
currency: _props.route.params?.currency
? findCryptoCurrencyByKeyword(_props.route.params?.currency)
?.id
: _props.route.params?.defaultCurrencyId,
account: _props.route.params?.defaultAccountId,
},
}}
Expand Down
1 change: 1 addition & 0 deletions apps/ledger-live-mobile/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ const linkingOptions = {
initialRouteName: "buy",
screens: {
[ScreenName.ExchangeBuy]: "buy/:currency?",
[ScreenName.ExchangeSell]: "sell/:currency?",
},
},

Expand Down

0 comments on commit 8186d2e

Please sign in to comment.