From 2991bacc1d7eefcd33120d2aa56b71b5bb62c854 Mon Sep 17 00:00:00 2001 From: digvijay26 Date: Thu, 11 Mar 2021 12:59:33 +0530 Subject: [PATCH] ui flow change --- src/auth/index.js | 10 ++- src/components/AuthorIntro.vue | 13 ++- src/components/Header.vue | 12 ++- src/components/Intermediate.vue | 6 +- src/components/LandingPage.vue | 99 +++++++++++++-------- src/components/Profile.vue | 192 +++++++++++++++++++++++++++++----------- src/components/SignUp.vue | 9 +- src/router/index.js | 2 +- 8 files changed, 246 insertions(+), 97 deletions(-) diff --git a/src/auth/index.js b/src/auth/index.js index f4ab903..1427ea7 100644 --- a/src/auth/index.js +++ b/src/auth/index.js @@ -124,14 +124,18 @@ export const useAuth0 = ({ verified: true // profileImage: u.picture }).then(res => { - console.log("res", res); + console.log("res---profile", res); this.$toaster.success(res.data.message); - localStorage.setItem('spotlight_usertoken', JSON.stringify(res.data.data)) + localStorage.setItem('spotlight_usertoken', JSON.stringify(res.data.data)); + localStorage.setItem('spotlight_id', res.data.data.id); var previousUrl = localStorage.getItem("previous_url_spotlight"); console.log("onboarding", previousUrl) if (!previousUrl) { - router.push({ name: 'Profile' }); + router.push({ name: 'Profile', + params: { + id: res.data.data.id, + }, }); } else { previousUrl = JSON.parse(previousUrl); console.log("onboarding-2", previousUrl) diff --git a/src/components/AuthorIntro.vue b/src/components/AuthorIntro.vue index 5360ef3..cdaa618 100644 --- a/src/components/AuthorIntro.vue +++ b/src/components/AuthorIntro.vue @@ -78,13 +78,16 @@ export default { allSlide:[], currentSlideIndex:null, currentSlideData:null, + // + userId:null, }; }, mounted() { var allSlideData = localStorage.getItem("spotlight_slide"+this.$route.params.caseStudyId); if (allSlideData) { this.allSlide = JSON.parse(allSlideData); - this.getCurrentSlideData(); + // this.getCurrentSlideData(); + this.generatecaseStudies(); }else{ this.generatecaseStudies(); } @@ -110,6 +113,7 @@ export default { openStudy(payload) { console.log("payload-", payload); + this.userId = payload.userId[0]; payload.intro.date = payload.createdAt; payload.intro.focusPoint = payload.focusAreas; axios @@ -259,7 +263,12 @@ export default { this.$router.push("/"); }, goToProfile() { - this.$router.push("/profile"); + this.$router.push({ + name: "Profile", + params: { + id: this.userId, + }, + }); }, }, diff --git a/src/components/Header.vue b/src/components/Header.vue index 61726f2..bda1904 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -73,12 +73,12 @@ export default { return { usertoken: null, profilePictue: null, + userId: null, }; }, mounted() { - - var userdata = localStorage.getItem("spotlight_usertoken"); + this.userId = localStorage.getItem("spotlight_id"); if (userdata) { userdata = JSON.parse(userdata); this.usertoken = userdata.token; @@ -87,11 +87,17 @@ export default { }, methods: { goTo() { - this.$router.push("/profile"); + this.$router.push({ + name: "Profile", + params: { + id: this.userId, + }, + }); }, goToLogin() { localStorage.removeItem("spotlight_usertoken"); localStorage.removeItem("spotlight_email"); + localStorage.removeItem("spotlight_id"); this.$router.push("/login"); }, getProfile() { diff --git a/src/components/Intermediate.vue b/src/components/Intermediate.vue index 4b2b65e..72d78a2 100644 --- a/src/components/Intermediate.vue +++ b/src/components/Intermediate.vue @@ -11,8 +11,12 @@ name: 'Intermediate', data() { var userdata = localStorage.getItem('spotlight_usertoken') + var userid = localStorage.getItem('spotlight_id') if(userdata){ - router.push({ path: '/profile'}) + router.push({ name: 'Profile', + params: { + id: userid, + }, }); } return { msg: 'Welcome to Your Vue.js App' diff --git a/src/components/LandingPage.vue b/src/components/LandingPage.vue index fccc6e8..5b0fef0 100644 --- a/src/components/LandingPage.vue +++ b/src/components/LandingPage.vue @@ -42,13 +42,10 @@ -
+
- + @@ -169,8 +199,7 @@ export default { .light-font-weight { font-weight: 500 !important; } -.no-underline{ +.no-underline { text-decoration: none; } - diff --git a/src/components/Profile.vue b/src/components/Profile.vue index 85a47fa..80d31d6 100644 --- a/src/components/Profile.vue +++ b/src/components/Profile.vue @@ -14,7 +14,9 @@
  • Upload Avatar + >Upload Avatar
  • -
    @@ -453,7 +458,7 @@
  • Comments/Replies({{this.userComments.length}})Comments/Replies({{ this.userComments.length }})
  • @@ -471,7 +476,7 @@