From 6bcab6d5632ed128bb8d1ac2c39b070cab33640d Mon Sep 17 00:00:00 2001 From: codytseng Date: Thu, 4 Dec 2025 23:24:16 +0800 Subject: [PATCH] refactor: polish UI details --- src/PageManager.tsx | 4 +- .../BottomNavigationBar/AccountButton.tsx | 4 +- src/components/Embedded/EmbeddedNote.tsx | 4 +- src/components/Image/index.tsx | 14 ++++--- src/components/ImageGallery/index.tsx | 8 ++-- src/components/ImageWithLightbox/index.tsx | 4 +- src/components/NoteCard/MainNoteCard.tsx | 7 +++- src/components/NoteCard/index.tsx | 2 +- src/components/NoteList/index.tsx | 2 +- .../NotificationItem/ReactionNotification.tsx | 2 +- src/components/Profile/BannerWithLightbox.tsx | 1 + src/components/Profile/index.tsx | 2 +- src/components/ScrollToTopButton/index.tsx | 6 +-- src/components/SearchBar/index.tsx | 6 +-- src/components/SearchInput/index.tsx | 2 +- src/components/Settings/index.tsx | 2 +- src/components/Tabs/index.tsx | 10 +++-- src/components/UserAggregationList/index.tsx | 2 +- src/components/VideoPlayer/index.tsx | 2 +- src/components/WebPreview/index.tsx | 9 ++-- src/components/XEmbeddedPost/index.tsx | 9 ++-- .../YoutubeEmbeddedPlayer/index.tsx | 2 +- src/components/ui/badge.tsx | 6 +-- src/components/ui/button.tsx | 19 +++++---- src/components/ui/card.tsx | 2 +- src/components/ui/checkbox.tsx | 2 +- src/components/ui/dialog.tsx | 6 +-- src/components/ui/drawer.tsx | 2 +- src/components/ui/dropdown-menu.tsx | 2 +- src/components/ui/hover-card.tsx | 2 +- src/components/ui/input.tsx | 2 +- src/components/ui/popover.tsx | 2 +- src/components/ui/select.tsx | 6 +-- src/components/ui/separator.tsx | 2 +- src/components/ui/sheet.tsx | 10 ++--- src/components/ui/skeleton.tsx | 2 +- src/components/ui/slider.tsx | 2 +- src/components/ui/switch.tsx | 4 +- src/components/ui/textarea.tsx | 2 +- src/index.css | 42 ++++++++++++++----- src/layouts/PrimaryPageLayout/index.tsx | 2 +- src/layouts/SecondaryPageLayout/index.tsx | 2 +- src/pages/primary/NoteListPage/FeedButton.tsx | 2 +- src/pages/secondary/NotePage/index.tsx | 2 +- tailwind.config.js | 7 +++- 45 files changed, 140 insertions(+), 94 deletions(-) diff --git a/src/PageManager.tsx b/src/PageManager.tsx index 0596db4..f088716 100644 --- a/src/PageManager.tsx +++ b/src/PageManager.tsx @@ -402,7 +402,7 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) {
{primaryPages.map(({ name, element, props }) => ( @@ -420,7 +420,7 @@ export function PageManager({ maxStackSize = 5 }: { maxStackSize?: number }) {
0 && 'shadow-lg', secondaryStack.length === 0 ? 'bg-surface' : '' )} diff --git a/src/components/BottomNavigationBar/AccountButton.tsx b/src/components/BottomNavigationBar/AccountButton.tsx index 02aec79..7b3e8b4 100644 --- a/src/components/BottomNavigationBar/AccountButton.tsx +++ b/src/components/BottomNavigationBar/AccountButton.tsx @@ -42,10 +42,10 @@ export default function AccountButton() { profile ? ( ) : ( - + ) ) : ( diff --git a/src/components/Embedded/EmbeddedNote.tsx b/src/components/Embedded/EmbeddedNote.tsx index a2b9576..3ba066b 100644 --- a/src/components/Embedded/EmbeddedNote.tsx +++ b/src/components/Embedded/EmbeddedNote.tsx @@ -29,7 +29,7 @@ export function EmbeddedNote({ noteId, className }: { noteId: string; className? function EmbeddedNoteSkeleton({ className }: { className?: string }) { return (
e.stopPropagation()} >
@@ -49,7 +49,7 @@ function EmbeddedNoteNotFound({ noteId, className }: { noteId: string; className const { t } = useTranslation() return ( -
+
{t('Sorry! The note cannot be found 😔')}
diff --git a/src/components/Image/index.tsx b/src/components/Image/index.tsx index 9a1344a..23ec926 100644 --- a/src/components/Image/index.tsx +++ b/src/components/Image/index.tsx @@ -18,6 +18,7 @@ export default function Image({ classNames?: { wrapper?: string errorPlaceholder?: string + skeleton?: string } image: TImetaInfo alt?: string @@ -78,15 +79,16 @@ export default function Image({ ) : ( )} @@ -102,7 +104,7 @@ export default function Image({ onLoad={handleLoad} onError={handleError} className={cn( - 'object-cover rounded-lg w-full h-full transition-opacity pointer-events-none', + 'object-cover rounded-xl w-full h-full transition-opacity pointer-events-none', isLoading ? 'opacity-0' : 'opacity-100', className )} @@ -117,7 +119,7 @@ export default function Image({ alt={alt} decoding="async" loading="lazy" - className={cn('object-cover rounded-lg w-full h-full transition-opacity', className)} + className={cn('object-cover rounded-xl w-full h-full transition-opacity', className)} /> ) : (
( handlePhotoClick(e, i)} @@ -136,7 +136,7 @@ export default function ImageGallery({ {displayImages.map((image, i) => ( handlePhotoClick(e, i)} diff --git a/src/components/ImageWithLightbox/index.tsx b/src/components/ImageWithLightbox/index.tsx index 1616ea6..e7159a5 100644 --- a/src/components/ImageWithLightbox/index.tsx +++ b/src/components/ImageWithLightbox/index.tsx @@ -21,6 +21,7 @@ export default function ImageWithLightbox({ className?: string classNames?: { wrapper?: string + skeleton?: string } errorPlaceholder?: string ignoreAutoLoadPolicy?: boolean @@ -67,7 +68,8 @@ export default function ImageWithLightbox({ className={className} classNames={{ wrapper: cn('rounded-lg border cursor-zoom-in', classNames.wrapper), - errorPlaceholder: 'aspect-square h-[30vh]' + errorPlaceholder: 'aspect-square h-[30vh]', + skeleton: classNames.skeleton }} image={image} onClick={(e) => handlePhotoClick(e)} diff --git a/src/components/NoteCard/MainNoteCard.tsx b/src/components/NoteCard/MainNoteCard.tsx index 654dd44..0f83de3 100644 --- a/src/components/NoteCard/MainNoteCard.tsx +++ b/src/components/NoteCard/MainNoteCard.tsx @@ -34,7 +34,12 @@ export default function MainNoteCard({ push(toNote(originalNoteId ?? event)) }} > -
+
{pinned && } diff --git a/src/components/NoteCard/index.tsx b/src/components/NoteCard/index.tsx index f0db6aa..3c4adda 100644 --- a/src/components/NoteCard/index.tsx +++ b/src/components/NoteCard/index.tsx @@ -58,7 +58,7 @@ export function NoteCardLoadingSkeleton({ className }: { className?: string }) {
- +
diff --git a/src/components/NoteList/index.tsx b/src/components/NoteList/index.tsx index 7e69ef9..2aec965 100644 --- a/src/components/NoteList/index.tsx +++ b/src/components/NoteList/index.tsx @@ -413,7 +413,7 @@ const NoteList = forwardRef< ) : ( list )} -
+
{filteredNewEvents.length > 0 && ( )} diff --git a/src/components/NotificationList/NotificationItem/ReactionNotification.tsx b/src/components/NotificationList/NotificationItem/ReactionNotification.tsx index 0813af3..72c15d8 100644 --- a/src/components/NotificationList/NotificationItem/ReactionNotification.tsx +++ b/src/components/NotificationList/NotificationItem/ReactionNotification.tsx @@ -40,7 +40,7 @@ export function ReactionNotification({ {emojiName}} /> diff --git a/src/components/Profile/BannerWithLightbox.tsx b/src/components/Profile/BannerWithLightbox.tsx index 58eeb4c..682cba2 100644 --- a/src/components/Profile/BannerWithLightbox.tsx +++ b/src/components/Profile/BannerWithLightbox.tsx @@ -25,6 +25,7 @@ export default function BannerWithLightbox({ image={{ url: bannerUrl, pubkey }} className="rounded-none w-full aspect-[3/1]" classNames={{ + skeleton: 'rounded-none', wrapper: 'rounded-none border-none' }} errorPlaceholder={defaultBanner} diff --git a/src/components/Profile/index.tsx b/src/components/Profile/index.tsx index aea4e98..c1ba795 100644 --- a/src/components/Profile/index.tsx +++ b/src/components/Profile/index.tsx @@ -196,7 +196,7 @@ export default function Profile({ id }: { id?: string }) {
-
+
setSearchInput(e.target.value)} diff --git a/src/components/ScrollToTopButton/index.tsx b/src/components/ScrollToTopButton/index.tsx index 49bd594..1e042e8 100644 --- a/src/components/ScrollToTopButton/index.tsx +++ b/src/components/ScrollToTopButton/index.tsx @@ -52,8 +52,8 @@ export default function ScrollToTopButton({ return (