Skip to content

Commit 62cdd76

Browse files
authored
hotfix: added a banner for Astar Snap deprecation (#1484)
* feat: added a banner for Astar snap * fix: clean up * fix: refactoring
1 parent 290a72b commit 62cdd76

File tree

4 files changed

+86
-1
lines changed

4 files changed

+86
-1
lines changed
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<template>
2+
<div v-if="isSnap" class="banner">
3+
<div class="row--banner">
4+
<span class="text--deprecated">{{ $t('common.snapDeprecated') }}</span>
5+
<a :href="docsUrl.availableWallets" target="_blank" class="banner__link" rel="noreferrer">
6+
<b>{{ $t('common.availableWallet') }}</b>
7+
</a>
8+
</div>
9+
</div>
10+
</template>
11+
12+
<script lang="ts">
13+
import { computed, defineComponent, ref, watch } from 'vue';
14+
import { docsUrl } from 'src/links';
15+
import { useStore } from 'src/store';
16+
import { getSelectedAccount } from 'src/hooks/helper/wallet';
17+
import { SupportWallet } from 'src/config/wallets';
18+
import { useAccount } from 'src/hooks';
19+
20+
export default defineComponent({
21+
setup() {
22+
const store = useStore();
23+
const isSnap = ref<boolean>(false);
24+
const { currentAccount, substrateAccounts } = useAccount();
25+
26+
watch(
27+
[substrateAccounts, currentAccount],
28+
() => {
29+
const selectedWallet = getSelectedAccount(substrateAccounts.value);
30+
isSnap.value = selectedWallet?.source === SupportWallet.Snap;
31+
},
32+
{ immediate: false }
33+
);
34+
35+
return { docsUrl, isSnap };
36+
},
37+
});
38+
</script>
39+
40+
<style lang="scss" scoped>
41+
@import 'src/css/quasar.variables.scss';
42+
43+
.banner {
44+
background: linear-gradient(270deg, #ff94cd 26.04%, #e6007a 100%);
45+
color: $gray-2;
46+
font-weight: 600;
47+
padding: 4px 8px 8px 8px;
48+
font-size: 12px;
49+
position: relative;
50+
z-index: 2;
51+
display: flex;
52+
align-items: center;
53+
54+
@media (min-width: $sm) {
55+
font-size: 14px;
56+
padding: 4px 16px 8px 16px;
57+
}
58+
}
59+
60+
.row--banner {
61+
font-weight: 800;
62+
padding: 3px 9px;
63+
border-radius: 4px;
64+
margin-right: 4px;
65+
66+
@media (min-width: $sm) {
67+
margin-right: 8px;
68+
}
69+
}
70+
71+
.text--deprecated {
72+
margin-right: 4px;
73+
}
74+
75+
.banner__link {
76+
color: blue;
77+
text-decoration: underline;
78+
}
79+
</style>

src/i18n/en-US/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ export default {
131131
loading: 'Loading...',
132132
comingSoon: 'Coming soon',
133133
checkHowToSolve: 'Check how to solve this problem',
134+
snapDeprecated:
135+
'⚠️ Important: Astar Snap is being deprecated soon. Make sure to migrate your assets to a supported wallet to keep them accessible.',
136+
availableWallet: 'You can find available wallet options in our documentation.',
134137
speed: {
135138
speed: 'Transaction speed',
136139
speedTip: 'Transaction speed (Tip)',

src/layouts/DashboardLayout.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<div class="wrapper--dashboard-layout__inner">
77
<portal-header />
88
<!-- <under-maintenance-banner /> -->
9+
<snap-deprecated-banner />
910
<dapp-staking-banner />
1011
<main id="assets-top" class="wrapper--main">
1112
<div class="wrapper--components">
1213
<div class="page-bg" :style="{ backgroundImage: `url(${bg})` }" />
13-
1414
<slot />
1515
</div>
1616
</main>
@@ -28,12 +28,14 @@ import { LOCAL_STORAGE } from 'src/config/localStorage';
2828
import { useStore } from 'src/store';
2929
import UnderMaintenanceBanner from 'src/components/header/UnderMaintenanceBanner.vue';
3030
import DappStakingBanner from 'src/components/header/DappStakingBanner.vue';
31+
import SnapDeprecatedBanner from 'src/components/header/SnapDeprecatedBanner.vue';
3132
3233
export default defineComponent({
3334
components: {
3435
PortalHeader,
3536
SidebarDesktop,
3637
DappStakingBanner,
38+
SnapDeprecatedBanner,
3739
},
3840
setup() {
3941
const store = useStore();

src/links/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const docsUrl = {
1616
dappStakingForStakers: 'https://docs.astar.network/docs/use/dapp-staking/for-stakers/',
1717
dappStakingStaked16Dapps:
1818
'https://docs.astar.network/docs/learn/dapp-staking/dapp-staking-faq/#q-ive-staked-16-dapps-and-now-i-cant-add-or-move-tokens-and-im-getting-an-error-what-should-i-do',
19+
availableWallets: 'https://docs.astar.network/docs/use/get-started/',
1920
};
2021

2122
export const socialUrl = {

0 commit comments

Comments
 (0)