Skip to content

Commit

Permalink
Merge branch 'dev' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidHaji-zada committed Nov 27, 2023
1 parent cd382d5 commit a9fd952
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 31 deletions.
31 changes: 24 additions & 7 deletions src/components/composite/Button/CopyToClipboard.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<BaseButtonProps, 'onPress'> {
Expand Down Expand Up @@ -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<NodeJS.Timeout>();

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'),
Expand All @@ -55,14 +67,19 @@ export const CopyToClipboardButton = (
});
}
await Clipboard.setStringAsync(textToCopy || textToDisplay);
setTimeout(() => {
toggleCopied();
timeout.current = setTimeout(() => {
setCopied(false);
}, 2500);
};

if (pressableText) {
return (
<Button {...buttonProps} onPress={onPress}>
<Button
{...buttonProps}
// @ts-ignore
style={{ ...buttonProps.style, padding: 4 }}
onPress={onPress}
>
<Row alignItems="center" style={{ minHeight: 20 }}>
{copied ? (
<Text {...successTextProps}>
Expand Down
6 changes: 5 additions & 1 deletion src/components/templates/AMBPriceHistory/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ export const AMBPriceHistory = (props: AMBPriceHistoryProps) => {
icon={
<Row alignItems="center" style={styles.balanceLast24HourChange}>
<PercentChange
change={ambPriceNow?.percentChange24H || 0}
change={
(selectedInterval === '7d' || selectedInterval === 'weekly'
? ambPriceNow?.percentChange7D
: ambPriceNow?.percentChange1H) || 0
}
fontSize={16}
fontWeight="500"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const BottomSheetEditCollection = forwardRef<
fontFamily="Inter_600SemiBold"
>
{t('button.delete')}{' '}
{StringUtils.formatAddress(collection.name, 12, 0)}
{StringUtils.formatAddress(collection.name, 24, 0)}
</Text>
</Button>
</View>
Expand Down
5 changes: 2 additions & 3 deletions src/components/templates/ExplorerAccount/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 4 additions & 2 deletions src/localization/locales/English.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
6 changes: 4 additions & 2 deletions src/localization/locales/Turkish.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/screens/AMBMarket/components/PriceInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { moderateScale, verticalScale } from '@utils/scaling';
export function AMBPriceInfo(): JSX.Element {
return (
<View style={styles.container}>
<AMBPriceHistory badgeType="button" />
<AMBPriceHistory badgeType="view" />
</View>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const SettingsScreen = () => {
<View style={styles.innerContainer}>
{SETTINGS_MENU_ITEMS.map(renderMenu)}
</View>
{isStage && <Text style={{ margin: 20 }}>Build: 1.1.5.11</Text>}
{isStage && <Text style={{ margin: 20 }}>Build: 1.1.5.12</Text>}
</View>
);
};
37 changes: 24 additions & 13 deletions src/screens/Settings/screens/SingleWallet/SingleWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -109,7 +112,15 @@ export const SingleWalletScreen = () => {
<View style={styles.nameInput}>
<Text>{t('singleWallet.name')}</Text>
<Spacer value={verticalScale(8)} />
<Input value={walletName} onChangeValue={setWalletName} />
<Input
value={walletName}
onChangeValue={setWalletName}
style={{
shadowColor: COLORS.transparent,
borderWidth: 1,
borderColor: COLORS.alphaBlack10
}}
/>
</View>
<Spacer value={verticalScale(42)} />
{account && (
Expand Down

0 comments on commit a9fd952

Please sign in to comment.