File tree 9 files changed +53
-79
lines changed
9 files changed +53
-79
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <v-app >
3
- <TopNav :openDrawer =" openDrawer" />
2
+ <v-app :theme = " theme " >
3
+ <TopNav :openDrawer =" openDrawer" v-model:theme = " theme " />
4
4
<MobileDrawer />
5
5
6
- <v-content mb-8 >
6
+ <v-content >
7
7
<RouterView />
8
8
</v-content >
9
9
<v-snackbar v-model =" snackbarOptions.show" :multi-line =" true" :right =" true" :top =" true" :timeout =" 6000"
20
20
</template >
21
21
22
22
<script setup>
23
- import { toRefs } from ' vue'
23
+ import { ref , toRefs } from ' vue'
24
24
import { RouterView } from ' vue-router'
25
25
import { useGeneralStore } from ' @/stores/general'
26
26
@@ -29,4 +29,5 @@ import MobileDrawer from '@/components/MobileDrawer.vue'
29
29
30
30
const generalStore = useGeneralStore ()
31
31
const { snackbarOptions , isLoading } = toRefs (generalStore)
32
+ const theme = ref (' light' )
32
33
</script >
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11
11
12
12
<v-spacer ></v-spacer >
13
13
14
+ <v-btn :prepend-icon =" theme === 'light' ? 'mdi-weather-sunny' : 'mdi-weather-night'" text =" Toggle Theme" slim
15
+ @click =" toggleTheme" variant =" outlined" class =" mr-4" />
16
+
14
17
<v-toolbar-items v-if =" mobile" >
15
18
<v-btn @click =" openDrawer()" >
16
19
Menu
27
30
<v-btn v-if =" user.token" to =" /curricula/create" text >
28
31
Create
29
32
</v-btn >
30
- <v-btn v-if =" !user.token" to =" /login" color = " secondary " class = " black--text " >
33
+ <v-btn v-if =" !user.token" to =" /login" >
31
34
Log In
32
35
</v-btn >
33
36
34
37
<v-menu v-else left bottom offset-y >
35
38
<template v-slot :activator =" { on } " >
36
- <v-btn v-on =" on" color =" secondary" class = " black--text " >
39
+ <v-btn v-on =" on" color =" secondary" >
37
40
<v-icon left >mdi-account-outline</v-icon >
38
41
{{ user.username }}
39
42
</v-btn >
@@ -67,4 +70,18 @@ const logout = () => {
67
70
68
71
const authStore = useAuthStore ()
69
72
const { user } = toRefs (authStore)
73
+
74
+ const props = defineProps ({
75
+ theme: {
76
+ type: String ,
77
+ required: true ,
78
+ }
79
+ })
80
+
81
+ const emit = defineEmits ([' update:theme' ])
82
+
83
+ function toggleTheme () {
84
+ const newTheme = props .theme === ' light' ? ' dark' : ' light'
85
+ emit (' update:theme' , newTheme)
86
+ }
70
87
</script >
Original file line number Diff line number Diff line change 1
1
import 'vuetify/styles'
2
2
import '@mdi/font/css/materialdesignicons.css'
3
- import './assets/main.css'
4
3
import './sass/index.sass'
5
4
6
5
import { createApp } from 'vue'
Original file line number Diff line number Diff line change 2
2
<v-row class =" auth-wrapper mt-10" >
3
3
<v-col md =" 4" offset-md =" 4" sm =" 6" offset-sm =" 3" cols =" 12" >
4
4
<v-form class =" create-form" >
5
- <v-card >
6
- <v-card-subtitle >
5
+ <v-card variant = " outlined " >
6
+ <v-card-title class = " mb-2 " >
7
7
<h3 class =" title" >
8
8
<slot name =" title" ></slot >
9
9
</h3 >
10
- </v-card-subtitle >
11
- <v-card-text >
10
+ </v-card-title >
11
+ <v-card-text class = " pb-0 " >
12
12
<slot name =" form" ></slot >
13
13
</v-card-text >
14
- <v-card-actions >
15
- <slot name =" actions" ></slot >
14
+ <v-card-actions class =" pl-1" >
15
+ <v-col >
16
+ <slot name =" actions" ></slot >
17
+ <slot name =" link" ></slot >
18
+ </v-col >
16
19
</v-card-actions >
17
- <slot name =" link" ></slot >
18
20
</v-card >
19
21
</v-form >
20
22
</v-col >
Original file line number Diff line number Diff line change 4
4
Forgot Password
5
5
</template >
6
6
<template #form >
7
- <v-text-field
8
- label =" Email"
9
- v-model =" email"
10
- />
7
+ <v-text-field label =" Email" v-model =" email" variant =" outlined" />
11
8
</template >
12
9
<template #actions >
13
- <v-btn @click =" submit" color =" primary" >Submit</v-btn >
10
+ <v-btn @click =" submit" color =" primary" variant = " outlined " >Submit</v-btn >
14
11
</template >
15
12
<template #link >
16
- <p class =" pa-2" >Don't have an account? <router-link :to =" {name: 'register'}" >Register here</router-link ></p >
13
+ <p class =" mb-1 mt-4" >Don't have an account? <router-link :to =" { name: 'register' }" >Register here</router-link >
14
+ </p >
17
15
</template >
18
16
</AuthTemplate >
19
17
</template >
Original file line number Diff line number Diff line change 4
4
Login
5
5
</template >
6
6
<template #form >
7
- <v-text-field label =" Email" v-model =" email" :error-messages =" emailErrors" required />
8
- <v-text-field label =" Password" v-model =" password" :error-messages =" passwordErrors" required />
7
+ <v-text-field label =" Email" v-model =" email" :error-messages =" emailErrors" required variant = " outlined " />
8
+ <v-text-field label =" Password" v-model =" password" :error-messages =" passwordErrors" required variant = " outlined " />
9
9
</template >
10
10
<template #actions >
11
- <v-btn @click =" submit" color =" primary" >Submit</v-btn >
11
+ <v-btn @click =" submit" color =" primary" variant = " outlined " >Submit</v-btn >
12
12
</template >
13
13
<template #link >
14
- <p class =" pa-2 mb-n1 " >Forgot Password? <router-link :to =" { name: 'forgot-password' }" >Update password
14
+ <p class =" mb-1 mt-4 " >Forgot Password? <router-link :to =" { name: 'forgot-password' }" >Update password
15
15
here</router-link ></p >
16
- <p class = " pa-2 " >Don't have an account? <router-link :to =" { name: 'register' }" >Register here</router-link ></p >
16
+ <p >Don't have an account? <router-link :to =" { name: 'register' }" >Register here</router-link ></p >
17
17
</template >
18
18
</AuthTemplate >
19
19
</template >
Original file line number Diff line number Diff line change 4
4
Register
5
5
</template >
6
6
<template #form >
7
- <v-text-field label =" Username" v-model =" username" required />
8
- <v-text-field label =" Email" v-model =" email" required />
9
- <v-text-field label =" Password" v-model =" password" required />
7
+ <v-text-field label =" Username" v-model =" username" required variant = " outlined " />
8
+ <v-text-field label =" Email" v-model =" email" required variant = " outlined " />
9
+ <v-text-field label =" Password" v-model =" password" required variant = " outlined " />
10
10
</template >
11
11
<template #actions >
12
- <v-btn @click =" submit" color =" primary" >Submit</v-btn >
12
+ <v-btn @click =" submit" color =" primary" variant = " outlined " >Submit</v-btn >
13
13
</template >
14
14
<template #link >
15
- <p class =" pa-2 " >Already have an account? <router-link :to =" { name: 'login' }" >Login here</router-link ></p >
15
+ <p class =" mb-1 mt-4 " >Already have an account? <router-link :to =" { name: 'login' }" >Login here</router-link ></p >
16
16
</template >
17
17
</AuthTemplate >
18
18
</template >
Original file line number Diff line number Diff line change 4
4
Reset Password
5
5
</template >
6
6
<template #form >
7
- <v-text-field
8
- label =" Code"
9
- v-model =" code"
10
- />
11
- <v-text-field
12
- label =" New Password"
13
- v-model =" password"
14
- />
15
- <v-text-field
16
- label =" Confirm Password"
17
- v-model =" confirmPassword"
18
- />
7
+ <v-text-field label =" Code" variant =" outlined" v-model =" code" />
8
+ <v-text-field label =" New Password" variant =" outlined" v-model =" password" />
9
+ <v-text-field label =" Confirm Password" variant =" outlined" v-model =" confirmPassword" />
19
10
</template >
20
11
<template #actions >
21
- <v-btn @click =" submit" color =" primary" >Submit</v-btn >
12
+ <v-btn @click =" submit" color =" primary" variant = " outlined " >Submit</v-btn >
22
13
</template >
23
14
<template #link >
24
- <p class =" pa-2" >Don't have an account? <router-link :to =" {name: 'register'}" >Register here</router-link ></p >
15
+ <p class =" mb-1 mt-4" >Don't have an account? <router-link :to =" { name: 'register' }" >Register here</router-link >
16
+ </p >
25
17
</template >
26
18
</AuthTemplate >
27
19
</template >
You can’t perform that action at this time.
0 commit comments