1
1
<template >
2
2
<div class =" sidebar padding flex-column" >
3
- <div v-if =" isTestnet" class =" testnet -notice flex-row" >
3
+ <div v-if =" isTestnet" class =" environment -notice flex-row" >
4
4
<StreetconeIcon />
5
5
<span class =" nq-label" >{{ $t('PoS Testnet') }}</span >
6
6
<div class =" flex-grow" ></div >
20
20
</Tooltip >
21
21
</div >
22
22
23
+ <div v-if =" isDemoEnabled" class =" environment-notice demo-notice flex-row" >
24
+ <StreetconeIcon />
25
+ <span class =" nq-label" >{{ $t('Demo mode') }}</span >
26
+ <div class =" flex-grow" ></div >
27
+ <Tooltip preferredPosition =" bottom left"
28
+ :container =" $parent"
29
+ theme =" inverse"
30
+ :styles =" { transform: 'translate(0.5rem, 2rem)' }"
31
+ ref =" demoTooltip"
32
+ >
33
+ <template #trigger >
34
+ <InfoCircleIcon />
35
+ </template >
36
+ <template #default >
37
+ <p >{{ $t('Experience the Nimiq Wallet risk-free.' ) }}</p >
38
+ <p >{{ $t('Explore and learn how it all works, safely and without real assets.') }}</p >
39
+ </template >
40
+ </Tooltip >
41
+ </div >
42
+
23
43
<header class =" logo" @click =" resetState" >
24
44
<span class =" nq-icon nimiq-logo" ></span >
25
45
<span class =" logo-wordmark" >Nimiq</span >
@@ -193,6 +213,7 @@ import { defineComponent, ref, computed } from '@vue/composition-api';
193
213
import { SwapAsset } from ' @nimiq/fastspot-api' ;
194
214
import { GearIcon , Tooltip , InfoCircleIcon } from ' @nimiq/vue-components' ;
195
215
import { RouteName , useRouter } from ' @/router' ;
216
+ import { checkIfDemoIsActive } from ' @/lib/Demo' ;
196
217
import AnnouncementBox from ' ../AnnouncementBox.vue' ;
197
218
import AccountMenu from ' ../AccountMenu.vue' ;
198
219
import PriceChart , { TimeRange } from ' ../PriceChart.vue' ;
@@ -359,6 +380,8 @@ export default defineComponent({
359
380
: null ;
360
381
});
361
382
383
+ const isDemoEnabled = checkIfDemoIsActive ();
384
+
362
385
return {
363
386
CryptoCurrency ,
364
387
navigateTo ,
@@ -385,6 +408,7 @@ export default defineComponent({
385
408
openSellModal ,
386
409
nimSellOptions ,
387
410
activeCurrency ,
411
+ isDemoEnabled ,
388
412
};
389
413
},
390
414
components: {
@@ -424,7 +448,7 @@ $balance-distribution-display-breakpoint: 450px;
424
448
padding-bottom : max (var (--padding-bottom ), env (safe-area-inset-bottom ));
425
449
}
426
450
427
- .testnet -notice {
451
+ .environment -notice {
428
452
align-items : center ;
429
453
width : calc (100% + calc (2 * var (--padding-sides )));
430
454
margin : calc (-1 * var (--padding-top )) calc (-1 * var (--padding-sides )) var (--padding-top );
0 commit comments