From e37f29c01ff786bb571749ad994c558a9a39c9d0 Mon Sep 17 00:00:00 2001
From: banklesss <105349292+banklesss@users.noreply.github.com>
Date: Mon, 29 Jul 2024 15:11:22 +0200
Subject: [PATCH 1/4] feature(network-selection): preprod banner (#3461)
---
.../.storybook/storybook.requires.js | 1 +
.../PreprodFaucetBanner.stories.tsx | 7 +
.../ShowBuyBanner/PreprodFaucetBanner.tsx | 111 +++
.../common/ShowBuyBanner/ShowBuyBanner.tsx | 7 +
.../features/Exchange/common/useStrings.tsx | 15 +
.../illustrations/PreprodFaucetBannerLogo.tsx | 742 ++++++++++++++++++
.../DashboardTokensList.tsx | 8 +-
.../src/kernel/i18n/locales/en-US.json | 3 +
.../features/Exchange/common/useStrings.json | 269 ++++---
.../ListAmountsToSendScreen.json | 8 +-
.../DelegationConfirmation.json | 32 -
.../src/yoroi-wallets/utils/format.json | 33 -
12 files changed, 1054 insertions(+), 182 deletions(-)
create mode 100644 apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.stories.tsx
create mode 100644 apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.tsx
create mode 100644 apps/wallet-mobile/src/features/Exchange/illustrations/PreprodFaucetBannerLogo.tsx
diff --git a/apps/wallet-mobile/.storybook/storybook.requires.js b/apps/wallet-mobile/.storybook/storybook.requires.js
index 43e2a175ed..f9e8d4ed9f 100644
--- a/apps/wallet-mobile/.storybook/storybook.requires.js
+++ b/apps/wallet-mobile/.storybook/storybook.requires.js
@@ -133,6 +133,7 @@ const getStories = () => {
"./src/features/Exchange/common/ProviderItem/ProviderItem.stories.tsx": require("../src/features/Exchange/common/ProviderItem/ProviderItem.stories.tsx"),
"./src/features/Exchange/common/ShowBuyBanner/BuyBannerBig.stories.tsx": require("../src/features/Exchange/common/ShowBuyBanner/BuyBannerBig.stories.tsx"),
"./src/features/Exchange/common/ShowBuyBanner/BuyBannerSmall.stories.tsx": require("../src/features/Exchange/common/ShowBuyBanner/BuyBannerSmall.stories.tsx"),
+ "./src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.stories.tsx": require("../src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.stories.tsx"),
"./src/features/Exchange/common/ShowBuyBanner/ShowBuyBanner.stories.tsx": require("../src/features/Exchange/common/ShowBuyBanner/ShowBuyBanner.stories.tsx"),
"./src/features/Exchange/useCases/CreateExchangeOrderScreen/CreateExchangeOrderScreen.stories.tsx": require("../src/features/Exchange/useCases/CreateExchangeOrderScreen/CreateExchangeOrderScreen.stories.tsx"),
"./src/features/Exchange/useCases/CreateExchangeOrderScreen/EditAmount/EditAmount.stories.tsx": require("../src/features/Exchange/useCases/CreateExchangeOrderScreen/EditAmount/EditAmount.stories.tsx"),
diff --git a/apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.stories.tsx b/apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.stories.tsx
new file mode 100644
index 0000000000..a99b7fd7eb
--- /dev/null
+++ b/apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.stories.tsx
@@ -0,0 +1,7 @@
+import {storiesOf} from '@storybook/react-native'
+import React from 'react'
+
+import {PreprodFaucetBanner} from './PreprodFaucetBanner'
+
+storiesOf('Exchange PreprodFaucetBanner', module) //
+ .add('initial', () => )
diff --git a/apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.tsx b/apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.tsx
new file mode 100644
index 0000000000..1a5156405a
--- /dev/null
+++ b/apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/PreprodFaucetBanner.tsx
@@ -0,0 +1,111 @@
+import {useTheme} from '@yoroi/theme'
+import * as React from 'react'
+import {Linking, StyleSheet, Text, View} from 'react-native'
+import LinearGradient from 'react-native-linear-gradient'
+
+import {Button, Spacer} from '../../../../components'
+import {Space} from '../../../../components/Space/Space'
+import {PreprodFaucetBannerLogo} from '../../illustrations/PreprodFaucetBannerLogo'
+import {useStrings} from '../useStrings'
+
+export const PreprodFaucetBanner = () => {
+ const strings = useStrings()
+ const {styles, colors} = useStyles()
+
+ const handleOnPress = () => {
+ Linking.openURL('https://docs.cardano.org/cardano-testnets/tools/faucet/')
+ }
+
+ return (
+ <>
+
+
+
+ {strings.preprodFaucetBannerTitle}
+
+
+
+
+
+
+
+
+ {strings.preprodFaucetBannerText}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ )
+}
+
+const useStyles = () => {
+ const {color, atoms} = useTheme()
+ const styles = StyleSheet.create({
+ root: {
+ backgroundColor: color.bg_color_high,
+ },
+ gradient: {
+ ...atoms.flex_1,
+ opacity: 1,
+ borderRadius: 8,
+ ...atoms.flex_col,
+ },
+ viewTitle: {
+ ...atoms.flex_row,
+ ...atoms.justify_between,
+ ...atoms.flex_1,
+ ...atoms.px_lg,
+ ...atoms.pt_md,
+ },
+ title: {
+ ...atoms.body_1_lg_medium,
+ color: color.gray_cmax,
+ ...atoms.flex_wrap,
+ ...atoms.flex_shrink,
+ },
+ content: {
+ position: 'relative',
+ ...atoms.flex_1,
+ ...atoms.px_lg,
+ ...atoms.pb_lg,
+ },
+ contentInner: {
+ ...atoms.flex_1,
+ },
+ logo: {
+ position: 'absolute',
+ bottom: 0,
+ right: 0,
+ },
+ text: {
+ ...atoms.body_2_md_regular,
+ color: color.gray_cmax,
+ maxWidth: 270,
+ },
+ spaceButton: {
+ maxWidth: 180,
+ },
+ })
+ const colors = {
+ gradientColor: color.bg_gradient_1,
+ gray: color.gray_cmax,
+ }
+ return {styles, colors} as const
+}
diff --git a/apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/ShowBuyBanner.tsx b/apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/ShowBuyBanner.tsx
index 5d945744a1..74b9fa65f0 100644
--- a/apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/ShowBuyBanner.tsx
+++ b/apps/wallet-mobile/src/features/Exchange/common/ShowBuyBanner/ShowBuyBanner.tsx
@@ -1,15 +1,21 @@
+import {Chain} from '@yoroi/types'
import * as React from 'react'
import {useBalances} from '../../../../yoroi-wallets/hooks'
import {Amounts, Quantities} from '../../../../yoroi-wallets/utils/utils'
import {useSelectedWallet} from '../../../WalletManager/common/hooks/useSelectedWallet'
+import {useWalletManager} from '../../../WalletManager/context/WalletManagerProvider'
import {useResetShowBuyBannerSmall} from '../useResetShowBuyBannerSmall'
import {useShowBuyBannerSmall} from '../useShowBuyBannerSmall'
import {BuyBannerBig} from './BuyBannerBig'
import {BuyBannerSmall} from './BuyBannerSmall'
+import {PreprodFaucetBanner} from './PreprodFaucetBanner'
export const ShowBuyBanner = () => {
const {wallet} = useSelectedWallet()
+ const {
+ selected: {network},
+ } = useWalletManager()
const balances = useBalances(wallet)
const primaryAmount = Amounts.getAmount(balances, wallet.primaryTokenInfo.id)
const hasZeroPt = Quantities.isZero(primaryAmount.quantity)
@@ -17,6 +23,7 @@ export const ShowBuyBanner = () => {
const showSmallBanner = useShowBuyBannerSmall()
const {resetShowBuyBannerSmall} = useResetShowBuyBannerSmall()
+ if (hasZeroPt && network === Chain.Network.Preprod) return
if (hasZeroPt) return
if (showSmallBanner) return
diff --git a/apps/wallet-mobile/src/features/Exchange/common/useStrings.tsx b/apps/wallet-mobile/src/features/Exchange/common/useStrings.tsx
index f0d0b61558..a47989f63b 100644
--- a/apps/wallet-mobile/src/features/Exchange/common/useStrings.tsx
+++ b/apps/wallet-mobile/src/features/Exchange/common/useStrings.tsx
@@ -35,6 +35,9 @@ export const useStrings = () => {
ourTrustedPartners: intl.formatMessage(messages.ourTrustedPartners),
needMoreCrypto: intl.formatMessage(messages.needMoreCrypto),
fee: intl.formatMessage(messages.fee),
+ preprodFaucetBannerTitle: intl.formatMessage(messages.preprodFaucetBannerTitle),
+ preprodFaucetBannerText: intl.formatMessage(messages.preprodFaucetBannerText),
+ preprodFaucetBannerButtonText: intl.formatMessage(messages.preprodFaucetBannerButtonText),
close: intl.formatMessage(globalMessages.close),
error: intl.formatMessage(globalMessages.error),
}).current
@@ -156,5 +159,17 @@ export const messages = Object.freeze(
id: 'rampOnOff.createRampOnOff.fee',
defaultMessage: '!!!fee',
},
+ preprodFaucetBannerTitle: {
+ id: 'rampOnOff.createRampOnOff.preprodfaucetbanner.title',
+ defaultMessage: '!!!Get your first test ADA in Yoroi ⭐️',
+ },
+ preprodFaucetBannerText: {
+ id: 'rampOnOff.createRampOnOff.preprodfaucetbanner.text',
+ defaultMessage: '!!!Top up your wallet from the Cardano testnet faucet and unlock the power of test Cardano.',
+ },
+ preprodFaucetBannerButtonText: {
+ id: 'rampOnOff.createRampOnOff.preprodfaucetbanner.button.text',
+ defaultMessage: '!!!Go to tada faucet',
+ },
}),
)
diff --git a/apps/wallet-mobile/src/features/Exchange/illustrations/PreprodFaucetBannerLogo.tsx b/apps/wallet-mobile/src/features/Exchange/illustrations/PreprodFaucetBannerLogo.tsx
new file mode 100644
index 0000000000..f33aefb589
--- /dev/null
+++ b/apps/wallet-mobile/src/features/Exchange/illustrations/PreprodFaucetBannerLogo.tsx
@@ -0,0 +1,742 @@
+import * as React from 'react'
+import Svg, {Defs, Ellipse, LinearGradient, Path, Stop} from 'react-native-svg'
+
+export const PreprodFaucetBannerLogo = () => {
+ return (
+
+ )
+}
diff --git a/apps/wallet-mobile/src/features/Portfolio/useCases/PortfolioDashboard/DashboardTokensList/DashboardTokensList.tsx b/apps/wallet-mobile/src/features/Portfolio/useCases/PortfolioDashboard/DashboardTokensList/DashboardTokensList.tsx
index f79095ecb9..b0cd14dbb2 100644
--- a/apps/wallet-mobile/src/features/Portfolio/useCases/PortfolioDashboard/DashboardTokensList/DashboardTokensList.tsx
+++ b/apps/wallet-mobile/src/features/Portfolio/useCases/PortfolioDashboard/DashboardTokensList/DashboardTokensList.tsx
@@ -1,11 +1,14 @@
import {isPrimaryToken} from '@yoroi/portfolio'
import {useTheme} from '@yoroi/theme'
+import {Chain} from '@yoroi/types'
import * as React from 'react'
import {FlatList, StyleSheet, Text, TouchableOpacity, useWindowDimensions, View} from 'react-native'
import {Icon, Spacer} from '../../../../../components'
import {makeList} from '../../../../../kernel/utils'
+import {PreprodFaucetBanner} from '../../../../Exchange/common/ShowBuyBanner/PreprodFaucetBanner'
import {useSelectedWallet} from '../../../../WalletManager/common/hooks/useSelectedWallet'
+import {useWalletManager} from '../../../../WalletManager/context/WalletManagerProvider'
import {usePortfolioBalances} from '../../../common/hooks/usePortfolioBalances'
import {useGetTokensWithBalance} from '../../../common/useGetTokensWithBalance'
import {useNavigateTo} from '../../../common/useNavigateTo'
@@ -23,6 +26,9 @@ export const DashboardTokensList = () => {
const {isLoading} = useGetTokensWithBalance()
const {wallet} = useSelectedWallet()
const balances = usePortfolioBalances({wallet})
+ const {
+ selected: {network},
+ } = useWalletManager()
const tokensList = React.useMemo(() => balances.fts ?? [], [balances.fts])
const isJustADA = React.useMemo(() => {
@@ -61,7 +67,7 @@ export const DashboardTokensList = () => {
if (isZeroADABalance) {
return (
-
+ {network === Chain.Network.Preprod ? : }
)
}
diff --git a/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json b/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json
index 99059302a0..797092af5c 100644
--- a/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json
+++ b/apps/wallet-mobile/src/kernel/i18n/locales/en-US.json
@@ -1034,6 +1034,9 @@
"rampOnOff.createRampOnOff.minAdaRequired": "Minimum required is 100 ADA",
"rampOnOff.createRampOnOff.sellCurrencyWarning": "You can currently sell only to USD using ACH.",
"rampOnOff.createRampOnOff.fee": "fee",
+ "rampOnOff.createRampOnOff.preprodfaucetbanner.title": "Get your first test ADA in Yoroi ⭐️",
+ "rampOnOff.createRampOnOff.preprodfaucetbanner.text": "Top up your wallet from the Cardano testnet faucet and unlock the power of test Cardano.",
+ "rampOnOff.createRampOnOff.preprodfaucetbanner.button.text": "Go to tada faucet",
"rampOnOff.rampOnOffScreen.rampOnOffTitle": "Buy/Sell ADA",
"rampOnOff.resultRampOnOff.congrats": "Congrats! 🎉 Your transaction is now in progress. You should be receiving funds soon.",
"rampOnOff.resultRampOnOff.cryptoAmountYouGet": "ADA amount you get",
diff --git a/apps/wallet-mobile/translations/messages/src/features/Exchange/common/useStrings.json b/apps/wallet-mobile/translations/messages/src/features/Exchange/common/useStrings.json
index 1b05ec0614..4facc4c82e 100644
--- a/apps/wallet-mobile/translations/messages/src/features/Exchange/common/useStrings.json
+++ b/apps/wallet-mobile/translations/messages/src/features/Exchange/common/useStrings.json
@@ -4,14 +4,14 @@
"defaultMessage": "!!!Current Balance",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 45,
+ "line": 48,
"column": 20,
- "index": 2158
+ "index": 2421
},
"end": {
- "line": 48,
+ "line": 51,
"column": 5,
- "index": 2253
+ "index": 2516
}
},
{
@@ -19,14 +19,14 @@
"defaultMessage": "!!!PROCEED",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 49,
+ "line": 52,
"column": 13,
- "index": 2268
+ "index": 2531
},
"end": {
- "line": 52,
+ "line": 55,
"column": 5,
- "index": 2339
+ "index": 2602
}
},
{
@@ -34,14 +34,14 @@
"defaultMessage": "!!!Disclaimer",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 53,
+ "line": 56,
"column": 16,
- "index": 2357
+ "index": 2620
},
"end": {
- "line": 56,
+ "line": 59,
"column": 5,
- "index": 2453
+ "index": 2716
}
},
{
@@ -49,14 +49,14 @@
"defaultMessage": "!!!Yoroi uses third party web3 on-and-off ramp solution to provide direct Fiat-ADA exchange. By clicking \"Proceed\", you also acknowledge that you will be redirected to our partner's website, where you may be asked to accept their terms and conditions. The third party web3 on-and-off ramp solution may have a certain limitation that will vary depending on your location and your financial institution.",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 57,
+ "line": 60,
"column": 23,
- "index": 2478
+ "index": 2741
},
"end": {
- "line": 61,
+ "line": 64,
"column": 5,
- "index": 2978
+ "index": 3241
}
},
{
@@ -64,14 +64,14 @@
"defaultMessage": "!!!Buy ADA",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 62,
+ "line": 65,
"column": 15,
- "index": 2995
+ "index": 3258
},
"end": {
- "line": 65,
+ "line": 68,
"column": 5,
- "index": 3087
+ "index": 3350
}
},
{
@@ -79,14 +79,14 @@
"defaultMessage": "!!!Sell ADA",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 66,
+ "line": 69,
"column": 16,
- "index": 3105
+ "index": 3368
},
"end": {
- "line": 69,
+ "line": 72,
"column": 5,
- "index": 3199
+ "index": 3462
}
},
{
@@ -94,14 +94,14 @@
"defaultMessage": "!!!ADA amount",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 70,
+ "line": 73,
"column": 17,
- "index": 3218
+ "index": 3481
},
"end": {
- "line": 73,
+ "line": 76,
"column": 5,
- "index": 3315
+ "index": 3578
}
},
{
@@ -109,14 +109,14 @@
"defaultMessage": "!!!Provider Fee",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 74,
+ "line": 77,
"column": 17,
- "index": 3334
+ "index": 3597
},
"end": {
- "line": 77,
+ "line": 80,
"column": 5,
- "index": 3433
+ "index": 3696
}
},
{
@@ -124,14 +124,14 @@
"defaultMessage": "!!!Provider",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 78,
+ "line": 81,
"column": 14,
- "index": 3449
+ "index": 3712
},
"end": {
- "line": 81,
+ "line": 84,
"column": 5,
- "index": 3541
+ "index": 3804
}
},
{
@@ -139,14 +139,14 @@
"defaultMessage": "!!!Banxa",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 82,
+ "line": 85,
"column": 11,
- "index": 3554
+ "index": 3817
},
"end": {
- "line": 85,
+ "line": 88,
"column": 5,
- "index": 3640
+ "index": 3903
}
},
{
@@ -154,14 +154,14 @@
"defaultMessage": "!!!Exchange ADA",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 86,
+ "line": 89,
"column": 11,
- "index": 3653
+ "index": 3916
},
"end": {
- "line": 89,
+ "line": 92,
"column": 5,
- "index": 3730
+ "index": 3993
}
},
{
@@ -169,14 +169,14 @@
"defaultMessage": "!!!Not Enough Balannce",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 90,
+ "line": 93,
"column": 22,
- "index": 3754
+ "index": 4017
},
"end": {
- "line": 93,
+ "line": 96,
"column": 5,
- "index": 3855
+ "index": 4118
}
},
{
@@ -184,14 +184,14 @@
"defaultMessage": "!!!Minimum required is 100 ADA",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 94,
+ "line": 97,
"column": 20,
- "index": 3877
+ "index": 4140
},
"end": {
- "line": 97,
+ "line": 100,
"column": 5,
- "index": 3994
+ "index": 4257
}
},
{
@@ -199,14 +199,14 @@
"defaultMessage": "!!!You can currently sell only to USD using ACH.",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 98,
+ "line": 101,
"column": 25,
- "index": 4021
+ "index": 4284
},
"end": {
- "line": 101,
+ "line": 104,
"column": 5,
- "index": 4161
+ "index": 4424
}
},
{
@@ -214,14 +214,14 @@
"defaultMessage": "!!!Congrats🎉 Your ADA will come in a few minutes",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 102,
+ "line": 105,
"column": 14,
- "index": 4177
+ "index": 4440
},
"end": {
- "line": 105,
+ "line": 108,
"column": 5,
- "index": 4307
+ "index": 4570
}
},
{
@@ -229,14 +229,14 @@
"defaultMessage": "!!!ADA amount you get",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 106,
+ "line": 109,
"column": 24,
- "index": 4333
+ "index": 4596
},
"end": {
- "line": 109,
+ "line": 112,
"column": 5,
- "index": 4445
+ "index": 4708
}
},
{
@@ -244,14 +244,14 @@
"defaultMessage": "!!!Fiat amount you sell",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 110,
+ "line": 113,
"column": 22,
- "index": 4469
+ "index": 4732
},
"end": {
- "line": 113,
+ "line": 116,
"column": 5,
- "index": 4581
+ "index": 4844
}
},
{
@@ -259,14 +259,14 @@
"defaultMessage": "!!!GO TO TRANSACTIONS",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 114,
+ "line": 117,
"column": 22,
- "index": 4605
+ "index": 4868
},
"end": {
- "line": 117,
+ "line": 120,
"column": 5,
- "index": 4715
+ "index": 4978
}
},
{
@@ -274,14 +274,14 @@
"defaultMessage": "!!!Buy ADA/Sell transaction",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 118,
+ "line": 121,
"column": 19,
- "index": 4736
+ "index": 4999
},
"end": {
- "line": 121,
+ "line": 124,
"column": 5,
- "index": 4849
+ "index": 5112
}
},
{
@@ -289,14 +289,14 @@
"defaultMessage": "!!!Normally the Buy ADA/Sell transaction takes 3-5 of minutes for the order to be fulfilled. However, there are instances where the order cannot be fulfilled instantly because the compliance team can be doing a manual verification of the KYC docs or any other issues.",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 122,
+ "line": 125,
"column": 38,
- "index": 4889
+ "index": 5152
},
"end": {
- "line": 126,
+ "line": 129,
"column": 5,
- "index": 5269
+ "index": 5532
}
},
{
@@ -304,14 +304,14 @@
"defaultMessage": "!!!Contact",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 127,
+ "line": 130,
"column": 13,
- "index": 5284
+ "index": 5547
},
"end": {
- "line": 130,
+ "line": 133,
"column": 5,
- "index": 5374
+ "index": 5637
}
},
{
@@ -319,14 +319,14 @@
"defaultMessage": "!!!and",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 131,
+ "line": 134,
"column": 9,
- "index": 5385
+ "index": 5648
},
"end": {
- "line": 134,
+ "line": 137,
"column": 5,
- "index": 5467
+ "index": 5730
}
},
{
@@ -334,14 +334,14 @@
"defaultMessage": "!!!Yoroi Customer Support",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 135,
+ "line": 138,
"column": 21,
- "index": 5490
+ "index": 5753
},
"end": {
- "line": 138,
+ "line": 141,
"column": 5,
- "index": 5603
+ "index": 5866
}
},
{
@@ -349,14 +349,14 @@
"defaultMessage": "!!!if you witnessed any significant transaction delays or errors.",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 139,
+ "line": 142,
"column": 17,
- "index": 5622
+ "index": 5885
},
"end": {
- "line": 142,
+ "line": 145,
"column": 5,
- "index": 5771
+ "index": 6034
}
},
{
@@ -364,14 +364,14 @@
"defaultMessage": "!!!Welcome to Yoroi 👋️\nGet your first ADA fast & easy",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 143,
+ "line": 146,
"column": 20,
- "index": 5793
+ "index": 6056
},
"end": {
- "line": 146,
+ "line": 149,
"column": 5,
- "index": 5935
+ "index": 6198
}
},
{
@@ -379,14 +379,14 @@
"defaultMessage": "!!!Top up your wallet safely using our trusted partners",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 147,
+ "line": 150,
"column": 24,
- "index": 5961
+ "index": 6224
},
"end": {
- "line": 150,
+ "line": 153,
"column": 5,
- "index": 6107
+ "index": 6370
}
},
{
@@ -394,14 +394,14 @@
"defaultMessage": "!!!Need more ADA for staking or swap?",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 151,
+ "line": 154,
"column": 20,
- "index": 6129
+ "index": 6392
},
"end": {
- "line": 154,
+ "line": 157,
"column": 5,
- "index": 6253
+ "index": 6516
}
},
{
@@ -409,14 +409,59 @@
"defaultMessage": "!!!fee",
"file": "src/features/Exchange/common/useStrings.tsx",
"start": {
- "line": 155,
+ "line": 158,
"column": 9,
- "index": 6264
+ "index": 6527
},
"end": {
- "line": 158,
+ "line": 161,
+ "column": 5,
+ "index": 6609
+ }
+ },
+ {
+ "id": "rampOnOff.createRampOnOff.preprodfaucetbanner.title",
+ "defaultMessage": "!!!Get your first test ADA in Yoroi ⭐️",
+ "file": "src/features/Exchange/common/useStrings.tsx",
+ "start": {
+ "line": 162,
+ "column": 30,
+ "index": 6641
+ },
+ "end": {
+ "line": 165,
+ "column": 5,
+ "index": 6777
+ }
+ },
+ {
+ "id": "rampOnOff.createRampOnOff.preprodfaucetbanner.text",
+ "defaultMessage": "!!!Top up your wallet from the Cardano testnet faucet and unlock the power of test Cardano.",
+ "file": "src/features/Exchange/common/useStrings.tsx",
+ "start": {
+ "line": 166,
+ "column": 29,
+ "index": 6808
+ },
+ "end": {
+ "line": 169,
+ "column": 5,
+ "index": 6996
+ }
+ },
+ {
+ "id": "rampOnOff.createRampOnOff.preprodfaucetbanner.button.text",
+ "defaultMessage": "!!!Go to tada faucet",
+ "file": "src/features/Exchange/common/useStrings.tsx",
+ "start": {
+ "line": 170,
+ "column": 35,
+ "index": 7033
+ },
+ "end": {
+ "line": 173,
"column": 5,
- "index": 6346
+ "index": 7157
}
}
]
\ No newline at end of file
diff --git a/apps/wallet-mobile/translations/messages/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.json b/apps/wallet-mobile/translations/messages/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.json
index 96e152d747..8a5d561ca3 100644
--- a/apps/wallet-mobile/translations/messages/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.json
+++ b/apps/wallet-mobile/translations/messages/src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.json
@@ -4,14 +4,14 @@
"defaultMessage": "!!!Add token",
"file": "src/features/Send/useCases/ListAmountsToSend/ListAmountsToSendScreen.tsx",
"start": {
- "line": 206,
+ "line": 204,
"column": 12,
- "index": 6430
+ "index": 6425
},
"end": {
- "line": 209,
+ "line": 207,
"column": 3,
- "index": 6507
+ "index": 6502
}
}
]
\ No newline at end of file
diff --git a/apps/wallet-mobile/translations/messages/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.json b/apps/wallet-mobile/translations/messages/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.json
index 13a1427ae5..3dd9b560aa 100644
--- a/apps/wallet-mobile/translations/messages/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.json
+++ b/apps/wallet-mobile/translations/messages/src/legacy/Staking/DelegationConfirmation/DelegationConfirmation.json
@@ -6,20 +6,12 @@
"start": {
"line": 191,
"column": 23,
-<<<<<<< Updated upstream
- "index": 6261
-=======
"index": 6268
->>>>>>> Stashed changes
},
"end": {
"line": 194,
"column": 3,
-<<<<<<< Updated upstream
- "index": 6375
-=======
"index": 6382
->>>>>>> Stashed changes
}
},
{
@@ -29,20 +21,12 @@
"start": {
"line": 195,
"column": 10,
-<<<<<<< Updated upstream
- "index": 6387
-=======
"index": 6394
->>>>>>> Stashed changes
},
"end": {
"line": 198,
"column": 3,
-<<<<<<< Updated upstream
- "index": 6487
-=======
"index": 6494
->>>>>>> Stashed changes
}
},
{
@@ -52,20 +36,12 @@
"start": {
"line": 199,
"column": 22,
-<<<<<<< Updated upstream
- "index": 6511
-=======
"index": 6518
->>>>>>> Stashed changes
},
"end": {
"line": 202,
"column": 3,
-<<<<<<< Updated upstream
- "index": 6681
-=======
"index": 6688
->>>>>>> Stashed changes
}
},
{
@@ -75,20 +51,12 @@
"start": {
"line": 203,
"column": 15,
-<<<<<<< Updated upstream
- "index": 6698
-=======
"index": 6705
->>>>>>> Stashed changes
},
"end": {
"line": 206,
"column": 3,
-<<<<<<< Updated upstream
- "index": 6817
-=======
"index": 6824
->>>>>>> Stashed changes
}
}
]
\ No newline at end of file
diff --git a/apps/wallet-mobile/translations/messages/src/yoroi-wallets/utils/format.json b/apps/wallet-mobile/translations/messages/src/yoroi-wallets/utils/format.json
index e93fa8b724..94db0a6297 100644
--- a/apps/wallet-mobile/translations/messages/src/yoroi-wallets/utils/format.json
+++ b/apps/wallet-mobile/translations/messages/src/yoroi-wallets/utils/format.json
@@ -4,16 +4,6 @@
"defaultMessage": "!!!Today",
"file": "src/yoroi-wallets/utils/format.ts",
"start": {
-<<<<<<< Updated upstream
- "line": 228,
- "column": 9,
- "index": 7585
- },
- "end": {
- "line": 241,
- "column": 3,
- "index": 7351
-=======
"line": 237,
"column": 9,
"index": 7555
@@ -22,7 +12,6 @@
"line": 240,
"column": 3,
"index": 7622
->>>>>>> Stashed changes
}
},
{
@@ -30,16 +19,6 @@
"defaultMessage": "!!!Yesterday",
"file": "src/yoroi-wallets/utils/format.ts",
"start": {
-<<<<<<< Updated upstream
- "line": 232,
- "column": 13,
- "index": 7667
- },
- "end": {
- "line": 245,
- "column": 3,
- "index": 7441
-=======
"line": 241,
"column": 13,
"index": 7637
@@ -48,7 +27,6 @@
"line": 244,
"column": 3,
"index": 7712
->>>>>>> Stashed changes
}
},
{
@@ -56,16 +34,6 @@
"defaultMessage": "!!![Unknown asset name]",
"file": "src/yoroi-wallets/utils/format.ts",
"start": {
-<<<<<<< Updated upstream
- "line": 236,
- "column": 20,
- "index": 7764
- },
- "end": {
- "line": 249,
- "column": 3,
- "index": 7556
-=======
"line": 245,
"column": 20,
"index": 7734
@@ -74,7 +42,6 @@
"line": 248,
"column": 3,
"index": 7827
->>>>>>> Stashed changes
}
}
]
\ No newline at end of file
From 6c5398615a92893e9dbb30bd4b2e6917b130c0ed Mon Sep 17 00:00:00 2001
From: Michal S
Date: Mon, 29 Jul 2024 14:12:14 +0100
Subject: [PATCH 2/4] fix(wallet-mobile): Fix TX details query error (#3463)
---
.../Discover/useCases/ReviewTransaction/ReviewTransaction.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/wallet-mobile/src/features/Discover/useCases/ReviewTransaction/ReviewTransaction.tsx b/apps/wallet-mobile/src/features/Discover/useCases/ReviewTransaction/ReviewTransaction.tsx
index e6e9aa0789..e2bb13f90a 100644
--- a/apps/wallet-mobile/src/features/Discover/useCases/ReviewTransaction/ReviewTransaction.tsx
+++ b/apps/wallet-mobile/src/features/Discover/useCases/ReviewTransaction/ReviewTransaction.tsx
@@ -186,7 +186,7 @@ const getTxDetails = async (cbor: string): Promise => {
}
const useTxDetails = (cbor: string) => {
- return useQuery({queryFn: () => getTxDetails(cbor)})
+ return useQuery({queryFn: () => getTxDetails(cbor), queryKey: ['txDetails', cbor]})
}
const useFormattedTransaction = (cbor: string) => {
From 2c47b6353555b59c431b418f03969326365d4c87 Mon Sep 17 00:00:00 2001
From: banklesss <105349292+banklesss@users.noreply.github.com>
Date: Mon, 29 Jul 2024 15:14:55 +0200
Subject: [PATCH 3/4] fix(tx-list): updating with new txs (#3464)
---
.../features/Transactions/useCases/TxList/TxList.tsx | 12 ++++++++++--
apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts | 2 +-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/apps/wallet-mobile/src/features/Transactions/useCases/TxList/TxList.tsx b/apps/wallet-mobile/src/features/Transactions/useCases/TxList/TxList.tsx
index 4367224cec..ad4ce086ef 100644
--- a/apps/wallet-mobile/src/features/Transactions/useCases/TxList/TxList.tsx
+++ b/apps/wallet-mobile/src/features/Transactions/useCases/TxList/TxList.tsx
@@ -18,12 +18,20 @@ export const TxList = (props: Props) => {
const {wallet} = useSelectedWallet()
const filter = useTxFilter()
- const transactions = useTransactionInfos({wallet})
- const filteredTransactions = React.useMemo(() => filterTransactions(transactions, filter), [transactions, filter])
+ const transactionInfos = useTransactionInfos({wallet})
+ const filteredTransactions = React.useMemo(
+ () => filterTransactions(transactionInfos, filter),
+ [transactionInfos, filter],
+ )
const [loadedTxs, setLoadedTxs] = React.useState(filteredTransactions.slice(0, batchSize))
const [currentIndex, setCurrentIndex] = React.useState(batchSize)
+ React.useEffect(() => {
+ setLoadedTxs(filteredTransactions.slice(0, batchSize))
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [transactionInfos]) // must be transactionInfos
+
const handleOnEndReached = React.useCallback(() => {
if (currentIndex >= filteredTransactions.length) return
const nextBatch = filteredTransactions.slice(currentIndex, currentIndex + batchSize)
diff --git a/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts b/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts
index dd2c9a69b1..d86a2d0555 100644
--- a/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts
+++ b/apps/wallet-mobile/src/yoroi-wallets/hooks/index.ts
@@ -471,7 +471,7 @@ export const useTransactionInfos = ({wallet}: {wallet: YoroiWallet}) => {
const unsubscribe = wallet.subscribe((event) => {
if (event.type !== 'transactions') return
- setTransactionInfos(wallet.transactions)
+ setTransactionInfos(() => wallet.transactions)
})
return () => unsubscribe?.()
}, [wallet])
From 998c61e14cd4f4560388b182259e94b833a83f3a Mon Sep 17 00:00:00 2001
From: banklesss <105349292+banklesss@users.noreply.github.com>
Date: Tue, 30 Jul 2024 09:56:49 +0200
Subject: [PATCH 4/4] refactor(tx-list): list load (#3469)
---
.../src/features/Transactions/useCases/TxList/TxList.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/apps/wallet-mobile/src/features/Transactions/useCases/TxList/TxList.tsx b/apps/wallet-mobile/src/features/Transactions/useCases/TxList/TxList.tsx
index ad4ce086ef..a06d5d3200 100644
--- a/apps/wallet-mobile/src/features/Transactions/useCases/TxList/TxList.tsx
+++ b/apps/wallet-mobile/src/features/Transactions/useCases/TxList/TxList.tsx
@@ -28,7 +28,7 @@ export const TxList = (props: Props) => {
const [currentIndex, setCurrentIndex] = React.useState(batchSize)
React.useEffect(() => {
- setLoadedTxs(filteredTransactions.slice(0, batchSize))
+ setLoadedTxs(filteredTransactions.slice(0, currentIndex + batchSize))
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [transactionInfos]) // must be transactionInfos