Skip to content

Commit d671f4d

Browse files
committed
Add Buy buttons to empty state tx lists for BTC and USDC, too
1 parent 360619c commit d671f4d

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

src/components/BtcTransactionList.vue

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,15 @@
6363

6464
<div v-else-if="!searchString" class="empty-state flex-column">
6565
<h2 class="nq-h1">{{ $t('Your transactions will appear here') }}</h2>
66-
<!-- <span>{{ $t('Receive some free NIM to get started.') }}</span>
6766

68-
<a v-if="isMainnet"
69-
:href="`https://getsome.nimiq.com/?address=${activeAddress}`" target="_blank" rel="noopener"
67+
<router-link v-if="isMainnet" to="buy" class="nq-button light-blue">
68+
{{ $t('Buy BTC') }}
69+
</router-link>
70+
<!-- <a v-else
71+
href="https://www.google.com/search?q=bitcoin+testnet+faucet" target="_blank" rel="noopener"
7072
class="nq-button green"
7173
@mousedown.prevent
72-
>{{ $t('Receive free NIM') }}</a>
73-
<a v-else
74-
href="https://testnet-faucet.mempool.co/" target="_blank" rel="noopener"
75-
class="nq-button green"
76-
@mousedown.prevent
77-
>{{ $t('Get free test BTC') }}</a> -->
74+
>{{ $t('Get free tBTC') }}</a> -->
7875
</div>
7976
<div v-else class="empty-state flex-column">
8077
<h2 class="nq-h1 no-search-results">{{ $t('No transactions found') }}</h2>
@@ -86,14 +83,14 @@
8683
import { defineComponent, computed, ref, Ref /* , onMounted, onBeforeUnmount, watch */ } from '@vue/composition-api';
8784
import { CircleSpinner, AlertTriangleIcon } from '@nimiq/vue-components';
8885
import BtcTransactionListItem from '@/components/BtcTransactionListItem.vue';
89-
// import { ENV_MAIN } from '../lib/Constants';
86+
import { ENV_MAIN } from '../lib/Constants';
9087
import { useBtcAddressStore } from '../stores/BtcAddress';
9188
import { useBtcTransactionsStore } from '../stores/BtcTransactions';
9289
import { useBtcNetworkStore } from '../stores/BtcNetwork';
9390
import { useAccountStore } from '../stores/Account';
9491
import { useBtcLabelsStore } from '../stores/BtcLabels';
9592
import { useWindowSize } from '../composables/useWindowSize';
96-
// import { useConfig } from '../composables/useConfig';
93+
import { useConfig } from '../composables/useConfig';
9794
9895
function processTimestamp(timestamp: number) {
9996
const date: Date = new Date(timestamp);
@@ -347,7 +344,7 @@ export default defineComponent({
347344
// })();
348345
349346
// Does not need to be reactive, as the environment doesn't change during runtime.
350-
// const isMainnet = useConfig().config.environment === ENV_MAIN;
347+
const isMainnet = useConfig().config.environment === ENV_MAIN;
351348
352349
// Scroll to top when
353350
// - Active address changes
@@ -365,7 +362,7 @@ export default defineComponent({
365362
transactions,
366363
root,
367364
isFetchingTxHistory,
368-
// isMainnet,
365+
isMainnet,
369366
scroller,
370367
consensus,
371368
};

src/components/UsdcTransactionList.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,23 @@
4040
</div>
4141
</template>
4242

43-
<!-- <template v-if="txCount === 1" v-slot:after>
43+
<template v-if="txCount === 1" v-slot:after>
4444
<div class="after-first-tx">
4545
<h1 class="nq-h1">{{ $t('Congrats') }} 🎉</h1>
4646
<h1 class="nq-h1">{{ $t('You now own crypto!') }}</h1>
4747
<router-link to="buy" class="nq-button light-blue">
4848
{{ $t('Buy USDC') }}
4949
</router-link>
5050
</div>
51-
</template> -->
51+
</template>
5252
</RecycleScroller>
5353

5454
<div v-else-if="!searchString" class="empty-state flex-column">
5555
<h2 class="nq-h1">{{ $t('Your transactions will appear here') }}</h2>
56+
57+
<router-link v-if="isMainnet" to="buy" class="nq-button light-blue">
58+
{{ $t('Buy USDC') }}
59+
</router-link>
5660
</div>
5761
<div v-else class="empty-state flex-column">
5862
<h2 class="nq-h1 no-search-results">{{ $t('No transactions found') }}</h2>

0 commit comments

Comments
 (0)