Move user menu to sidebar, fixes #35
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import AppContent from '@/components/AppContent.vue';
|
||||
import { Head } from '@inertiajs/vue3'
|
||||
import AppSidebar from '@/components/AppSidebar.vue';
|
||||
import { onMounted } from 'vue';
|
||||
import 'vue-sonner/style.css'
|
||||
@@ -13,6 +13,9 @@ import { usePage } from '@inertiajs/vue3';
|
||||
|
||||
const isOpen = usePage().props.sidebarOpen;
|
||||
const alert = alertStore()
|
||||
const props = defineProps<{
|
||||
title: string;
|
||||
}>();
|
||||
|
||||
onMounted(() => {
|
||||
if (navigator.platform.toUpperCase().indexOf('MAC') >= 0) {
|
||||
@@ -23,6 +26,9 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
<Head :title="props.title" />
|
||||
|
||||
<Toaster position="top-right" :expand="true" closeButton :visible-toasts="6" :offset="'1rem'" :toastOptions="{
|
||||
unstyled: true,
|
||||
classes: {
|
||||
@@ -57,12 +63,17 @@ onMounted(() => {
|
||||
</template>
|
||||
</Toaster>
|
||||
|
||||
<SidebarProvider :default-open="isOpen">
|
||||
<AppSidebar />
|
||||
<AppContent variant="sidebar" class="overflow-x-hidden bg-main">
|
||||
<slot />
|
||||
</AppContent>
|
||||
</SidebarProvider>
|
||||
<div class="overflow-x-auto p-4 lg:p-8 lg:pl-4 print:bg-transparent print:p-0 print:m-0">
|
||||
|
||||
<SidebarProvider :default-open="isOpen">
|
||||
<AppSidebar />
|
||||
|
||||
<main class="w-full overflow-x-hidden">
|
||||
<slot />
|
||||
</main>
|
||||
</SidebarProvider>
|
||||
|
||||
</div>
|
||||
|
||||
<AlertDialog v-model:open="alert.open">
|
||||
<AlertDialogContent>
|
||||
@@ -76,7 +87,6 @@ onMounted(() => {
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user