From fdd7d5adf85c3181df66a2690d529e310f9df0ee Mon Sep 17 00:00:00 2001 From: Innei Date: Tue, 18 Nov 2025 16:29:14 +0800 Subject: [PATCH] refactor: update notifications settings UI for improved layout and accessibility - Removed unused imports and components to streamline the code. - Enhanced the notifications section layout with improved spacing and styling. - Updated the display of notification channels to use a more accessible design. - Added loading and empty state indicators for better user experience. Signed-off-by: Innei --- .../modules/settings/tabs/notifications.tsx | 136 ++++++++++-------- 1 file changed, 77 insertions(+), 59 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/settings/tabs/notifications.tsx b/apps/desktop/layer/renderer/src/modules/settings/tabs/notifications.tsx index 407c7db45..4953469a2 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/tabs/notifications.tsx +++ b/apps/desktop/layer/renderer/src/modules/settings/tabs/notifications.tsx @@ -1,15 +1,6 @@ import { Button } from "@follow/components/ui/button/index.js" -import { Divider } from "@follow/components/ui/divider/index.js" import { LoadingCircle } from "@follow/components/ui/loading/index.jsx" import { ScrollArea } from "@follow/components/ui/scroll-area/index.js" -import { - Table, - TableBody, - TableCell, - TableHead, - TableHeader, - TableRow, -} from "@follow/components/ui/table/index.jsx" import { Tooltip, TooltipContent, @@ -43,55 +34,82 @@ export const SettingNotifications = () => { }, []) return ( -
-
-

- { - dismiss() - }} - /> - ), - }} - /> -

-
- -
- {isLoading && } +
+ {/* Info Section */} - -
- - - - {t.settings("notifications.channel")} - {t.settings("notifications.token")} - - {t.common("words.actions")} - - - - +

+ { + dismiss() + }} + /> + ), + }} + /> +

+ + {/* Channels Section */} +
+
+

{t.settings("notifications.channel")}

+ + {data?.data?.length || 0} {t.common("words.items")} + +
+ +
+ {isLoading && ( +
+ +
+ )} + + {!isLoading && (!data?.data || data.data.length === 0) ? ( +
+ +

No notification channels

+
+ ) : ( + +
{data?.data?.map((row) => ( - - {row.channel} - - {row.token.slice(0, 6)}...{row.token.slice(-6)} - {row.token === token && ` ${t.settings("notifications.current")}`} - - +
+ {/* Channel Info */} +
+
+ {row.channel} + {row.token === token && ( + + + {t.settings("notifications.current")} + + )} +
+
+ + {row.token.slice(0, 8)}...{row.token.slice(-8)} + +
+
+ + {/* Actions */} +
{t.settings("notifications.test")} - - +
+
))} - -
-
-
+
+ + )} +
)