diff --git a/src/components/composite/Button/CopyToClipboard.tsx b/src/components/composite/Button/CopyToClipboard.tsx index 635cd55c2..5247ba3e1 100644 --- a/src/components/composite/Button/CopyToClipboard.tsx +++ b/src/components/composite/Button/CopyToClipboard.tsx @@ -1,5 +1,6 @@ -import React, { useReducer } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import * as Clipboard from 'expo-clipboard'; +import { useTranslation } from 'react-i18next'; import { TextProps } from '@components/base/Text/Text.types'; import { Button, Row, Spacer, Text } from '@components/base'; import { ClipboardFilledIcon, IconProps } from '@components/svg/icons'; @@ -11,7 +12,6 @@ import { ToastType } from '@components/modular/Toast'; import { BaseButtonProps } from '@components/base/Button'; -import { useTranslation } from 'react-i18next'; export interface CopyToClipboardButtonProps extends Omit { @@ -42,10 +42,22 @@ export const CopyToClipboardButton = ( ...buttonProps } = props; const { t } = useTranslation(); - const [copied, toggleCopied] = useReducer((flag) => !flag, false); + const [copied, setCopied] = useState(false); + const timeout = useRef(); + + useEffect(() => { + return () => { + if (timeout.current) { + clearTimeout(timeout.current); + } + }; + }, []); const onPress = async () => { - toggleCopied(); + if (timeout.current) { + clearTimeout(timeout.current); + } + setCopied(true); if (showToast) { Toast.show({ text: t('common.copied'), @@ -55,14 +67,19 @@ export const CopyToClipboardButton = ( }); } await Clipboard.setStringAsync(textToCopy || textToDisplay); - setTimeout(() => { - toggleCopied(); + timeout.current = setTimeout(() => { + setCopied(false); }, 2500); }; if (pressableText) { return ( - diff --git a/src/components/templates/ExplorerAccount/styles.ts b/src/components/templates/ExplorerAccount/styles.ts index 522b9be26..02b263618 100644 --- a/src/components/templates/ExplorerAccount/styles.ts +++ b/src/components/templates/ExplorerAccount/styles.ts @@ -7,9 +7,8 @@ export const styles = StyleSheet.create({ paddingRight: scale(18) }, actionButton: { - paddingVertical: verticalScale(4), - paddingLeft: scale(12), - paddingRight: scale(8), + paddingVertical: verticalScale(6), + paddingHorizontal: scale(12), alignSelf: 'flex-start', minHeight: verticalScale(24) } diff --git a/src/localization/locales/English.json b/src/localization/locales/English.json index 11714e0c5..8929f3652 100644 --- a/src/localization/locales/English.json +++ b/src/localization/locales/English.json @@ -135,7 +135,7 @@ "create.wallet.success": "Nice move! Backup complete.", "create.wallet.success.text": "You backed up your wallet. Now let’s setup your wallet’s security.", "create.wallet.tap.words.in.correct.order": "Tap the words in the correct order", - "create.wallet.verification.alert": "Never share recovery phrase with \n anyone, keep it safe!", + "create.wallet.verification.alert": "Never share recovery phrase with \nanyone, keep it safe!", "create.wallet.verify.phrase": "Verify phrase", "create.wallet.verify.text": "Make sure to write it down as shown. You will verify this later.", "create.wallet.your.recovery.phrase": "Your recovery phrase", @@ -193,7 +193,7 @@ "send.funds.invalid.address": "Please enter a valid address", "send.funds.ready.to.send": "Ready to send?", "send.funds.recipient": "Recipient address", - "send.funds.review.transaction": "Review Transaction", + "send.funds.review.transaction": "Review transaction", "send.funds.send.now": "Send now", "send.funds.sending": "Sending", "send.funds.sending.description": "This shouldn’t take long", @@ -236,6 +236,8 @@ "singleWallet.name": "Name", "singleWallet.remove": "Remove", + "singleWallet.remove.alert.title": "Are you sure you want to delete this wallet", + "singleWallet.remove.alert.description": "Make sure you have a backup of this wallet", "singleWallet.save": "Save changes", "login.enter.your.passcode": "Enter your passcode", diff --git a/src/localization/locales/Turkish.json b/src/localization/locales/Turkish.json index 70a345ae3..44cd0f8c3 100644 --- a/src/localization/locales/Turkish.json +++ b/src/localization/locales/Turkish.json @@ -135,7 +135,7 @@ "create.wallet.success": "Harika! Yedekleme tamamlandı.", "create.wallet.success.text": "Cüzdanınızı yedeklediniz. Şimdi cüzdanınızın güvenliğini ayarlayalım.", "create.wallet.tap.words.in.correct.order": "Kelimelere doğru sırayla dokunun", - "create.wallet.verification.alert": "Kurtarma ifadesini asla kimseyle \n paylaşmayın, güvende tutun!", + "create.wallet.verification.alert": "Kurtarma ifadesini asla kimseyle \npaylaşmayın, güvende tutun!", "create.wallet.verify.phrase": "İfadeyi doğrula", "create.wallet.verify.text": "Gösterildiği gibi yazdığınızdan emin olun. Bunu daha sonra doğrulayacaksınız.", "create.wallet.your.recovery.phrase": "Kurtarma ifadeniz", @@ -193,7 +193,7 @@ "send.funds.invalid.address": "Lütfen geçerli bir adres girin", "send.funds.ready.to.send": "Göndermeye hazır mısınız?", "send.funds.recipient": "Alıcı adresi", - "send.funds.review.transaction": "İşlemi İncele", + "send.funds.review.transaction": "İşlemi incele", "send.funds.send.now": "Gönder", "send.funds.sending": "Gönderiliyor", "send.funds.sending.description": "İşleminiz gerçekleştiriliyor", @@ -236,6 +236,8 @@ "singleWallet.name": "İsim", "singleWallet.remove": "Sil", + "singleWallet.remove.alert.title": "Cüzdanı silmek istediğinizden emin misiniz?", + "singleWallet.remove.alert.description": "Cüzdanı yedeklediğinizden emin olun", "singleWallet.save": "Değişiklikleri kaydet", "login.enter.your.passcode": "Şifrenizi girin", diff --git a/src/screens/AMBMarket/components/PriceInfo.tsx b/src/screens/AMBMarket/components/PriceInfo.tsx index e386aa041..30cc11fdd 100644 --- a/src/screens/AMBMarket/components/PriceInfo.tsx +++ b/src/screens/AMBMarket/components/PriceInfo.tsx @@ -7,7 +7,7 @@ import { moderateScale, verticalScale } from '@utils/scaling'; export function AMBPriceInfo(): JSX.Element { return ( - + ); } diff --git a/src/screens/Settings/Settings.tsx b/src/screens/Settings/Settings.tsx index 801584a07..387e8454f 100644 --- a/src/screens/Settings/Settings.tsx +++ b/src/screens/Settings/Settings.tsx @@ -78,7 +78,7 @@ export const SettingsScreen = () => { {SETTINGS_MENU_ITEMS.map(renderMenu)} - {isStage && Build: 1.1.5.11} + {isStage && Build: 1.1.5.12} ); }; diff --git a/src/screens/Settings/screens/SingleWallet/SingleWallet.tsx b/src/screens/Settings/screens/SingleWallet/SingleWallet.tsx index a4e06723d..468c1287f 100644 --- a/src/screens/Settings/screens/SingleWallet/SingleWallet.tsx +++ b/src/screens/Settings/screens/SingleWallet/SingleWallet.tsx @@ -61,18 +61,21 @@ export const SingleWalletScreen = () => { }; const promptWalletDeletion = () => { - // TODO change text - Alert.alert('Delete wallet?', 'This will result in app reload', [ - { - text: 'Delete', - style: 'destructive', - onPress: deleteWallet - }, - { - text: 'Cancel', - style: 'cancel' - } - ]); + Alert.alert( + t('singleWallet.remove.alert.title'), + t('singleWallet.remove.alert.description'), + [ + { + text: 'Delete', + style: 'destructive', + onPress: deleteWallet + }, + { + text: 'Cancel', + style: 'cancel' + } + ] + ); }; return ( @@ -109,7 +112,15 @@ export const SingleWalletScreen = () => { {t('singleWallet.name')} - + {account && (