mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-21 23:36:15 -04:00
feat(tool): improved favorite tool management
This commit is contained in:
parent
274ff02b54
commit
af075dcccc
3 changed files with 83 additions and 71 deletions
|
@ -3,22 +3,22 @@ import { useRoute } from 'vue-router';
|
|||
import { useHead } from '@vueuse/head';
|
||||
import type { HeadObject } from '@vueuse/head';
|
||||
import { computed } from 'vue';
|
||||
import { useThemeVars } from 'naive-ui';
|
||||
import FavoriteButton from '@/components/FavoriteButton.vue';
|
||||
import type { Tool } from '@/tools/tools.types';
|
||||
import BaseLayout from './base.layout.vue';
|
||||
|
||||
const route = useRoute();
|
||||
const theme = useThemeVars();
|
||||
|
||||
const head = computed<HeadObject>(() => ({
|
||||
title: `${route.meta.name} - IT Tools`,
|
||||
meta: [
|
||||
{
|
||||
name: 'description',
|
||||
content: route.meta.description,
|
||||
content: route.meta?.description as string,
|
||||
},
|
||||
{
|
||||
name: 'keywords',
|
||||
content: route.meta.keywords,
|
||||
content: ((route.meta.keywords ?? []) as string[]).join(','),
|
||||
},
|
||||
],
|
||||
}));
|
||||
|
@ -29,22 +29,18 @@ useHead(head);
|
|||
<base-layout>
|
||||
<div class="tool-layout">
|
||||
<div class="tool-header">
|
||||
<n-h1>
|
||||
{{ route.meta.name }}
|
||||
<n-space align="center" justify="space-between" :wrap="false">
|
||||
<n-h1>
|
||||
{{ route.meta.name }}
|
||||
</n-h1>
|
||||
|
||||
<n-tag
|
||||
v-if="route.meta.isNew"
|
||||
round
|
||||
type="success"
|
||||
:bordered="false"
|
||||
:color="{ color: theme.primaryColor, textColor: theme.tagColor }"
|
||||
>
|
||||
New tool
|
||||
</n-tag>
|
||||
<!-- <span class="new-tool-badge">New !</span> -->
|
||||
</n-h1>
|
||||
<div>
|
||||
<favorite-button :tool="{name: route.meta.name} as Tool" />
|
||||
</div>
|
||||
</n-space>
|
||||
|
||||
<div class="separator" />
|
||||
|
||||
<div class="description">
|
||||
{{ route.meta.description }}
|
||||
</div>
|
||||
|
@ -92,6 +88,7 @@ useHead(head);
|
|||
width: 200px;
|
||||
height: 2px;
|
||||
background: rgb(161, 161, 161);
|
||||
opacity: 0.2;
|
||||
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue