mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-22 15:04:50 +01:00
REF: wallets list improvements
This commit is contained in:
parent
e52c196009
commit
0ae8bca3c8
6 changed files with 71 additions and 10 deletions
|
@ -529,7 +529,7 @@ export class BlueReceiveButtonIcon extends Component {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
bottom: 30,
|
bottom: 30,
|
||||||
left: (isIpad && 30) || 80,
|
left: (isIpad && 40) || 80,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<View>
|
<View>
|
||||||
|
@ -592,7 +592,7 @@ export class BlueSendButtonIcon extends Component {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
bottom: 30,
|
bottom: 30,
|
||||||
right: (isIpad && 30) || 85,
|
right: (isIpad && 40) || 85,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<View>
|
<View>
|
||||||
|
@ -814,7 +814,7 @@ export class WalletsCarousel extends Component {
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
latest transaction
|
{loc.wallets.list.latest_transaction}
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text
|
||||||
style={{
|
style={{
|
||||||
|
|
|
@ -4,6 +4,10 @@ module.exports = {
|
||||||
'Your storage is encrypted. Password is required to decrypt it',
|
'Your storage is encrypted. Password is required to decrypt it',
|
||||||
enter_password: 'Enter password',
|
enter_password: 'Enter password',
|
||||||
bad_password: 'Bad pasword, try again',
|
bad_password: 'Bad pasword, try again',
|
||||||
|
months_ago: 'months ago',
|
||||||
|
days_ago: 'days ago',
|
||||||
|
hours_ago: 'hours ago',
|
||||||
|
never: 'never',
|
||||||
},
|
},
|
||||||
wallets: {
|
wallets: {
|
||||||
list: {
|
list: {
|
||||||
|
@ -17,6 +21,9 @@ module.exports = {
|
||||||
create_a_wallet: 'Create a wallet',
|
create_a_wallet: 'Create a wallet',
|
||||||
create_a_wallet1: "It's free and you can create",
|
create_a_wallet1: "It's free and you can create",
|
||||||
create_a_wallet2: 'as many as you like',
|
create_a_wallet2: 'as many as you like',
|
||||||
|
latest_transaction: 'latest transaction',
|
||||||
|
empty_txs1: 'Your transactions will appear here,',
|
||||||
|
empty_txs2: 'none at the moment',
|
||||||
},
|
},
|
||||||
add: {
|
add: {
|
||||||
title: 'add wallet',
|
title: 'add wallet',
|
||||||
|
|
|
@ -47,19 +47,19 @@ strings.saveLanguage = lang => AsyncStorage.setItem(AppStorage.LANG, lang);
|
||||||
|
|
||||||
strings.transactionTimeToReadable = function(time) {
|
strings.transactionTimeToReadable = function(time) {
|
||||||
if (time === 0) {
|
if (time === 0) {
|
||||||
return 'never';
|
return strings._.never;
|
||||||
}
|
}
|
||||||
|
|
||||||
let ago = (Date.now() - Date.parse(time)) / 1000; // seconds
|
let ago = (Date.now() - Date.parse(time)) / 1000; // seconds
|
||||||
if (ago / (3600 * 24) >= 30) {
|
if (ago / (3600 * 24) >= 30) {
|
||||||
ago = Math.round(ago / (3600 * 24 * 30));
|
ago = Math.round(ago / (3600 * 24 * 30));
|
||||||
return ago + ' months ago';
|
return ago + ' ' + strings._.months_ago;
|
||||||
} else if (ago / (3600 * 24) >= 1) {
|
} else if (ago / (3600 * 24) >= 1) {
|
||||||
ago = Math.round(ago / (3600 * 24));
|
ago = Math.round(ago / (3600 * 24));
|
||||||
return ago + ' days ago';
|
return ago + ' ' + strings._.days_ago;
|
||||||
} else {
|
} else {
|
||||||
ago = Math.round(ago / 3600);
|
ago = Math.round(ago / 3600);
|
||||||
return ago + ' hours ago';
|
return ago + ' ' + strings._.hours_ago;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,10 @@ module.exports = {
|
||||||
'Ваше хранилище зашифровано. Введите пароль для расшифровки',
|
'Ваше хранилище зашифровано. Введите пароль для расшифровки',
|
||||||
enter_password: 'Введите пароль',
|
enter_password: 'Введите пароль',
|
||||||
bad_password: 'Неверный пароль, попробуйте еще раз',
|
bad_password: 'Неверный пароль, попробуйте еще раз',
|
||||||
|
months_ago: 'месяцев назад',
|
||||||
|
days_ago: 'дней назад',
|
||||||
|
hours_ago: 'часов назад',
|
||||||
|
never: 'никогда',
|
||||||
},
|
},
|
||||||
wallets: {
|
wallets: {
|
||||||
list: {
|
list: {
|
||||||
|
@ -16,6 +20,9 @@ module.exports = {
|
||||||
create_a_wallet: 'Создать кошелек',
|
create_a_wallet: 'Создать кошелек',
|
||||||
create_a_wallet1: 'Это бесплатно и вы можете создать',
|
create_a_wallet1: 'Это бесплатно и вы можете создать',
|
||||||
create_a_wallet2: 'неограниченное количество',
|
create_a_wallet2: 'неограниченное количество',
|
||||||
|
latest_transaction: 'последняя транзакция',
|
||||||
|
empty_txs1: 'Список транзакций пока пуст',
|
||||||
|
empty_txs2: ' ',
|
||||||
},
|
},
|
||||||
add: {
|
add: {
|
||||||
title: 'Добавить Кошелек',
|
title: 'Добавить Кошелек',
|
||||||
|
|
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "BlueWallet",
|
"name": "BlueWallet",
|
||||||
"version": "1.4.2",
|
"version": "2.0.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -72,6 +72,7 @@ export default class WalletsList extends Component {
|
||||||
isTransactionsLoading: false,
|
isTransactionsLoading: false,
|
||||||
showReceiveButton: true,
|
showReceiveButton: true,
|
||||||
showSendButton: true,
|
showSendButton: true,
|
||||||
|
showRereshButton: true,
|
||||||
final_balance: BlueApp.getBalance(),
|
final_balance: BlueApp.getBalance(),
|
||||||
dataSource: ds.cloneWithRows(
|
dataSource: ds.cloneWithRows(
|
||||||
BlueApp.getTransactions(this.lastSnappedTo || 0),
|
BlueApp.getTransactions(this.lastSnappedTo || 0),
|
||||||
|
@ -137,6 +138,7 @@ export default class WalletsList extends Component {
|
||||||
isLoading: false,
|
isLoading: false,
|
||||||
showReceiveButton: false,
|
showReceiveButton: false,
|
||||||
showSendButton: false,
|
showSendButton: false,
|
||||||
|
showRereshButton: false,
|
||||||
final_balance: BlueApp.getBalance(),
|
final_balance: BlueApp.getBalance(),
|
||||||
dataSource: ds.cloneWithRows(BlueApp.getTransactions(index)),
|
dataSource: ds.cloneWithRows(BlueApp.getTransactions(index)),
|
||||||
});
|
});
|
||||||
|
@ -144,7 +146,12 @@ export default class WalletsList extends Component {
|
||||||
if (index < BlueApp.getWallets().length) {
|
if (index < BlueApp.getWallets().length) {
|
||||||
// do not show for last card
|
// do not show for last card
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() => this.setState({ showReceiveButton: true, showSendButton: true }),
|
() =>
|
||||||
|
this.setState({
|
||||||
|
showReceiveButton: true,
|
||||||
|
showSendButton: true,
|
||||||
|
showRereshButton: true,
|
||||||
|
}),
|
||||||
50,
|
50,
|
||||||
); // just to animate it, no real function
|
); // just to animate it, no real function
|
||||||
}
|
}
|
||||||
|
@ -192,7 +199,47 @@ export default class WalletsList extends Component {
|
||||||
>
|
>
|
||||||
{loc.transactions.list.title}
|
{loc.transactions.list.title}
|
||||||
</Text>
|
</Text>
|
||||||
<BlueRefreshIcon onPress={() => this.refreshTransactions()} />
|
{(() => {
|
||||||
|
if (this.state.showRereshButton) {
|
||||||
|
return (
|
||||||
|
<BlueRefreshIcon
|
||||||
|
onPress={() => this.refreshTransactions()}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})()}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View style={{ top: 120, position: 'absolute', width: width }}>
|
||||||
|
{(() => {
|
||||||
|
if (
|
||||||
|
BlueApp.getTransactions(this.lastSnappedTo || 0)
|
||||||
|
.length === 0
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<View>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontSize: 18,
|
||||||
|
color: '#9aa0aa',
|
||||||
|
textAlign: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{loc.wallets.list.empty_txs1}
|
||||||
|
</Text>
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
fontSize: 18,
|
||||||
|
color: '#9aa0aa',
|
||||||
|
textAlign: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{loc.wallets.list.empty_txs2}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})()}
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
<View style={{ top: 30, position: 'absolute' }}>
|
<View style={{ top: 30, position: 'absolute' }}>
|
||||||
|
|
Loading…
Add table
Reference in a new issue