From 040e19025e8c8a758f15998a9c4f7f7b2e85094f Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Thu, 27 Nov 2025 21:52:51 +0800 Subject: [PATCH] :recycle: Refactored some components to new UI --- app/app.vue | 46 ++-- app/assets/css/main.css | 1 - app/components.d.ts | 22 ++ app/components/Post/PostHeader.vue | 7 +- app/components/Post/PostItem.vue | 189 +++++++++-------- app/components/Post/PostReactionList.vue | 233 +++++---------------- app/components/Post/RepliesCompactList.vue | 39 ++-- app/components/Post/RepliesList.vue | 18 +- app/layouts/default.vue | 87 +++++--- app/layouts/minimal.vue | 4 +- app/pages/auth/authorize.vue | 14 +- app/pages/auth/create-account.vue | 10 +- app/pages/auth/login.vue | 25 +-- app/pages/index.vue | 12 +- app/pages/posts/[...slug].vue | 129 +++++------- app/pages/swagger/index.vue | 21 +- app/types/navlink.ts | 10 +- nuxt.config.ts | 51 +++-- package.json | 8 +- 19 files changed, 404 insertions(+), 522 deletions(-) diff --git a/app/app.vue b/app/app.vue index ef7bc6b..ca0b432 100644 --- a/app/app.vue +++ b/app/app.vue @@ -1,22 +1,38 @@ diff --git a/app/assets/css/main.css b/app/assets/css/main.css index 63e25d3..4e7a479 100644 --- a/app/assets/css/main.css +++ b/app/assets/css/main.css @@ -4,7 +4,6 @@ @layer theme, base, components, utilities; @import "tailwindcss/theme.css" layer(theme); -@import "tailwindcss/preflight.css" layer(base); @import "tailwindcss/utilities.css" layer(utilities); @layer base { diff --git a/app/components.d.ts b/app/components.d.ts index 3b6ff06..637f7a3 100644 --- a/app/components.d.ts +++ b/app/components.d.ts @@ -12,16 +12,27 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { + NAlert: typeof import('naive-ui')['NAlert'] NAvatar: typeof import('naive-ui')['NAvatar'] NButton: typeof import('naive-ui')['NButton'] + NCard: typeof import('naive-ui')['NCard'] + NCardSection: typeof import('naive-ui')['NCardSection'] + NChip: typeof import('naive-ui')['NChip'] NConfigProvider: typeof import('naive-ui')['NConfigProvider'] + NDialog: typeof import('naive-ui')['NDialog'] NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDropdown: typeof import('naive-ui')['NDropdown'] + NIcon: typeof import('naive-ui')['NIcon'] NInput: typeof import('naive-ui')['NInput'] NLoadingBarProvider: typeof import('naive-ui')['NLoadingBarProvider'] + NMenu: typeof import('naive-ui')['NMenu'] NMessageProvider: typeof import('naive-ui')['NMessageProvider'] + NModal: typeof import('naive-ui')['NModal'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NSelect: typeof import('naive-ui')['NSelect'] + NSpace: typeof import('naive-ui')['NSpace'] + NSpin: typeof import('naive-ui')['NSpin'] + NTag: typeof import('naive-ui')['NTag'] NThemeEditor: typeof import('naive-ui')['NThemeEditor'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] @@ -30,16 +41,27 @@ declare module 'vue' { // For TSX support declare global { + const NAlert: typeof import('naive-ui')['NAlert'] const NAvatar: typeof import('naive-ui')['NAvatar'] const NButton: typeof import('naive-ui')['NButton'] + const NCard: typeof import('naive-ui')['NCard'] + const NCardSection: typeof import('naive-ui')['NCardSection'] + const NChip: typeof import('naive-ui')['NChip'] const NConfigProvider: typeof import('naive-ui')['NConfigProvider'] + const NDialog: typeof import('naive-ui')['NDialog'] const NDialogProvider: typeof import('naive-ui')['NDialogProvider'] const NDropdown: typeof import('naive-ui')['NDropdown'] + const NIcon: typeof import('naive-ui')['NIcon'] const NInput: typeof import('naive-ui')['NInput'] const NLoadingBarProvider: typeof import('naive-ui')['NLoadingBarProvider'] + const NMenu: typeof import('naive-ui')['NMenu'] const NMessageProvider: typeof import('naive-ui')['NMessageProvider'] + const NModal: typeof import('naive-ui')['NModal'] const NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] const NSelect: typeof import('naive-ui')['NSelect'] + const NSpace: typeof import('naive-ui')['NSpace'] + const NSpin: typeof import('naive-ui')['NSpin'] + const NTag: typeof import('naive-ui')['NTag'] const NThemeEditor: typeof import('naive-ui')['NThemeEditor'] const RouterLink: typeof import('vue-router')['RouterLink'] const RouterView: typeof import('vue-router')['RouterView'] diff --git a/app/components/Post/PostHeader.vue b/app/components/Post/PostHeader.vue index f9f280e..8547cee 100644 --- a/app/components/Post/PostHeader.vue +++ b/app/components/Post/PostHeader.vue @@ -1,8 +1,9 @@