|
1 | 1 | <template> |
2 | | - <header class="bg-white border-b border-slate-200"> |
| 2 | + <header class="bg-white border-b border-brand-200 px-4 sm:px-6 xl:px-8"> |
3 | 3 | <nav> |
4 | | - <div class="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8"> |
| 4 | + <div class="mx-auto max-w-7xl"> |
5 | 5 | <div class="flex h-16 items-center justify-between"> |
6 | 6 | <div class="flex items-center"> |
7 | 7 | <Link :href="route('home')"> |
8 | | - <SparklesIcon class="h-8 w-8 flex-shrink-0" /> |
| 8 | + <SparklesIcon class="h-8 w-8 flex-shrink-0 text-brand-800" /> |
9 | 9 | </Link> |
10 | 10 | </div> |
11 | 11 |
|
12 | 12 | <div class="hidden md:block"> |
13 | | - <div class="hidden md:block"> |
14 | | - <div class="ml-10 flex items-baseline space-x-4"> |
15 | | - <template |
16 | | - v-for="link in menu" |
17 | | - :key="link.label" |
18 | | - > |
19 | | - <Link |
20 | | - v-if="link.condition" |
21 | | - :href="link.route" |
22 | | - :method="link?.method" |
23 | | - :as="link?.method == 'post' ? 'button' : 'a'" |
24 | | - v-text="link.label" |
25 | | - class="rounded-xl px-3 py-2 text-sm font-medium" |
26 | | - :class="{ |
27 | | - 'bg-slate-100 text-slate-800': link.components.includes($page.component), |
28 | | - 'text-slate-500 hover:text-slate-900': !link.components.includes($page.component), |
29 | | - }" |
30 | | - /> |
31 | | - </template> |
32 | | - </div> |
| 13 | + <div class="ml-10 flex items-baseline space-x-4"> |
| 14 | + <template |
| 15 | + v-for="link in menu" |
| 16 | + :key="link.label" |
| 17 | + > |
| 18 | + <Link |
| 19 | + v-if="link.condition" |
| 20 | + :href="link.route" |
| 21 | + :method="link?.method" |
| 22 | + :as="link?.method == 'post' ? 'button' : 'a'" |
| 23 | + v-text="link.label" |
| 24 | + class="rounded-xl px-3 py-2 text-sm font-medium transition-colors ease-in-out duration-200" |
| 25 | + :class="{ |
| 26 | + 'bg-brand-100 text-brand-950': link.components.includes($page.component), |
| 27 | + 'text-brand-600 hover:text-brand-950 focus:text-brand-950': !link.components.includes($page.component), |
| 28 | + }" |
| 29 | + /> |
| 30 | + </template> |
33 | 31 | </div> |
34 | 32 | </div> |
35 | 33 |
|
36 | 34 | <div class="-mr-2 flex md:hidden"> |
37 | 35 | <button |
38 | 36 | @click="mobileMenuOpen = !mobileMenuOpen" |
39 | 37 | type="button" |
40 | | - class="relative inline-flex items-center justify-center rounded-md bg-slate-100 p-2 text-slate-900 hover:bg-slate-900 hover:text-white" |
| 38 | + class="relative inline-flex items-center justify-center rounded-md bg-brand-100 p-2 text-brand-900 hover:bg-brand-900 hover:text-white" |
41 | 39 | > |
42 | 40 | <span class="sr-only">Open main menu</span> |
43 | 41 | <XMarkIcon |
|
68 | 66 | v-text="link.label" |
69 | 67 | class="rounded-xl px-3 py-2 text-base font-medium block" |
70 | 68 | :class="{ |
71 | | - 'bg-slate-100 text-slate-800': link.components.includes($page.component), |
72 | | - 'text-slate-500 hover:text-slate-900': !link.components.includes($page.component), |
| 69 | + 'bg-brand-100 text-brand-950': link.components.includes($page.component), |
| 70 | + 'text-brand-600 focus:text-brand-950': !link.components.includes($page.component), |
73 | 71 | }" |
74 | 72 | aria-current="page" |
75 | 73 | /> |
|
81 | 79 | </template> |
82 | 80 |
|
83 | 81 | <script setup> |
84 | | - import { ref } from 'vue'; |
| 82 | + import { ref, onMounted } from "vue"; |
| 83 | + import { router } from '@inertiajs/vue3' |
85 | 84 |
|
86 | 85 | const props = defineProps({ |
87 | 86 | menu: Array, |
88 | 87 | }); |
89 | 88 |
|
90 | 89 | const mobileMenuOpen = ref(false); |
| 90 | +
|
| 91 | + onMounted(() => { |
| 92 | + router.on("success", () => { |
| 93 | + mobileMenuOpen.value = false; |
| 94 | + }); |
| 95 | + }); |
91 | 96 | </script> |
0 commit comments