Skip to content

Commit

Permalink
fix(mobile): fix burn_not_available toast (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorokin0andrey authored May 15, 2024
1 parent 9615d6f commit 35ad5f1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
13 changes: 10 additions & 3 deletions packages/mobile/src/utils/notcoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Address, BitString } from '@ton/core';
import { t } from '@tonkeeper/shared/i18n';
import { getRawTimeFromLiteserverSafely } from '@tonkeeper/shared/utils/blockchain';
import { Toast } from '@tonkeeper/uikit';
import { ToastSize } from '@tonkeeper/uikit/src/components/Toast';
import { intervalToDuration } from 'date-fns';

export const getNotcoinBurnAddress = (nftAddress: string) => {
Expand All @@ -29,11 +30,17 @@ export const checkBurnDate = async () => {
});

if (duration.hours && duration.hours > 0) {
Toast.fail(t('notcoin.burn_not_available.hours', { hours: duration.hours }));
Toast.fail(t('notcoin.burn_not_available.hours', { count: duration.hours }), {
size: ToastSize.Small,
});
} else if (duration.minutes && duration.minutes > 1) {
Toast.fail(t('notcoin.burn_not_available.minutes', { minutes: duration.minutes }));
Toast.fail(t('notcoin.burn_not_available.minutes', { count: duration.minutes }), {
size: ToastSize.Small,
});
} else {
Toast.fail(t('notcoin.burn_not_available.seconds', { seconds: duration.seconds }));
Toast.fail(t('notcoin.burn_not_available.seconds', { count: duration.seconds }), {
size: ToastSize.Small,
});
}
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/shared/i18n/locales/tonkeeper/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1321,9 +1321,9 @@
"slogan": "Probably nothing",
"open": "Open",
"burn_not_available": {
"hours": "Exchange will be available in %{hours} hours",
"minutes": "Exchange will be available in %{minutes} minutes",
"seconds": "Exchange will be available in %{seconds} seconds"
"hours": "Exchange will be available in %{count} hours",
"minutes": "Exchange will be available in %{count} minutes",
"seconds": "Exchange will be available in %{count} seconds"
}
}
}
24 changes: 12 additions & 12 deletions packages/shared/i18n/locales/tonkeeper/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -1385,22 +1385,22 @@
"open": "Открыть",
"burn_not_available": {
"hours": {
"one": "Обмен будет доступен через %{hours} час",
"few": "Обмен будет доступен через %{hours} часа",
"many": "Обмен будет доступен через %{hours} часов",
"other": "Обмен будет доступен через %{hours} часов"
"one": "Обмен будет доступен через %{count} час",
"few": "Обмен будет доступен через %{count} часа",
"many": "Обмен будет доступен через %{count} часов",
"other": "Обмен будет доступен через %{count} часов"
},
"minutes": {
"one": "Обмен будет доступен через %{minutes} минуту",
"few": "Обмен будет доступен через %{minutes} минуты",
"many": "Обмен будет доступен через %{minutes} минут",
"other": "Обмен будет доступен через %{minutes} минут"
"one": "Обмен будет доступен через %{count} минуту",
"few": "Обмен будет доступен через %{count} минуты",
"many": "Обмен будет доступен через %{count} минут",
"other": "Обмен будет доступен через %{count} минут"
},
"seconds": {
"one": "Обмен будет доступен через %{seconds} секунду",
"few": "Обмен будет доступен через %{seconds} секунды",
"many": "Обмен будет доступен через %{seconds} секунд",
"other": "Обмен будет доступен через %{seconds} секунд"
"one": "Обмен будет доступен через %{count} секунду",
"few": "Обмен будет доступен через %{count} секунды",
"many": "Обмен будет доступен через %{count} секунд",
"other": "Обмен будет доступен через %{count} секунд"
}
}
}
Expand Down

0 comments on commit 35ad5f1

Please sign in to comment.