From 59333d51e9534db03a8eaacc5aed025c0a7135d5 Mon Sep 17 00:00:00 2001 From: ngthanhvu Date: Fri, 31 Jul 2026 04:01:24 -0400 Subject: [PATCH] Refactor components for improved type safety and code consistency - Updated AppHeader.vue to use TypeScript interfaces for member menu items and removed unnecessary type assertions. - Modified AuthModal.vue to enhance styling and improve accessibility with consistent class names and structure. - Enhanced CommentReplies.vue to support deleting replies with a new prop and improved event emission. - Adjusted GifPicker.vue to specify types for fetched data, ensuring better type safety. - Refined HomeMovieCard.vue to handle mouse and focus events more robustly, improving user interaction. - Corrected layout in chinh-sach-bao-mat.vue for better responsiveness and readability. - Updated index.vue to streamline gradient overlays and button positioning for a cleaner UI. - Improved [slug].vue to handle server channels and subtitles more dynamically, enhancing playback experience. --- app/components/AppHeader.vue | 16 +++--- app/components/AuthModal.vue | 88 ++++++++++++++++++++----------- app/components/CommentReplies.vue | 7 ++- app/components/GifPicker.vue | 4 +- app/components/HomeMovieCard.vue | 10 ++-- app/pages/chinh-sach-bao-mat.vue | 20 ++++--- app/pages/index.vue | 11 ++-- app/pages/xem/[slug].vue | 78 +++++++++++++++++++++------ 8 files changed, 158 insertions(+), 76 deletions(-) diff --git a/app/components/AppHeader.vue b/app/components/AppHeader.vue index 973523b..cde62f6 100644 --- a/app/components/AppHeader.vue +++ b/app/components/AppHeader.vue @@ -29,14 +29,16 @@ const navItems = [ { label: 'Phim lẻ', to: '/phim?type=single' }, ] +interface MemberMenuItem { label: string, icon: string, to: string } + const memberMenuItems = computed(() => { - const items = [ - { label: 'Trang cá nhân', icon: 'user' as const, to: '/thanh-vien' }, - { label: 'Yêu thích', icon: 'heart' as const, to: '/yeu-thich' }, - { label: 'Lịch sử', icon: 'history' as const, to: '/lich-su' }, + const items: MemberMenuItem[] = [ + { label: 'Trang cá nhân', icon: 'user', to: '/thanh-vien' }, + { label: 'Yêu thích', icon: 'heart', to: '/yeu-thich' }, + { label: 'Lịch sử', icon: 'history', to: '/lich-su' }, ] if (user.value?.role === 'admin') { - items.push({ label: 'Trang quản trị', icon: 'settings' as const, to: '/admin' }) + items.push({ label: 'Trang quản trị', icon: 'settings', to: '/admin' }) } return items }) @@ -143,7 +145,7 @@ watch(() => route.path, () => { - + {{ item.label }}
@@ -203,7 +205,7 @@ watch(() => route.path, () => { - + {{ item.label }}
diff --git a/app/components/AuthModal.vue b/app/components/AuthModal.vue index 82fc866..6d93f77 100644 --- a/app/components/AuthModal.vue +++ b/app/components/AuthModal.vue @@ -75,10 +75,11 @@ watch(open, (val) => {