Compare commits

...

1 Commits

Author SHA1 Message Date
Jin Yi
8798c263f0 style: nav item style roll back 2025-10-01 21:33:51 +09:00

View File

@@ -1,14 +1,5 @@
<template> <template>
<div <div :class="navItemClasses" role="button" @click="onClick">
class="flex items-center gap-2 px-4 py-3 text-sm rounded-md transition-colors cursor-pointer"
:class="
active
? 'bg-white dark-theme:bg-charcoal-600 text-neutral'
: 'text-neutral hover:bg-gray-100 dark-theme:hover:bg-charcoal-300'
"
role="button"
@click="onClick"
>
<NavIcon v-if="icon" :icon="icon" /> <NavIcon v-if="icon" :icon="icon" />
<i-lucide:folder v-else class="text-xs text-neutral" /> <i-lucide:folder v-else class="text-xs text-neutral" />
<span class="flex items-center"> <span class="flex items-center">
@@ -18,7 +9,10 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed } from 'vue'
import type { NavItemData } from '@/types/navTypes' import type { NavItemData } from '@/types/navTypes'
import { cn } from '@/utils/tailwindUtil'
import NavIcon from './NavIcon.vue' import NavIcon from './NavIcon.vue'
@@ -27,4 +21,14 @@ const { icon, active, onClick } = defineProps<{
active?: boolean active?: boolean
onClick: () => void onClick: () => void
}>() }>()
const navItemClasses = computed(() =>
cn(
'flex items-center gap-2 px-4 py-3 text-sm rounded-md transition-colors cursor-pointer text-neutral',
{
'bg-gray-100 dark-theme:bg-charcoal-300': active,
'hover:bg-gray-100 dark-theme:hover:bg-charcoal-300': !active
}
)
)
</script> </script>