From d18cf4b6bed3a3c6065b730e7baeec59211ff113 Mon Sep 17 00:00:00 2001 From: Alejandra <90076947+alejsdev@users.noreply.github.com> Date: Fri, 21 Feb 2025 20:29:00 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Add=20minor=20UI=20tweaks=20in?= =?UTF-8?q?=20Skeletons=20and=20other=20components=20(#1507)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/Common/UserMenu.tsx | 7 +----- .../src/components/Pending/PendingItems.tsx | 19 ++++++++------- .../src/components/Pending/PendingUsers.tsx | 23 +++++++++--------- .../UserSettings/ChangePassword.tsx | 5 +--- frontend/src/main.tsx | 7 +++++- frontend/src/routes/_layout/admin.tsx | 24 +++++++++---------- frontend/src/routes/_layout/items.tsx | 14 +++++------ frontend/tests/login.spec.ts | 2 +- 8 files changed, 50 insertions(+), 51 deletions(-) diff --git a/frontend/src/components/Common/UserMenu.tsx b/frontend/src/components/Common/UserMenu.tsx index c6aa1a9..5f2b26a 100644 --- a/frontend/src/components/Common/UserMenu.tsx +++ b/frontend/src/components/Common/UserMenu.tsx @@ -19,12 +19,7 @@ const UserMenu = () => { - diff --git a/frontend/src/components/Pending/PendingItems.tsx b/frontend/src/components/Pending/PendingItems.tsx index 688ba3a..0afc504 100644 --- a/frontend/src/components/Pending/PendingItems.tsx +++ b/frontend/src/components/Pending/PendingItems.tsx @@ -1,29 +1,30 @@ -import { Skeleton, Table } from "@chakra-ui/react" +import { Table } from "@chakra-ui/react" +import { SkeletonText } from "../ui/skeleton" const PendingItems = () => ( - ID - Title - Description - Actions + ID + Title + Description + Actions {[...Array(5)].map((_, index) => ( - + - + - + - + ))} diff --git a/frontend/src/components/Pending/PendingUsers.tsx b/frontend/src/components/Pending/PendingUsers.tsx index 013ea5f..c7ac1c7 100644 --- a/frontend/src/components/Pending/PendingUsers.tsx +++ b/frontend/src/components/Pending/PendingUsers.tsx @@ -1,33 +1,34 @@ -import { Skeleton, Table } from "@chakra-ui/react" +import { Table } from "@chakra-ui/react" +import { SkeletonText } from "../ui/skeleton" const PendingUsers = () => ( - Full name - Email - Role - Status - Actions + Full name + Email + Role + Status + Actions {[...Array(5)].map((_, index) => ( - + - + - + - + - + ))} diff --git a/frontend/src/components/UserSettings/ChangePassword.tsx b/frontend/src/components/UserSettings/ChangePassword.tsx index c94f970..55e6167 100644 --- a/frontend/src/components/UserSettings/ChangePassword.tsx +++ b/frontend/src/components/UserSettings/ChangePassword.tsx @@ -47,10 +47,7 @@ const ChangePassword = () => { Change Password - + - Full name - Email - Role - Status - Actions + Full name + Email + Role + Status + Actions {users?.map((user) => ( - + {user.full_name || "N/A"} {currentUser?.id === user.id && ( @@ -79,14 +79,14 @@ function UsersTable() { )} - {user.email} - - {user.is_superuser ? "Superuser" : "User"} + + {user.email} - - {user.is_active ? "Active" : "Inactive"} + + {user.is_superuser ? "Superuser" : "User"} - + {user.is_active ? "Active" : "Inactive"} + - ID - Title - Description - Actions + ID + Title + Description + Actions {items?.map((item) => ( - + {item.id} - + {item.title} {item.description || "N/A"} - + diff --git a/frontend/tests/login.spec.ts b/frontend/tests/login.spec.ts index c1bccf3..e482934 100644 --- a/frontend/tests/login.spec.ts +++ b/frontend/tests/login.spec.ts @@ -124,4 +124,4 @@ test("Redirects to /login when token is wrong", async ({ page }) => { await page.goto("/settings") await page.waitForURL("/login") await expect(page).toHaveURL("/login") -}) \ No newline at end of file +})