From 9680f81e7ac3a7f40b08e16da49d5a497363bdad Mon Sep 17 00:00:00 2001 From: Juliano Lazzarotto <30806844+stackchain@users.noreply.github.com> Date: Fri, 4 Oct 2024 20:34:50 +0100 Subject: [PATCH] chore(wallet-mobile): sharing yoroi link and no longer cardano link --- .../components/ShareQRCodeCard/ShareQRCodeCard.tsx | 5 ++++- .../Receive/useCases/RequestSpecificAmountScreen.tsx | 12 ++++++++---- .../wallet-mobile/src/kernel/i18n/locales/en-US.json | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/apps/wallet-mobile/src/components/ShareQRCodeCard/ShareQRCodeCard.tsx b/apps/wallet-mobile/src/components/ShareQRCodeCard/ShareQRCodeCard.tsx index 55c55c85b4..70728ff47e 100644 --- a/apps/wallet-mobile/src/components/ShareQRCodeCard/ShareQRCodeCard.tsx +++ b/apps/wallet-mobile/src/components/ShareQRCodeCard/ShareQRCodeCard.tsx @@ -66,7 +66,7 @@ export const ShareQRCodeCard = ({ if (isSharing) return ( - + ) @@ -128,6 +128,9 @@ const useStyles = () => { addressContainer: { alignItems: 'center', }, + shot: { + height: 308, + }, card: { ...atoms.gap_lg, minHeight: 432, diff --git a/apps/wallet-mobile/src/features/Receive/useCases/RequestSpecificAmountScreen.tsx b/apps/wallet-mobile/src/features/Receive/useCases/RequestSpecificAmountScreen.tsx index 87cf8f3fc2..73bf9ca721 100644 --- a/apps/wallet-mobile/src/features/Receive/useCases/RequestSpecificAmountScreen.tsx +++ b/apps/wallet-mobile/src/features/Receive/useCases/RequestSpecificAmountScreen.tsx @@ -1,5 +1,5 @@ import {useFocusEffect} from '@react-navigation/native' -import {configCardanoLegacyTransfer, linksCardanoModuleMaker} from '@yoroi/links' +import {configCardanoLegacyTransfer, linksCardanoModuleMaker, linksYoroiModuleMaker} from '@yoroi/links' import {useTheme} from '@yoroi/theme' import * as React from 'react' import {ScrollView as RNScrollView, StyleSheet, Text, useWindowDimensions, View} from 'react-native' @@ -99,20 +99,24 @@ const Modal = ({amount, address}: {amount: string; address: string}) => { const {track} = useMetrics() const cardanoLinks = linksCardanoModuleMaker() - const requestData = cardanoLinks.create({ + const cardanoRequestLink = cardanoLinks.create({ config: configCardanoLegacyTransfer, params: { address: address, amount: Number(amount), }, }) + const yoroiLinks = linksYoroiModuleMaker('yoroi') + const yoroiPaymentRequestLink = yoroiLinks.transfer.request.adaWithLink({ + link: cardanoRequestLink.link, + }) const { wallet: {portfolioPrimaryTokenInfo}, } = useSelectedWallet() const hasAmount = !isEmptyString(amount) const hasAddress = !isEmptyString(address) - const content = hasAmount ? requestData.link : address + const content = hasAmount ? yoroiPaymentRequestLink : address const title = hasAmount ? `${amount} ${portfolioPrimaryTokenInfo.ticker.toLocaleUpperCase()}` : '' const [isCopying, copy] = useCopy() @@ -124,7 +128,7 @@ const Modal = ({amount, address}: {amount: string; address: string}) => { {hasAddress ? (