From 5f93e4baac340998b08aaa273e2185893fe88e92 Mon Sep 17 00:00:00 2001 From: Innei Date: Fri, 30 Aug 2024 20:53:34 +0800 Subject: [PATCH] fix: optimize invitation page Signed-off-by: Innei --- .../src/modules/settings/tabs/invitations.tsx | 119 ++++++++++-------- 1 file changed, 66 insertions(+), 53 deletions(-) diff --git a/src/renderer/src/modules/settings/tabs/invitations.tsx b/src/renderer/src/modules/settings/tabs/invitations.tsx index 5c0d4acac..bff2e2ec3 100644 --- a/src/renderer/src/modules/settings/tabs/invitations.tsx +++ b/src/renderer/src/modules/settings/tabs/invitations.tsx @@ -3,6 +3,7 @@ import { AvatarFallback, AvatarImage, } from "@renderer/components/ui/avatar" +import { Button } from "@renderer/components/ui/button" import { CopyButton } from "@renderer/components/ui/code-highlighter" import { RootPortal } from "@renderer/components/ui/portal" import { useScrollViewElement } from "@renderer/components/ui/scroll-area/hooks" @@ -57,60 +58,72 @@ export const SettingInvitations = () => { - - - - - Code - - - Creation Time - - - Used by - - - - - {invitations.data?.map((row) => ( - - -
- {row.code} - -
-
- - {row.createdAt && new Date(row.createdAt).toLocaleString()} - - - {row.users ? ( -
{ - presentUserProfile(row.users?.id) - }} - > - - - - {row.users?.name?.slice(0, 2)} - - -
- ) : ( - "Not used" - )} -
+ + {invitations.data?.length ? ( +
+ + + + Code + + + Creation Time + + + Used by + - ))} - -
- {!invitations.data?.length && ( -
- No invitations + + + {invitations.data?.map((row) => ( + + +
+ {row.code} + +
+
+ + {row.createdAt && new Date(row.createdAt).toLocaleString()} + + + {row.users ? ( +
{ + presentUserProfile(row.users?.id) + }} + > + + + + {row.users?.name?.slice(0, 2)} + + +
+ ) : ( + "Not used" + )} +
+
+ ))} +
+ + ) : ( +
+

No invitations

+ +
+ +
)}