pingcrm/resources/js/Shared/Layout.vue

78 lines
3.2 KiB
Vue
Raw Normal View History

2019-03-18 08:53:00 -03:00
<template>
<div>
2021-12-08 12:15:39 -03:00
<div id="dropdown" />
2020-09-26 08:27:51 -03:00
<div class="md:flex md:flex-col">
2021-12-08 14:52:56 -03:00
<div class="md:flex md:flex-col md:h-screen">
2020-09-26 08:27:51 -03:00
<div class="md:flex md:flex-shrink-0">
2021-12-08 14:52:56 -03:00
<div class="flex items-center justify-between px-6 py-4 bg-indigo-900 md:flex-shrink-0 md:justify-center md:w-56">
2021-12-08 12:15:39 -03:00
<Link class="mt-1" href="/">
2019-03-18 08:53:00 -03:00
<logo class="fill-white" width="120" height="28" />
2021-12-08 12:15:39 -03:00
</Link>
2019-03-18 08:53:00 -03:00
<dropdown class="md:hidden" placement="bottom-end">
2021-12-08 12:15:39 -03:00
<template #default>
2021-12-08 14:52:56 -03:00
<svg class="w-6 h-6 fill-white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z" /></svg>
2021-12-08 12:15:39 -03:00
</template>
<template #dropdown>
2021-12-08 14:52:56 -03:00
<div class="mt-2 px-8 py-4 bg-indigo-800 rounded shadow-lg">
2021-12-08 12:15:39 -03:00
<main-menu />
</div>
</template>
2019-03-18 08:53:00 -03:00
</dropdown>
</div>
2021-12-08 14:52:56 -03:00
<div class="md:text-md flex items-center justify-between p-4 w-full text-sm bg-white border-b md:px-12 md:py-0">
<div class="mr-4 mt-1">{{ auth.user.account.name }}</div>
2019-03-18 08:53:00 -03:00
<dropdown class="mt-1" placement="bottom-end">
2021-12-08 12:15:39 -03:00
<template #default>
2021-12-08 14:52:56 -03:00
<div class="group flex items-center cursor-pointer select-none">
<div class="mr-1 text-gray-700 group-hover:text-indigo-600 focus:text-indigo-600 whitespace-nowrap">
2021-12-08 12:15:39 -03:00
<span>{{ auth.user.first_name }}</span>
2021-12-08 14:00:56 -03:00
<span class="hidden md:inline">&nbsp;{{ auth.user.last_name }}</span>
2021-12-08 12:15:39 -03:00
</div>
2021-12-08 14:52:56 -03:00
<icon class="w-5 h-5 fill-gray-700 group-hover:fill-indigo-600 focus:fill-indigo-600" name="cheveron-down" />
2021-12-08 12:15:39 -03:00
</div>
</template>
<template #dropdown>
2021-12-08 14:52:56 -03:00
<div class="mt-2 py-2 text-sm bg-white rounded shadow-xl">
<Link class="block px-6 py-2 hover:text-white hover:bg-indigo-500" :href="`/users/${auth.user.id}/edit`">My Profile</Link>
<Link class="block px-6 py-2 hover:text-white hover:bg-indigo-500" href="/users">Manage Users</Link>
<Link class="block px-6 py-2 w-full text-left hover:text-white hover:bg-indigo-500" href="/logout" method="delete" as="button">Logout</Link>
2019-03-18 08:53:00 -03:00
</div>
2021-12-08 12:15:39 -03:00
</template>
2019-03-18 08:53:00 -03:00
</dropdown>
</div>
</div>
2020-09-26 08:27:51 -03:00
<div class="md:flex md:flex-grow md:overflow-hidden">
2021-12-08 14:52:56 -03:00
<main-menu class="hidden flex-shrink-0 p-12 w-56 bg-indigo-800 overflow-y-auto md:block" />
<div class="px-4 py-8 md:flex-1 md:p-12 md:overflow-y-auto" scroll-region>
2019-05-21 20:12:49 -03:00
<flash-messages />
2019-03-18 08:53:00 -03:00
<slot />
</div>
</div>
</div>
</div>
</div>
</template>
<script>
2021-12-08 12:15:39 -03:00
import { Link } from '@inertiajs/inertia-vue3'
2019-03-18 08:53:00 -03:00
import Icon from '@/Shared/Icon'
import Logo from '@/Shared/Logo'
2021-02-27 11:00:09 -03:00
import Dropdown from '@/Shared/Dropdown'
2019-03-18 08:53:00 -03:00
import MainMenu from '@/Shared/MainMenu'
2021-02-27 11:00:09 -03:00
import FlashMessages from '@/Shared/FlashMessages'
2019-03-18 08:53:00 -03:00
export default {
components: {
Dropdown,
2019-05-21 20:12:49 -03:00
FlashMessages,
2019-03-18 08:53:00 -03:00
Icon,
2021-12-08 12:15:39 -03:00
Link,
2019-03-18 08:53:00 -03:00
Logo,
MainMenu,
},
2021-12-08 12:15:39 -03:00
props: {
auth: Object,
},
2019-03-18 08:53:00 -03:00
}
</script>