Move duplicate type into the type.ts file

This commit is contained in:
2023-12-12 17:00:03 +01:00
parent 4c9a5e81dc
commit 21d7661a87
3 changed files with 60 additions and 64 deletions

View File

@@ -1,57 +1,11 @@
<script lang="ts" setup>
import { navs } from '~~/types'
const isOpen = ref(false)
const router = useRouter()
router.afterEach(() => isOpen.value = false)
const navs = [
{
label: 'Home',
to: '/',
icon: 'i-ph-house-bold',
},
{
label: 'About',
to: '/about',
icon: 'i-ph-person-arms-spread-bold',
},
{
label: 'Articles',
to: '/writing',
icon: 'i-ph-pencil-bold',
},
{
label: 'Projects',
to: '/work',
icon: 'i-ph-flask-bold',
},
{
label: 'Uses',
to: '/uses',
icon: 'i-ph-tree-evergreen-bold',
},
{
label: 'Talents',
to: '/talents',
icon: 'i-ph-shooting-star-bold',
},
{
label: 'Guestbook',
to: '/guestbook',
icon: 'i-material-symbols-book-2-outline',
},
{
label: 'Bookmarks',
to: '/bookmarks',
icon: 'i-material-symbols-bookmark-add-outline-rounded',
},
{
label: 'Contact',
to: '/contact',
icon: 'i-ph-push-pin-bold',
},
]
const route = useRoute()
function isRoute(path: string) {
return route.path === path

View File

@@ -1,20 +1,7 @@
<script setup lang="ts">
import { otherTab } from '~~/types'
const route = useRoute()
const items = [
[{
label: 'Talents',
to: '/talents',
icon: 'i-ph-users-bold',
}, {
label: 'Guestbook',
to: '/guestbook',
icon: 'i-material-symbols-book-2-outline',
}, {
label: 'Bookmarks',
to: '/bookmarks',
icon: 'i-material-symbols-bookmark-add-outline-rounded',
}],
]
</script>
<template>
@@ -35,7 +22,7 @@ const items = [
<UButton to="/uses" size="sm" variant="ghost" color="white" :class="{ 'link-active': route.path.includes('/uses') }">
Uses
</UButton>
<UDropdown mode="hover" :items="items" :popper="{ placement: 'bottom' }">
<UDropdown mode="hover" :items="otherTab" :popper="{ placement: 'bottom' }">
<UButton size="sm" variant="ghost" color="white" class="duration-300">
Other
</UButton>

View File

@@ -22,6 +22,7 @@ export enum ColorsTheme {
export interface JsonParsedContent<T> extends ParsedContent {
body: T
excerpt: ''
}
export interface Post extends MarkdownParsedContent {
@@ -93,3 +94,57 @@ export const providers = [
color: 'red',
},
]
export const otherTab = [
[
{
label: 'Talents',
to: '/talents',
icon: 'i-ph-users-bold',
},
{
label: 'Guestbook',
to: '/guestbook',
icon: 'i-material-symbols-book-2-outline',
},
{
label: 'Bookmarks',
to: '/bookmarks',
icon: 'i-material-symbols-bookmark-add-outline-rounded',
},
],
]
export const navs = [
{
label: 'Home',
to: '/',
icon: 'i-ph-house-bold',
},
{
label: 'About',
to: '/about',
icon: 'i-ph-person-arms-spread-bold',
},
{
label: 'Articles',
to: '/writing',
icon: 'i-ph-pencil-bold',
},
{
label: 'Projects',
to: '/work',
icon: 'i-ph-flask-bold',
},
{
label: 'Uses',
to: '/uses',
icon: 'i-ph-tree-evergreen-bold',
},
...otherTab,
{
label: 'Contact',
to: '/contact',
icon: 'i-ph-push-pin-bold',
},
].flat()