Skip to content

Commit 1dc6edd

Browse files
committed
style: nav item style roll back
1 parent e8de474 commit 1dc6edd

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
<template>
2-
<div
3-
class="flex items-center gap-2 px-4 py-3 text-sm rounded-md transition-colors cursor-pointer"
4-
:class="
5-
active
6-
? 'bg-white dark-theme:bg-charcoal-600 text-neutral'
7-
: 'text-neutral hover:bg-gray-100 dark-theme:hover:bg-charcoal-300'
8-
"
9-
role="button"
10-
@click="onClick"
11-
>
2+
<div :class="navItemClasses" role="button" @click="onClick">
123
<NavIcon v-if="icon" :icon="icon" />
134
<i-lucide:folder v-else class="text-xs text-neutral" />
145
<span class="flex items-center">
@@ -18,7 +9,10 @@
189
</template>
1910

2011
<script setup lang="ts">
12+
import { computed } from 'vue'
13+
2114
import type { NavItemData } from '@/types/navTypes'
15+
import { cn } from '@/utils/tailwindUtil'
2216
2317
import NavIcon from './NavIcon.vue'
2418
@@ -27,4 +21,14 @@ const { icon, active, onClick } = defineProps<{
2721
active?: boolean
2822
onClick: () => void
2923
}>()
24+
25+
const navItemClasses = computed(() =>
26+
cn(
27+
'flex items-center gap-2 px-4 py-3 text-sm rounded-md transition-colors cursor-pointer text-neutral',
28+
{
29+
'bg-gray-100 dark-theme:bg-charcoal-300': active,
30+
'hover:bg-gray-100 dark-theme:hover:bg-charcoal-300': !active
31+
}
32+
)
33+
)
3034
</script>

0 commit comments

Comments
 (0)