feat: settings

This commit is contained in:
Jannat Patel
2024-08-05 15:12:45 +05:30
parent eed330662b
commit cdb028c69c
2 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<template>
<Dialog
v-model="show"
:options="{
title: __('Settings'),
size: 'xl',
actions: [
{
label: 'Save',
variant: 'solid',
onClick: (close) => {
saveSettings(close)
},
},
],
}"
>
<template #body-content> </template>
</Dialog>
</template>
<script setup>
import { Dialog } from 'frappe-ui'
const show = defineModel()
</script>

View File

@@ -56,6 +56,7 @@
</button>
</template>
</Dropdown>
<SettingsModal v-model="showSettingsModal" />
</template>
<script setup>
@@ -68,12 +69,16 @@ import {
LogOut,
User,
ArrowRightLeft,
Settings,
} from 'lucide-vue-next'
import { useRouter } from 'vue-router'
import { convertToTitleCase } from '../utils'
import { usersStore } from '@/stores/user'
import { ref } from 'vue'
import SettingsModal from '@/components/Modals/Settings.vue'
const router = useRouter()
const showSettingsModal = ref(false)
const { logout, branding } = sessionStore()
let { userResource } = usersStore()
let { isLoggedIn } = sessionStore()
@@ -109,6 +114,17 @@ const userDropdownOptions = [
else return false
},
},
{
icon: Settings,
label: 'Settings',
onClick: () => {
showSettingsModal.value = true
},
condition: () => {
console.log(userResource)
return userResource.data?.is_moderator
},
},
{
icon: LogOut,
label: 'Log out',