Skip to content

Commit

Permalink
fix: update nav based on the current page.
Browse files Browse the repository at this point in the history
  • Loading branch information
xiCO2k committed Feb 19, 2024
1 parent 762710c commit 738bbc6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
10 changes: 8 additions & 2 deletions resources/js/Shared/MainNav.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<script setup>
import { usePage } from '@inertiajs/vue3';
const page = usePage();
</script>

<template>
<nav class="flex space-x-4 sm:space-x-8 text-gray-400 text-sm sm:text-base">
<nav :key="page.url" class="flex space-x-4 sm:space-x-8 text-gray-400 text-sm sm:text-base">
<Link
href="/given-talks"
class="link-underline hover:text-gray-100"
Expand All @@ -10,7 +16,7 @@
<Link
href="/about"
class="link-underline hover:text-gray-100"
:class="route().current('about') ? 'active text-gray-100' : ''"
:class="page.url.startsWith('/about') ? 'active text-gray-100' : ''"
>
About
</Link>
Expand Down
2 changes: 1 addition & 1 deletion resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import MainLayout from './Shared/MainLayout.vue'
import { Shiki } from './shiki'
import twemoji from 'twemoji'
import { ZiggyVue } from 'ziggy'
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m';

createInertiaApp({
resolve: async name => {
Expand Down
1 change: 0 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default defineConfig({
resolve: {
alias: {
img: '/resources/img',
ziggy: '/vendor/tightenco/ziggy/dist/vue.m',
},
},
});

0 comments on commit 738bbc6

Please sign in to comment.