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} + + + +