/
AccountSettings.vue
182 lines (146 loc) · 5.57 KB
/
AccountSettings.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
// Copyright (C) 2023 Storj Labs, Inc.
// See LICENSE for copying information.
<template>
<v-container>
<!-- <v-breadcrumbs :items="['My Account', 'Settings']" class="pl-0"></v-breadcrumbs> -->
<h1 class="text-h5 font-weight-bold mb-2">Settings</h1>
<v-card
variant="flat"
:border="true"
class="mx-auto my-6"
>
<v-list lines="three">
<v-list-subheader class="mb-2">Profile</v-list-subheader>
<v-divider />
<v-list-item>
<v-list-item-title>Name</v-list-item-title>
<v-list-item-subtitle>
{{ user.getFullName() }}
</v-list-item-subtitle>
<template #append>
<v-list-item-action>
<v-btn variant="outlined" color="default" size="small" @click="isChangeNameDialogShown = true">
Edit Name
</v-btn>
</v-list-item-action>
</template>
</v-list-item>
<v-divider />
<v-list-item>
<v-list-item-title>Email</v-list-item-title>
<v-list-item-subtitle>
{{ user.email }}
</v-list-item-subtitle>
<!-- <template v-slot:append>
<v-list-item-action>
<v-btn>Change Email</v-btn>
</v-list-item-action>
</template> -->
</v-list-item>
</v-list>
</v-card>
<v-card
variant="flat"
:border="true"
class="mx-auto my-6"
>
<v-list lines="three">
<v-list-subheader class="mb-2">Security</v-list-subheader>
<v-divider />
<v-list-item>
<v-list-item-title>Password</v-list-item-title>
<v-list-item-subtitle>
**********
</v-list-item-subtitle>
<template #append>
<v-list-item-action>
<v-btn variant="outlined" color="default" size="small" @click="isChangePasswordDialogShown = true">
Change Password
</v-btn>
</v-list-item-action>
</template>
</v-list-item>
<v-divider />
<v-list-item>
<v-list-item-title>Two-factor authentication</v-list-item-title>
<v-list-item-subtitle>
Improve account security by enabling 2FA.
</v-list-item-subtitle>
<template #append>
<v-list-item-action>
<v-btn size="small">Enable Two-factor</v-btn>
</v-list-item-action>
</template>
</v-list-item>
<v-divider />
<v-list-item>
<v-list-item-title>Session Timeout</v-list-item-title>
<v-list-item-subtitle>
Set timeout to log you out for inactivity.
</v-list-item-subtitle>
<template #append>
<v-list-item-action>
<v-btn variant="outlined" color="default" size="small">Set Timeout</v-btn>
</v-list-item-action>
</template>
</v-list-item>
</v-list>
</v-card>
<v-card
variant="flat"
:border="true"
class="mx-auto my-6"
>
<v-list lines="three" select-strategy="classic">
<v-list-subheader class="mb-2">Notifications</v-list-subheader>
<v-divider />
<v-list-item value="notifications" color="default">
<template #append="{ isActive }">
<v-list-item-action start>
<v-checkbox-btn :model-value="isActive" />
</v-list-item-action>
</template>
<v-list-item-title>Product newsletter</v-list-item-title>
<v-list-item-subtitle>
Notify me about product updates.
</v-list-item-subtitle>
</v-list-item>
</v-list>
</v-card>
</v-container>
<ChangePasswordDialog
v-model="isChangePasswordDialogShown"
/>
<ChangeNameDialog
v-model="isChangeNameDialogShown"
/>
</template>
<script setup lang="ts">
import { computed, ref } from 'vue';
import {
VContainer,
VCard,
VList,
VListSubheader,
VDivider,
VListItem,
VListItemTitle,
VListItemSubtitle,
VListItemAction,
VBtn,
VCheckboxBtn,
} from 'vuetify/components';
import { useUsersStore } from '@/store/modules/usersStore';
import { User } from '@/types/users';
import ChangePasswordDialog from '@poc/components/dialogs/ChangePasswordDialog.vue';
import ChangeNameDialog from '@poc/components/dialogs/ChangeNameDialog.vue';
const usersStore = useUsersStore();
const isChangePasswordDialogShown = ref<boolean>(false);
const isChangeNameDialogShown = ref<boolean>(false);
/**
* Returns user entity from store.
*/
const user = computed((): User => {
return usersStore.state.user;
});
</script>