Skip to content

Commit 648d0f0

Browse files
committed
feat: create the welcome page and handle logout
1 parent 006ad8a commit 648d0f0

File tree

1 file changed

+54
-1
lines changed

1 file changed

+54
-1
lines changed

src/views/WelcomeView.vue

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,62 @@
11
<template>
2-
<h1>Welcome</h1>
2+
<main class="welcome-container">
3+
<h1>Welcome</h1>
4+
<h2>User's Email: <br> <strong>{{ email }}</strong></h2>
5+
<button @click="handleLogout" class="logout">Log out</button>
6+
<small>I love instabug ❤</small>
7+
</main>
38
</template>
49

510
<script>
611
export default {
712
name: "WelcomeView",
13+
data() {
14+
return {
15+
email: window.localStorage.getItem("email"),
16+
}
17+
},
18+
methods: {
19+
handleLogout() {
20+
window.localStorage.removeItem("email");
21+
this.$router.push("/login");
22+
}
23+
},
824
}
925
</script>
26+
27+
<style lang="scss" scoped>
28+
29+
.welcome-container {
30+
display: flex;
31+
flex-direction: column;
32+
align-items: center;
33+
justify-content: center;
34+
padding: 10px 20px 50px 20px;
35+
min-height: 100vh;
36+
37+
h2 {
38+
font-weight: 400;
39+
margin: 20px;
40+
text-align: center;
41+
}
42+
43+
button {
44+
border: 0;
45+
border-radius: 5px;
46+
background-color: $blue-background;
47+
padding: 8px 50px;
48+
color: $white-text;
49+
font-weight: 600;
50+
font-size: 16px;
51+
cursor: pointer;
52+
53+
&:hover {
54+
opacity: 0.9;
55+
}
56+
}
57+
58+
small {
59+
margin: 10px;
60+
}
61+
}
62+
</style>

0 commit comments

Comments
 (0)