From c93c0f34844191d1e73739ace6c20d8afd7aebde Mon Sep 17 00:00:00 2001 From: Chelsea Sanders Date: Thu, 3 Aug 2023 15:10:01 +0100 Subject: [PATCH] feat: Update Web PTX Player to load correct manifest --- .changeset/cold-walls-poke.md | 8 + .../src/renderer/Default.tsx | 2 +- .../components/BalanceInfos/index.tsx | 12 +- .../src/renderer/components/BuyButton.tsx | 24 +- .../ContextMenu/AccountContextMenu.tsx | 34 +- .../PerCurrencySelectAccount/Option.tsx | 123 -- .../PerCurrencySelectAccount/index.tsx | 116 -- .../components/SelectAccountAndCurrency.tsx | 159 -- .../components/Web3AppWebview/helpers.ts | 33 +- .../components/WebPTXPlayer/TopBar.tsx | 79 +- .../src/renderer/hooks/useDeeplinking.ts | 3 + .../screens/account/AccountHeaderActions.tsx | 25 +- .../screens/account/EmptyStateAccount.tsx | 22 +- .../asset/AssetBalanceSummaryHeader.tsx | 21 +- .../renderer/screens/exchange/Buy/index.tsx | 105 -- .../screens/exchange/ProviderList.tsx | 247 --- .../renderer/screens/exchange/Sell/index.tsx | 109 -- .../src/renderer/screens/exchange/hooks.ts | 54 - .../src/renderer/screens/exchange/index.tsx | 95 +- .../screens/market/MarketCoinScreen/index.tsx | 26 +- .../renderer/screens/market/MarketRowItem.tsx | 26 +- .../src/renderer/storage.ts | 6 + .../tests/specs/services/buy.spec.ts | 4 - .../RootNavigator/BaseNavigator.tsx | 43 +- .../ExchangeLiveAppNavigator.tsx | 24 +- .../RootNavigator/ExchangeNavigator.tsx | 52 - .../RootNavigator/ExchangeStackNavigator.tsx | 40 - .../RootNavigator/types/BaseNavigator.ts | 6 +- .../types/ExchangeLiveAppNavigator.ts | 20 +- .../RootNavigator/types/ExchangeNavigator.ts | 22 +- .../Web3AppWebview/PlatformAPIWebview.tsx | 4 +- .../src/components/Web3AppWebview/helpers.ts | 15 +- .../src/components/WebPTXPlayer/index.tsx | 122 +- .../ledger-live-mobile/src/icons/ApplePay.tsx | 18 - .../src/icons/DropdownArrow.tsx | 18 - .../src/icons/GooglePay.tsx | 42 - apps/ledger-live-mobile/src/icons/Maestro.tsx | 95 - .../src/icons/MasterCard.tsx | 23 - apps/ledger-live-mobile/src/icons/PayPal.tsx | 38 - apps/ledger-live-mobile/src/icons/Sepa.tsx | 119 -- apps/ledger-live-mobile/src/icons/Visa.tsx | 31 - .../src/screens/Exchange/Buy.tsx | 96 -- .../src/screens/Exchange/ProviderList.tsx | 227 --- .../src/screens/Exchange/ProviderView.tsx | 55 - .../src/screens/Exchange/ScreenHeader.tsx | 28 - .../src/screens/Exchange/SelectAccount.tsx | 313 ---- .../Exchange/SelectAccountCurrency.tsx | 265 --- .../src/screens/Exchange/SelectCurrency.tsx | 149 -- .../src/screens/Exchange/Sell.tsx | 83 - .../src/screens/Exchange/hooks.ts | 184 -- .../src/screens/PTX/BuyAndSell/index.tsx | 6 +- .../src/featureFlags/defaultFeatures.ts | 6 - .../src/wallet-api/constants.ts | 4 + .../src/wallet-api/helpers.ts | 48 + libs/ledgerjs/packages/types-live/README.md | 2 +- .../packages/types-live/src/feature.ts | 6 +- .../turborepo-gh-cache/build/server.js | 1524 +++++++++++++---- 57 files changed, 1520 insertions(+), 3541 deletions(-) create mode 100644 .changeset/cold-walls-poke.md delete mode 100644 apps/ledger-live-desktop/src/renderer/components/PerCurrencySelectAccount/Option.tsx delete mode 100644 apps/ledger-live-desktop/src/renderer/components/PerCurrencySelectAccount/index.tsx delete mode 100644 apps/ledger-live-desktop/src/renderer/components/SelectAccountAndCurrency.tsx delete mode 100644 apps/ledger-live-desktop/src/renderer/screens/exchange/Buy/index.tsx delete mode 100644 apps/ledger-live-desktop/src/renderer/screens/exchange/ProviderList.tsx delete mode 100644 apps/ledger-live-desktop/src/renderer/screens/exchange/Sell/index.tsx delete mode 100644 apps/ledger-live-desktop/src/renderer/screens/exchange/hooks.ts delete mode 100644 apps/ledger-live-mobile/src/components/RootNavigator/ExchangeNavigator.tsx delete mode 100644 apps/ledger-live-mobile/src/components/RootNavigator/ExchangeStackNavigator.tsx delete mode 100644 apps/ledger-live-mobile/src/icons/ApplePay.tsx delete mode 100644 apps/ledger-live-mobile/src/icons/DropdownArrow.tsx delete mode 100644 apps/ledger-live-mobile/src/icons/GooglePay.tsx delete mode 100644 apps/ledger-live-mobile/src/icons/Maestro.tsx delete mode 100644 apps/ledger-live-mobile/src/icons/MasterCard.tsx delete mode 100644 apps/ledger-live-mobile/src/icons/PayPal.tsx delete mode 100644 apps/ledger-live-mobile/src/icons/Sepa.tsx delete mode 100644 apps/ledger-live-mobile/src/icons/Visa.tsx delete mode 100644 apps/ledger-live-mobile/src/screens/Exchange/Buy.tsx delete mode 100644 apps/ledger-live-mobile/src/screens/Exchange/ProviderList.tsx delete mode 100644 apps/ledger-live-mobile/src/screens/Exchange/ProviderView.tsx delete mode 100644 apps/ledger-live-mobile/src/screens/Exchange/ScreenHeader.tsx delete mode 100644 apps/ledger-live-mobile/src/screens/Exchange/SelectAccount.tsx delete mode 100644 apps/ledger-live-mobile/src/screens/Exchange/SelectAccountCurrency.tsx delete mode 100644 apps/ledger-live-mobile/src/screens/Exchange/SelectCurrency.tsx delete mode 100644 apps/ledger-live-mobile/src/screens/Exchange/Sell.tsx delete mode 100644 apps/ledger-live-mobile/src/screens/Exchange/hooks.ts diff --git a/.changeset/cold-walls-poke.md b/.changeset/cold-walls-poke.md new file mode 100644 index 000000000000..5d752da87212 --- /dev/null +++ b/.changeset/cold-walls-poke.md @@ -0,0 +1,8 @@ +--- +"ledger-live-desktop": minor +"live-mobile": minor +"@ledgerhq/live-common": minor +--- + +- Update WebPTXPlayer to load correct manifest +- Remove unused LL BUY/SELL in favour of BUY/SELL Live App diff --git a/apps/ledger-live-desktop/src/renderer/Default.tsx b/apps/ledger-live-desktop/src/renderer/Default.tsx index 42b8c7ad0ee0..e8734f1b6045 100644 --- a/apps/ledger-live-desktop/src/renderer/Default.tsx +++ b/apps/ledger-live-desktop/src/renderer/Default.tsx @@ -248,7 +248,7 @@ export default function Default() { /> - + { setTrackingSource("Page Portfolio"); history.push({ pathname: "/exchange", - state: ptxSmartRouting?.enabled - ? { - mode: "buy", // buy or sell - } - : undefined, + state: { + mode: "buy", // buy or sell + }, }); - }, [history, ptxSmartRouting]); + }, [history]); const onSwap = useCallback(() => { setTrackingSource("Page Portfolio"); history.push({ diff --git a/apps/ledger-live-desktop/src/renderer/components/BuyButton.tsx b/apps/ledger-live-desktop/src/renderer/components/BuyButton.tsx index c71065eafa33..26818e0cd1f2 100644 --- a/apps/ledger-live-desktop/src/renderer/components/BuyButton.tsx +++ b/apps/ledger-live-desktop/src/renderer/components/BuyButton.tsx @@ -8,34 +8,28 @@ import { Account } from "@ledgerhq/types-live"; import { CryptoCurrency } from "@ledgerhq/types-cryptoassets"; import { setTrackingSource } from "~/renderer/analytics/TrackPage"; import { isCurrencySupported } from "~/renderer/screens/exchange/config"; -import { useFeature } from "@ledgerhq/live-common/featureFlags/index"; + const BuyButton = ({ currency, account }: { currency: CryptoCurrency; account: Account }) => { const history = useHistory(); const dispatch = useDispatch(); - // PTX smart routing feature flag - buy sell live app flag - const ptxSmartRouting = useFeature("ptxSmartRouting"); const onClick = useCallback(() => { dispatch(closeAllModal()); setTrackingSource("send flow"); history.push({ pathname: "/exchange", - state: ptxSmartRouting?.enabled - ? { - currency: currency.id, - account: account.id, - mode: "buy", // buy or sell - } - : { - tab: 0, - defaultCurrency: currency, - defaultAccount: account, - }, + state: { + currency: currency.id, + account: account.id, + mode: "buy", // buy or sell + }, }); - }, [account, currency, dispatch, history, ptxSmartRouting]); + }, [account, currency, dispatch, history]); + if (!isCurrencySupported("BUY", currency)) { return null; } + return (