Files
leadchat/app/javascript/dashboard/routes/dashboard/settings/SettingsHeader.vue
Sivin Varghese 3054a4cb59 feat: Add support for dark mode in dashboard (#7460)
- Add config for TailwindCSS
- Enable HMR
- Add a config in LocalStorage for Dark Mode

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
2023-07-05 12:13:32 -07:00

80 lines
1.7 KiB
Vue

<template>
<div
class="settings-header bg-white dark:bg-slate-900 border-b border-slate-50 dark:border-slate-800"
>
<h1 class="page-title text-black-900 dark:text-slate-300">
<woot-sidemenu-icon v-if="showSidemenuIcon" />
<back-button
v-if="showBackButton"
:button-label="backButtonLabel"
:back-url="backUrl"
/>
<fluent-icon v-if="icon" :icon="icon" :class="iconClass" />
<slot />
<span>{{ headerTitle }}</span>
</h1>
<router-link
v-if="showNewButton && isAdmin"
:to="buttonRoute"
class="button success button--fixed-top"
>
<fluent-icon icon="add-circle" />
<span class="button__content">
{{ buttonText }}
</span>
</router-link>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
import BackButton from '../../../components/widgets/BackButton';
import adminMixin from '../../../mixins/isAdmin';
export default {
components: {
BackButton,
},
mixins: [adminMixin],
props: {
headerTitle: {
default: '',
type: String,
},
buttonRoute: {
default: '',
type: String,
},
buttonText: {
default: '',
type: String,
},
icon: {
default: '',
type: String,
},
showBackButton: { type: Boolean, default: false },
showNewButton: { type: Boolean, default: false },
backUrl: {
type: [String, Object],
default: '',
},
backButtonLabel: {
type: String,
default: '',
},
showSidemenuIcon: {
type: Boolean,
default: true,
},
},
computed: {
...mapGetters({
currentUser: 'getCurrentUser',
}),
iconClass() {
return `icon ${this.icon} header--icon`;
},
},
};
</script>