From 0269720c4398cf312b51cb26f6cf810dcdf3131e Mon Sep 17 00:00:00 2001 From: juan Date: Wed, 6 Jul 2022 16:00:08 -0300 Subject: [PATCH] improvements & translations --- locales/en/translation.json | 3 ++- locales/es/translation.json | 3 ++- .../screens/WalletConnectHome.tsx | 27 +++++++++++++------ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/locales/en/translation.json b/locales/en/translation.json index 7fbdbd744e..097cbca2db 100644 --- a/locales/en/translation.json +++ b/locales/en/translation.json @@ -693,7 +693,8 @@ "Connected to": "Connected to", "Linked Wallet": "Linked Wallet", "Pending Requests": "Pending Requests", - "Created on": "Created on {{createdOn}}", + "Created on": "Created on {{date}}", + "Created ": "Created {{date}}", "No pending requests": "No pending requests", "WalletConnect is an open source protocol for connecting decentralized applications to mobile wallets with QR code scanning or deep linking.": "WalletConnect is an open source protocol for connecting decentralized applications to mobile wallets with QR code scanning or deep linking.", "Learn More": "Learn More", diff --git a/locales/es/translation.json b/locales/es/translation.json index 7f7938a825..e72ee3d2b6 100644 --- a/locales/es/translation.json +++ b/locales/es/translation.json @@ -693,7 +693,8 @@ "Connected to": "Conectado a", "Linked Wallet": "Billetera vinculada", "Pending Requests": "Solicitudes pendientes", - "Created on": "Creado el {{createdOn}}", + "Created on": "Creado el {{date}}", + "Created ": "Creado {{date}}", "No pending requests": "No hay solicitudes pendientes", "WalletConnect is an open source protocol for connecting decentralized applications to mobile wallets with QR code scanning or deep linking.": "WalletConnect es un protocolo de código abierto para conectar aplicaciones descentralizadas a billeteras móviles con escaneo de código QR o con un enlace profundo.", "Learn More": "Aprender más", diff --git a/src/navigation/wallet-connect/screens/WalletConnectHome.tsx b/src/navigation/wallet-connect/screens/WalletConnectHome.tsx index 9598cb3c99..4ff52147c7 100644 --- a/src/navigation/wallet-connect/screens/WalletConnectHome.tsx +++ b/src/navigation/wallet-connect/screens/WalletConnectHome.tsx @@ -46,7 +46,11 @@ import {Wallet} from '../../../store/wallet/wallet.models'; import {convertHexToNumber} from '@walletconnect/utils'; import {OnGoingProcessMessages} from '../../../components/modal/ongoing-process/OngoingProcess'; import {useTranslation} from 'react-i18next'; -import {GetAmFormatDate} from '../../../store/wallet/utils/time'; +import { + GetAmFormatDate, + GetAmTimeAgo, + WithinPastDay, +} from '../../../store/wallet/utils/time'; export type WalletConnectHomeParamList = { peerId: string; @@ -337,13 +341,20 @@ const WalletConnectHome = () => { {amountStr} - {request.createdOn ? ( - - {t('Created on', { - createdOn: GetAmFormatDate(request.createdOn), - })} - - ) : null} + {request.createdOn && + (WithinPastDay(request.createdOn) ? ( + + {t('Created on', { + date: GetAmFormatDate(request.createdOn), + })} + + ) : ( + + {t('Created ', { + date: GetAmTimeAgo(request.createdOn), + })} + + ))}