Skip to content

Commit

Permalink
Sidebar: on disabled swap, show maintenance warning instead of hiding…
Browse files Browse the repository at this point in the history
… Swap button
  • Loading branch information
danimoh committed Aug 29, 2024
1 parent 47d40bd commit 9fbc084
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
16 changes: 12 additions & 4 deletions src/components/layouts/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,23 @@
<BalanceDistribution />
</div>

<Tooltip v-if="fastspotEnabledCryptoSwapAssets.length > 1 && !isLegacyAccount"
<Tooltip v-if="!isLegacyAccount"
preferredPosition="bottom right"
:container="$parent"
:disabled="walletActivatedCurrencies.length > 1 && hasSwappableBalance && canUseSwaps && !hasActiveSwap"
:disabled="fastspotEnabledCryptoSwapAssets.length > 1
&& walletActivatedCurrencies.length > 1
&& hasSwappableBalance
&& canUseSwaps
&& !hasActiveSwap"
theme="inverse"
class="swap-tooltip"
:styles="{ minWidth: '25rem' }"
ref="swapTooltip"
>
<template #trigger>
<button
:disabled="walletActivatedCurrencies.length <= 1
:disabled="fastspotEnabledCryptoSwapAssets.length <= 1
|| walletActivatedCurrencies.length <= 1
|| !hasSwappableBalance
|| !canUseSwaps
|| hasActiveSwap"
Expand All @@ -131,7 +136,10 @@
@mousedown.prevent="hideTooltips"
>{{ $t('Swap') }}</button>
</template>
<template v-if="walletActivatedCurrencies.length <= 1" #default>{{
<template v-if="fastspotEnabledCryptoSwapAssets.length <= 1" #default>{{
$t('Crypto swaps are currently under maintenance.')
}}</template>
<template v-else-if="walletActivatedCurrencies.length <= 1" #default>{{
$t('Please activate BTC or USDC in your account first to be able to swap to these currencies.')
}}</template>
<template v-else-if="!hasSwappableBalance" #default>{{
Expand Down
22 changes: 13 additions & 9 deletions src/i18n/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,10 @@ msgstr ""
msgid "Credit Card"
msgstr ""

#: src/components/layouts/Sidebar.vue:140
msgid "Crypto swaps are currently under maintenance."
msgstr ""

#: src/components/modals/BuyOptionsModal.vue:7
msgid ""
"Depending on your country of residence,\n"
Expand Down Expand Up @@ -1469,7 +1473,7 @@ msgstr ""
msgid "Name your contact"
msgstr ""

#: src/components/layouts/Sidebar.vue:162
#: src/components/layouts/Sidebar.vue:170
msgid "Network"
msgstr ""

Expand Down Expand Up @@ -1536,7 +1540,7 @@ msgstr ""
msgid "Not all accounts provided by this bank support instant transactions."
msgstr ""

#: src/components/layouts/Sidebar.vue:142
#: src/components/layouts/Sidebar.vue:150
msgid "Not available in your browser"
msgstr ""

Expand Down Expand Up @@ -1655,7 +1659,7 @@ msgstr ""
msgid "Performing swap {progress}/5"
msgstr ""

#: src/components/layouts/Sidebar.vue:135
#: src/components/layouts/Sidebar.vue:143
msgid "Please activate BTC or USDC in your account first to be able to swap to these currencies."
msgstr ""

Expand Down Expand Up @@ -1684,7 +1688,7 @@ msgstr ""
msgid "Please transfer"
msgstr ""

#: src/components/layouts/Sidebar.vue:146
#: src/components/layouts/Sidebar.vue:154
#: src/components/layouts/Sidebar.vue:57
msgid "Please wait for your current swap to finish before starting a new one."
msgstr ""
Expand Down Expand Up @@ -2105,7 +2109,7 @@ msgstr ""
msgid "Setting up the {currency} side of the swap."
msgstr ""

#: src/components/layouts/Sidebar.vue:170
#: src/components/layouts/Sidebar.vue:178
msgid "Settings"
msgstr ""

Expand Down Expand Up @@ -2221,7 +2225,7 @@ msgid "Super low fees, super fast payments"
msgstr ""

#. avoid displaying the proxy address until we know related peer address
#: src/components/layouts/Sidebar.vue:132
#: src/components/layouts/Sidebar.vue:137
#: src/components/modals/BtcTransactionModal.vue:9
#: src/components/modals/TransactionModal.vue:7
#: src/components/modals/UsdcTransactionModal.vue:9
Expand Down Expand Up @@ -2711,14 +2715,14 @@ msgstr ""
msgid "You can receive more free NIM in {waitTime} hours."
msgstr ""

#: src/components/layouts/Sidebar.vue:298
#: src/components/layouts/Sidebar.vue:306
msgid ""
"You can sell NIM\n"
"- in the Wallet by swapping NIM to BTC or USDC first, which can then be sold.\n"
"- on supported exchanges."
msgstr ""

#: src/components/layouts/Sidebar.vue:138
#: src/components/layouts/Sidebar.vue:146
msgid "You currently have no balance to swap."
msgstr ""

Expand Down Expand Up @@ -2782,7 +2786,7 @@ msgstr ""
msgid "Your browser"
msgstr ""

#: src/components/layouts/Sidebar.vue:143
#: src/components/layouts/Sidebar.vue:151
msgid "Your browser does not support Keyguard popups, or they are disabled in the Settings."
msgstr ""

Expand Down

0 comments on commit 9fbc084

Please sign in to comment.