From c0a2aca98a585c5748dbd496414dc0f8c4c3f592 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Tue, 3 Jan 2023 04:19:36 +0800 Subject: [PATCH] feat(settings): about page --- components/help/HelpPreview.vue | 34 ------- .../{SettingsNavItem.vue => SettingsItem.vue} | 27 ++++-- composables/about.ts | 33 +++++++ composables/i18n.ts | 5 +- pages/settings.vue | 12 +-- pages/settings/about/index.vue | 90 +++++++++++++++++-- pages/settings/profile/index.vue | 4 +- 7 files changed, 146 insertions(+), 59 deletions(-) rename components/settings/{SettingsNavItem.vue => SettingsItem.vue} (64%) create mode 100644 composables/about.ts diff --git a/components/help/HelpPreview.vue b/components/help/HelpPreview.vue index 8f5069de..2c997f22 100644 --- a/components/help/HelpPreview.vue +++ b/components/help/HelpPreview.vue @@ -1,41 +1,7 @@ diff --git a/composables/about.ts b/composables/about.ts new file mode 100644 index 00000000..04ab0599 --- /dev/null +++ b/composables/about.ts @@ -0,0 +1,33 @@ +export interface Team { + github: string + display: string + twitter: string + mastodon: string +} + +export const teams: Team[] = [ + { + github: 'antfu', + display: 'Anthony Fu', + twitter: 'antfu7', + mastodon: 'antfu@mas.to', + }, + { + github: 'patak-dev', + display: 'Patak', + twitter: 'patak_dev', + mastodon: 'patak@webtoo.ls', + }, + { + github: 'danielroe', + display: 'Daniel Roe', + twitter: 'danielcroe', + mastodon: 'daniel@roe.dev', + }, + { + github: 'sxzz', + display: 'sxzz', + twitter: 'sanxiaozhizi', + mastodon: 'sxzz@mas.to', + }, +].sort(() => Math.random() - 0.5) diff --git a/composables/i18n.ts b/composables/i18n.ts index c78abc83..7c4b8724 100644 --- a/composables/i18n.ts +++ b/composables/i18n.ts @@ -1,5 +1,4 @@ -import type { MaybeRef } from '@vueuse/shared' -import type { MaybeComputedRef, UseTimeAgoOptions } from '@vueuse/core' +import type { MaybeComputedRef, MaybeRef, UseTimeAgoOptions } from '@vueuse/core' const formatter = Intl.NumberFormat() @@ -31,7 +30,7 @@ export const useHumanReadableNumber = () => { } export const useFormattedDateTime = ( - value: MaybeComputedRef, + value: MaybeComputedRef, options: Intl.DateTimeFormatOptions = { dateStyle: 'long', timeStyle: 'medium' }, ) => { const { locale } = useI18n() diff --git a/pages/settings.vue b/pages/settings.vue index e3d5162f..08a61dc4 100644 --- a/pages/settings.vue +++ b/pages/settings.vue @@ -20,38 +20,38 @@ const isRootPath = computedEager(() => route.name === 'settings')
- - - - - - +import buildInfo from 'virtual:build-info' + +let showCommit = $ref(false) +const builtTime = useFormattedDateTime(buildInfo.time) + +const handleShowCommit = () => { + setTimeout(() => { + showCommit = true + }, 50) +} + + diff --git a/pages/settings/profile/index.vue b/pages/settings/profile/index.vue index 30fe7453..4e51fe22 100644 --- a/pages/settings/profile/index.vue +++ b/pages/settings/profile/index.vue @@ -12,14 +12,14 @@ definePageMeta({
- -