2019-03-18 08:53:00 -03:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<portal-target name="dropdown" slim />
|
|
|
|
<div class="flex flex-col">
|
2019-09-28 08:30:44 -03:00
|
|
|
<div class="h-screen flex flex-col" @click="hideDropdownMenus">
|
2019-03-18 08:53:00 -03:00
|
|
|
<div class="md:flex">
|
|
|
|
<div class="bg-indigo-darkest md:flex-no-shrink md:w-56 px-6 py-4 flex items-center justify-between md:justify-center">
|
|
|
|
<inertia-link class="mt-1" href="/">
|
|
|
|
<logo class="fill-white" width="120" height="28" />
|
|
|
|
</inertia-link>
|
|
|
|
<dropdown class="md:hidden" placement="bottom-end">
|
|
|
|
<svg class="fill-white w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z" /></svg>
|
|
|
|
<div slot="dropdown" class="mt-2 px-8 py-4 shadow-lg bg-indigo-darker rounded">
|
2019-09-28 15:52:12 -03:00
|
|
|
<main-menu :url="url()" />
|
2019-03-18 08:53:00 -03:00
|
|
|
</div>
|
|
|
|
</dropdown>
|
|
|
|
</div>
|
|
|
|
<div class="bg-white border-b w-full p-4 md:py-0 md:px-12 text-sm md:text-base flex justify-between items-center">
|
2019-05-15 10:06:24 -03:00
|
|
|
<div class="mt-1 mr-4">{{ $page.auth.user.account.name }}</div>
|
2019-03-18 08:53:00 -03:00
|
|
|
<dropdown class="mt-1" placement="bottom-end">
|
|
|
|
<div class="flex items-center cursor-pointer select-none group">
|
|
|
|
<div class="text-grey-darkest group-hover:text-indigo-dark focus:text-indigo-dark mr-1 whitespace-no-wrap">
|
2019-05-15 10:06:24 -03:00
|
|
|
<span>{{ $page.auth.user.first_name }}</span>
|
|
|
|
<span class="hidden md:inline">{{ $page.auth.user.last_name }}</span>
|
2019-03-18 08:53:00 -03:00
|
|
|
</div>
|
|
|
|
<icon class="w-5 h-5 group-hover:fill-indigo-dark fill-grey-darkest focus:fill-indigo-dark" name="cheveron-down" />
|
|
|
|
</div>
|
|
|
|
<div slot="dropdown" class="mt-2 py-2 shadow-lg bg-white rounded text-sm">
|
2019-05-15 10:06:24 -03:00
|
|
|
<inertia-link class="block px-6 py-2 hover:bg-indigo hover:text-white" :href="route('users.edit', $page.auth.user.id)">My Profile</inertia-link>
|
2019-03-18 08:53:00 -03:00
|
|
|
<inertia-link class="block px-6 py-2 hover:bg-indigo hover:text-white" :href="route('users')">Manage Users</inertia-link>
|
2019-04-15 20:39:49 -03:00
|
|
|
<inertia-link class="block px-6 py-2 hover:bg-indigo hover:text-white" :href="route('logout')" method="post">Logout</inertia-link>
|
2019-03-18 08:53:00 -03:00
|
|
|
</div>
|
|
|
|
</dropdown>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-09-28 08:30:44 -03:00
|
|
|
<div class="flex flex-grow overflow-hidden">
|
2019-09-28 15:52:12 -03:00
|
|
|
<main-menu :url="url()" class="bg-indigo-darker flex-no-shrink w-56 p-12 hidden md:block overflow-y-auto" />
|
2019-09-28 08:30:44 -03:00
|
|
|
<div class="w-full overflow-hidden px-4 py-8 md:p-12 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>
|
|
|
|
import Dropdown from '@/Shared/Dropdown'
|
2019-05-21 20:12:49 -03:00
|
|
|
import FlashMessages from '@/Shared/FlashMessages'
|
2019-03-18 08:53:00 -03:00
|
|
|
import Icon from '@/Shared/Icon'
|
|
|
|
import Logo from '@/Shared/Logo'
|
|
|
|
import MainMenu from '@/Shared/MainMenu'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Dropdown,
|
2019-05-21 20:12:49 -03:00
|
|
|
FlashMessages,
|
2019-03-18 08:53:00 -03:00
|
|
|
Icon,
|
|
|
|
Logo,
|
|
|
|
MainMenu,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showUserMenu: false,
|
|
|
|
accounts: null,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
2019-09-28 15:52:12 -03:00
|
|
|
url() {
|
|
|
|
return location.pathname.substr(1)
|
|
|
|
},
|
2019-03-18 08:53:00 -03:00
|
|
|
hideDropdownMenus() {
|
|
|
|
this.showUserMenu = false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|