Skip to content
This repository was archived by the owner on Feb 5, 2023. It is now read-only.

Commit 278955a

Browse files
committed
add: not found page (subpage)
1 parent 1181575 commit 278955a

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

src/views/Home.vue

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="main px-4 py-8 flex flex-col gap-y-2 max-w-md m-auto">
2+
<div v-if="isRNSExist" class="main px-4 py-8 flex flex-col gap-y-2 max-w-md m-auto">
33
<Profile
44
:avatar="rss3Profile.avatar"
55
:username="rss3Profile.username"
@@ -173,6 +173,32 @@
173173
</template>
174174
</Modal>
175175
</div>
176+
<div
177+
v-else
178+
class="onboarding h-full text-center bg-cover bg-fixed flex items-center justify-center bg-pass3gradient"
179+
>
180+
<div class="body px-4 h-2/3 flex flex-col justify-center items-center justify-between">
181+
<div class="logo-container w-50 h-50 bg-pass3logo bg-center bg-contain bg-no-repeat"></div>
182+
<div class="text-primary text-2xl max-w-md">
183+
<p>
184+
This RNS is not claimed yet. <br />
185+
Grab it as yours or claim your own!
186+
</p>
187+
</div>
188+
<div class="leading-17.5 text-white w-83.5 text-2xl mx-auto">
189+
<Button size="lg" class="bg-primary shadow-primary rounded-3xl w-full h-17.5 mb-9" @click="toSetupRNS">
190+
<span> Claim an RNS </span>
191+
</Button>
192+
<Button
193+
size="lg"
194+
class="text-primary bg-white shadow-primary rounded-3xl w-full h-17.5"
195+
@click="toHomePage"
196+
>
197+
<span> Go Home </span>
198+
</Button>
199+
</div>
200+
</div>
201+
</div>
176202
</template>
177203

178204
<script lang="ts">
@@ -213,6 +239,7 @@ export default class Home extends Vue {
213239
public isdisplaying: boolean = false;
214240
public dialogAddress: string = '';
215241
public dialogChain: string = '';
242+
isRNSExist: boolean = true;
216243
217244
public rss3Profile: ProfileInfo = {
218245
avatar: config.defaultAvatar,
@@ -229,6 +256,10 @@ export default class Home extends Vue {
229256
$gtag: any;
230257
231258
async mounted() {
259+
await this.initLoad();
260+
}
261+
262+
async initLoad() {
232263
const isValidRSS3 = await RSS3.reconnect();
233264
this.rss3 = await RSS3.visitor();
234265
const owner: string = <string>this.rss3.account.address;
@@ -251,6 +282,8 @@ export default class Home extends Vue {
251282
if (this.ethAddress === owner) {
252283
this.isOwner = true;
253284
}
285+
} else {
286+
this.isRNSExist = false;
254287
}
255288
}
256289
} else {
@@ -282,7 +315,7 @@ export default class Home extends Vue {
282315
this.rss3Profile.bio = profile?.bio || '';
283316
this.rss3Profile.address = this.ethAddress;
284317
285-
this.rss3Relations.followers = await this.rss3?.backlinks.get(this.ethAddress, 'following');
318+
this.rss3Relations.followers = (await this.rss3?.backlinks.get(this.ethAddress, 'following')) || [];
286319
this.rss3Relations.followings = (await this.rss3?.links.get(this.ethAddress, 'following'))?.list || [];
287320
288321
if (data) {
@@ -460,6 +493,16 @@ export default class Home extends Vue {
460493
this.$router.push(`/profile`);
461494
}
462495
496+
toSetupRNS() {
497+
this.$router.push('/rns');
498+
}
499+
500+
async toHomePage() {
501+
await this.$router.push('/home');
502+
this.isRNSExist = true;
503+
await this.initLoad();
504+
}
505+
463506
public displayDialog(address: string, chain: string) {
464507
this.dialogAddress = address;
465508
this.dialogChain = chain;

0 commit comments

Comments
 (0)