File tree Expand file tree Collapse file tree 8 files changed +106
-27
lines changed Expand file tree Collapse file tree 8 files changed +106
-27
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" text-anthrazit font-bold" >
3
- <div @click =" dropdownActivated=!dropdownActivated "
3
+ <div @click =" TOGGLE_NOTIFICATION_DROPDOWN() "
4
4
class =" rounded-full cursor-pointer p-2 hover:bg-primary relative" >
5
5
<img src =" ~/assets/notification.png" alt =" login symbol" >
6
6
<div v-if =" getNotifications.length > 0"
10
10
</div >
11
11
</div >
12
12
13
- <div v-if =" dropdownActivated " class =" absolute z-50 mt-3 bg-white left-0 mr-6 rounded shadow-md w-full" >
13
+ <div v-if =" isDroppedDown " class =" absolute z-50 mt-3 bg-white left-0 mr-6 rounded shadow-md w-full" >
14
14
15
15
<div v-if =" getNotifications.length > 0" >
16
16
<div class =" relative px-5 py-4 hover:bg-gray-200 cursor-pointer" v-for =" (notification, index) in getNotifications" >
47
47
</template >
48
48
49
49
<script >
50
- import { mapGetters , mapActions } from ' vuex'
50
+ import { mapGetters , mapActions , mapMutations } from ' vuex'
51
51
52
52
export default {
53
53
data () {
56
56
}
57
57
},
58
58
methods: {
59
- ... mapActions (' notifications' , [' deleteNotification' ])
59
+ ... mapActions (' notifications' , [' deleteNotification' ]),
60
+ ... mapMutations ([' TOGGLE_NOTIFICATION_DROPDOWN' ])
60
61
},
61
62
computed: {
62
- ... mapGetters (' notifications' ,[' getNotifications' ])
63
+ ... mapGetters ({
64
+ getNotifications: ' notifications/getNotifications' ,
65
+ isDroppedDown: ' isNotificationDropDownActivated'
66
+ })
63
67
}
64
68
}
65
69
</script >
Original file line number Diff line number Diff line change 131
131
},
132
132
mounted () {
133
133
if (this .$auth .user .name ) {
134
- this .firstName = this .$store . getters [ ' profile/ getUserProfile' ] .userAuth0 .given_name ;
135
- this .lastName = this .$store . getters [ ' profile/ getUserProfile' ] .userAuth0 .family_name ;
134
+ this .firstName = this .getUserProfile .userAuth0 .given_name ;
135
+ this .lastName = this .getUserProfile .userAuth0 .family_name ;
136
136
}
137
- if (this .$store . getters [ ' profile/ getUserProfile' ] .profileIsCompleted ) {
138
- this .birthday = this .$store . getters [ ' profile/ getUserProfile' ] .mangoPayUser .Birthday .toString ()
137
+ if (this .getUserProfile .profileIsCompleted ) {
138
+ this .birthday = this .getUserProfile .mangoPayUser .Birthday .toString ()
139
139
}
140
140
141
141
this .$v .$touch ();
160
160
let url = URL .createObjectURL (event .target .files [0 ])
161
161
},
162
162
getSocialProfiles (identityProvider ) {
163
- const identities = this .$store . getters [ ' profile/ getUserProfile' ] .userAuth0 .identities
163
+ const identities = this .getUserProfile .userAuth0 .identities
164
164
return identities .filter (identity => identity .provider === identityProvider).length > 0 ? ' Verbunden' : ' ' ;
165
165
},
166
166
completeUserRegistration () {
Original file line number Diff line number Diff line change 71
71
</template >
72
72
73
73
<script >
74
- import { mapActions } from ' vuex'
74
+ import { mapActions , mapGetters } from ' vuex'
75
75
import { validationMixin } from ' vuelidate'
76
76
import { required ,numeric } from ' vuelidate/lib/validators'
77
77
78
78
export default {
79
79
mixins: [validationMixin],
80
80
mounted () {
81
- if (this .$store . getters [ ' profile/ getUserProfile' ] .profileIsCompleted
82
- && this .$store . getters [ ' profile/ getUserProfile' ] .mangoPayUser .Address .AddressLine1 ) {
83
- Object .assign (this .Address , this .$store . getters [ ' profile/ getUserProfile' ] .mangoPayUser .Address );
81
+ if (this .getUserProfile .profileIsCompleted
82
+ && this .getUserProfile .mangoPayUser .Address .AddressLine1 ) {
83
+ Object .assign (this .Address , this .getUserProfile .mangoPayUser .Address );
84
84
}
85
85
},
86
86
data () {
105
105
}
106
106
}
107
107
},
108
+ computed: {
109
+ ... mapGetters (' profile' , [' getUserProfile' ])
110
+ },
108
111
validations: {
109
112
Address: {
110
113
AddressLine1: {
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div @click =" TOGGLE_PROFILE_DROPDOWN()" class =" absolute z-50 mt-3 bg-white right-0 mr-6 rounded shadow-md w-2/3" >
2
+ <div @click.stop =" TOGGLE_PROFILE_DROPDOWN()" class =" absolute shadow z-50 mt-3 bg-white right-0 mr-6 rounded w-2/3" >
3
3
<nuxt-link to =" /profile" >
4
4
<div class =" px-5 py-2 hover:bg-gray-200 cursor-pointer" >Mein Profil</div >
5
5
</nuxt-link >
Original file line number Diff line number Diff line change 45
45
Einloggen
46
46
</a >
47
47
48
- <app-profile-dropdown v-if =" isDropDownActivated && $auth.loggedIn" ></app-profile-dropdown >
48
+ <app-profile-dropdown v-if =" isProfileDropDownActivated && $auth.loggedIn" ></app-profile-dropdown >
49
49
50
50
</div >
51
51
</div >
83
83
return {
84
84
view: {
85
85
atTopOfPage: true ,
86
- profileDropDownActivated: false ,
87
86
}
88
87
}
89
88
},
90
89
beforeMount () {
91
90
window .addEventListener (' scroll' , this .handleScroll );
92
91
},
93
92
computed: {
94
- ... mapGetters ([" isDropDownActivated " ])
93
+ ... mapGetters ([" isProfileDropDownActivated " ])
95
94
},
96
95
methods: {
97
- ... mapMutations ([" TOGGLE_PROFILE_DROPDOWN" ]),
96
+ ... mapMutations ([" TOGGLE_PROFILE_DROPDOWN" , " CLOSE_PROFILE_DROPDOWN " ]),
98
97
handleScroll () {
99
98
if (window .pageYOffset > 0 ) {
100
99
// user is scrolled
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div >
3
3
<TheHeader />
4
- <nuxt />
4
+ <div @click =" closeDropDowns()" >
5
+ <nuxt />
6
+ </div >
5
7
<TheSnackbar />
6
8
<TheFooter />
7
9
</div >
11
13
import TheHeader from ' @/components/TheHeader'
12
14
import TheFooter from " @/components/TheFooter" ;
13
15
import TheSnackbar from " ../components/TheSnackbar" ;
16
+ import { mapMutations } from ' vuex'
14
17
15
18
export default {
16
19
components: {
17
20
TheSnackbar,
18
21
TheFooter,
19
22
TheHeader
23
+ },
24
+ methods: {
25
+ ... mapMutations ([' CLOSE_PROFILE_DROPDOWN' ,' CLOSE_NOTIFICATION_DROPDOWN' ]),
26
+ closeDropDowns () {
27
+ this .CLOSE_PROFILE_DROPDOWN ();
28
+ this .CLOSE_NOTIFICATION_DROPDOWN ();
29
+ }
20
30
}
21
31
}
22
32
</script >
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div >
3
- email
2
+ <div class =" max-w-2xl mt-16 mx-auto" >
3
+ <div class =" mt-5" >
4
+ <h3 class =" font-bold text-2xl" >Neue E-Mail</h3 >
5
+
6
+ <p class =" mt-3" >
7
+ Du kannst dich mit dieser E-Mail anmelden, sobald du sie bestätigt hast. <br />
8
+ Wenn du deine neue E-Mail angegeben hast, wird eine Bestätigungsmail an diese Mail gesendet.
9
+ Bis dahin musst du dich mit deiner aktuellen Mail anmelden.
10
+ </p >
11
+
12
+
13
+ <div class =" mt-5" >
14
+ <button
15
+ @click =" updateEmail()"
16
+ class =" font-bold rounded shadow block bg-primary hover:bg-white px-4 py-2" >
17
+ E-Mail aktualisieren
18
+ </button >
19
+ </div >
20
+
4
21
</div >
22
+ </div >
5
23
</template >
6
24
7
25
<script >
8
- export default {
9
- name: " index" ,
10
- middleware: ' changeEmail'
26
+ import { validationMixin } from ' vuelidate'
27
+ import { required , email } from ' vuelidate/lib/validators'
28
+
29
+ export default {
30
+ mounted () {
31
+ this .email = this .$auth .user .email
32
+ },
33
+ mixins: [validationMixin],
34
+ middleware: [' auth' , ' changeEmail' ],
35
+ data () {
36
+ return {
37
+ email: " "
38
+ }
39
+ },
40
+ validations: {
41
+ email: {
42
+ required,
43
+ email
44
+ }
45
+ },
46
+ methods: {
47
+ updateEmail () {
48
+ if (this .$v .$invalid ) {
49
+ this .$v .$touch ();
50
+ } else {
51
+ alert (' E-Mail changed' )
52
+ }
53
+ }
11
54
}
55
+ }
12
56
</script >
13
57
14
58
<style scoped>
59
+ .is-invalid {
60
+ @apply border border-red- 500;
61
+ }
15
62
63
+ .error {
64
+ @apply text-sm text-red- 500;
65
+ }
16
66
</style >
Original file line number Diff line number Diff line change 1
1
export const state = ( ) => ( {
2
- profileDropDownActivated : false
2
+ profileDropDownActivated : false ,
3
+ notificationDropdownActivated : false
3
4
} )
4
5
5
6
export const getters = {
6
- isDropDownActivated : state => {
7
+ isProfileDropDownActivated : state => {
7
8
return state . profileDropDownActivated
9
+ } ,
10
+ isNotificationDropDownActivated : state => {
11
+ return state . notificationDropdownActivated
8
12
}
9
13
}
10
14
11
15
export const mutations = {
12
16
TOGGLE_PROFILE_DROPDOWN ( state ) {
13
17
state . profileDropDownActivated = ! state . profileDropDownActivated
14
18
} ,
19
+ CLOSE_PROFILE_DROPDOWN ( state ) {
20
+ state . profileDropDownActivated = false
21
+ } ,
22
+ TOGGLE_NOTIFICATION_DROPDOWN ( state ) {
23
+ state . notificationDropdownActivated = ! state . notificationDropdownActivated
24
+ } ,
25
+ CLOSE_NOTIFICATION_DROPDOWN ( state ) {
26
+ state . notificationDropdownActivated = false
27
+ } ,
15
28
}
You can’t perform that action at this time.
0 commit comments