Skip to content

Commit

Permalink
Edit Feedbacks nayarahilton#3
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasjs committed Dec 10, 2017
1 parent 1d8fb46 commit a8598b7
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 17 deletions.
File renamed without changes
103 changes: 100 additions & 3 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import RegisterGuruView from '@/views/RegisterGuruView';
import RegisterAprendizView from '@/views/RegisterAprendizView';
import ProfileView from '@/views/ProfileView';
import MyProfileView from '@/views/MyProfileView';
import FeedbackView from '@/views/FeedbackView';
import FeedbackGuruView from '@/views/FeedbackGuruView';
import FeedbackAprendizView from '@/views/FeedbackAprendizView';
import PostView from '@/views/PostView';
import ProfessionView from '@/views/ProfessionView';
import AskView from '@/views/AskView';
Expand Down Expand Up @@ -49,11 +50,25 @@ export default new Router({
path: '/postar',
name: 'postar',
component: PostView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/buscar',
name: 'search-view',
component: SearchView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/bemvindo',
Expand Down Expand Up @@ -91,51 +106,133 @@ export default new Router({
path: '/perfil',
name: 'profile',
component: ProfileView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/meu-perfil',
name: 'my-profile',
component: MyProfileView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/profissao',
name: 'profession',
component: ProfessionView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/feedback',
path: '/feedback-guru',
name: 'feedback',
component: FeedbackView,
component: FeedbackGuruView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/feedback-aprendiz',
name: 'feedback-aprendiz',
component: FeedbackAprendizView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/perguntar',
name: 'perguntar',
component: AskView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/responder',
name: 'responder',
component: AnswerView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/perguntas',
name: 'perguntas',
component: QuestionsView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/sucesso-perguntas',
name: 'feedback-answer',
component: FeedbackAnswerView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/perguntas-respondidas',
name: 'answered-questions',
component: AnsweredQuestionsView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/perguntas-nao-respondidas',
name: 'not-answered-questions',
component: NotAnsweredQuestionsView,
beforeEnter(to, from, next) {
if (store.state.idToken) {
next();
} else {
next('/bemvindo');
}
},
},
{
path: '/contato',
Expand Down
33 changes: 21 additions & 12 deletions src/views/FeedbackView.vue → src/views/FeedbackAprendizView.vue
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
<template>
<div class="feedback-view">
<div class="feedback-img">
<img src="/">
<img class="logo-symbol" src="../assets/icons/register-success-icon.svg" alt="Imagem de um crachá">
</div>
<div class="feedback-info">
<h2 class="feedback-title">
{{ title }}
Perfil criado <br/>com sucesso!
</h2>
<p class="feedback-text">
{{ text }}
Vamos começar aprendendo?
</p>
</div>
<main-button buttonType="router" text-inner="Primeiro post" linkto="/post"></main-button>
<router-link
class="feedback-link"
to="/home"
>
Ok, vamos ;)
</router-link>
</div>
</template>

<script>
import MainButton from '../components/MainButton';
export default {
data() {
return {
title: 'Perfil criado com sucesso!',
text: 'Vamos começar espalhando seu conheciemento?',
};
},
components: {
'main-button': MainButton,
},
};
</script>

<style lang="stylus" scoped>
@import '../assets/styles/*'
.feedback
&-view
min-height calc(100vh - 56px)
Expand All @@ -45,7 +46,6 @@ export default {
text-align center
&-img
background purple
width 250px
height 200px
Expand All @@ -62,4 +62,13 @@ export default {
font-size 18px
line-height 100%
margin-top 10px
</style>
&-link
color $dark-blue
font-size 14pt
font-weight 700
margin-top 40px
.main-btn
margin-top 20px
</style>
79 changes: 79 additions & 0 deletions src/views/FeedbackGuruView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<template>
<div class="feedback-view">
<div class="feedback-img">
<img class="logo-symbol" src="../assets/icons/register-success-icon.svg" alt="Imagem de um crachá">
</div>
<div class="feedback-info">
<h2 class="feedback-title">
Perfil criado <br/>com sucesso!
</h2>
<p class="feedback-text">
Vamos começar espalhando seu conhecimento?
</p>
</div>
<main-button
buttonType="router"
text-inner="Primeiro post"
linkto="/postar"
/>
<router-link
class="feedback-link"
to="/home"
>
Depois eu faço isso
</router-link>
</div>
</template>

<script>
import MainButton from '../components/MainButton';
export default {
components: {
'main-button': MainButton,
},
};
</script>

<style lang="stylus" scoped>
@import '../assets/styles/*'
.feedback
&-view
min-height calc(100vh - 56px)
display flex
flex-direction column
align-items center
justify-content center
color #333
padding 20px
box-sizing border-box
text-align center
&-img
width 250px
height 200px
&-info
padding 0 30px
box-sizing border-box
&-title
font-size 34px
line-height 100%
margin-bottom 0
&-text
font-size 18px
line-height 100%
margin-top 10px
&-link
color $dark-blue
font-size 14pt
font-weight 700
margin-top 40px
.main-btn
margin-top 20px
</style>
2 changes: 1 addition & 1 deletion src/views/RegisterAprendizView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export default {
console.log(formData);
this.$store.dispatch('signup', formData);
setTimeout(() => {
this.$router.push('/home');
this.$router.push('/feedback-aprendiz');
}, 1000);
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/views/RegisterGuruView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export default {
console.log(formData);
this.$store.dispatch('signup', formData);
setTimeout(() => {
this.$router.push('/home');
this.$router.push('/feedback-guru');
}, 1000);
},
},
Expand Down

0 comments on commit a8598b7

Please sign in to comment.