From eb468333c1734200d4ca92059e8b66a1fa1806c9 Mon Sep 17 00:00:00 2001 From: Amirhossein Khalili Date: Wed, 29 Apr 2026 10:42:50 +0330 Subject: [PATCH] fix(workspaces): preserve workspace thumbnail layout --- src/pages/Workspaces.tsx | 142 ++++++++++++++++++++------------------- 1 file changed, 72 insertions(+), 70 deletions(-) diff --git a/src/pages/Workspaces.tsx b/src/pages/Workspaces.tsx index 9fb8c4e..67142b5 100644 --- a/src/pages/Workspaces.tsx +++ b/src/pages/Workspaces.tsx @@ -10,9 +10,9 @@ import { canWorkspace, type WorkspaceRole, } from '../lib/permissions'; -import FilterBar from '../components/FilterBar'; -import { ListPageSkeleton } from '../components/ListPageSkeleton'; -import { Button } from '../components/ui/button'; +import FilterBar from '../components/FilterBar'; +import { ListPageSkeleton } from '../components/ListPageSkeleton'; +import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Card, CardContent, CardTitle } from '../components/ui/card'; import { Pagination } from '../components/Pagination'; @@ -116,58 +116,60 @@ export default function Workspaces() { } }; - return ( -
-
-
-
-
-

{t.workspace?.title || 'Workspaces'}

-

{t.workspace?.subtitle || 'Manage your workspaces'}

-
- -
-
- -
- -
- - {isLoading ? ( - - ) : ( -
-
- {workspaces.map((workspace) => { - const canDeleteWorkspace = canWorkspace(workspace.my_role, WORKSPACE_DELETE); - const canEditWorkspace = canWorkspace(workspace.my_role, WORKSPACE_EDIT); + return ( +
+
+
+
+
+

{t.workspace?.title || 'Workspaces'}

+

{t.workspace?.subtitle || 'Manage your workspaces'}

+
+ +
+
+ +
+ +
+ + {isLoading ? ( + + ) : ( +
+
+ {workspaces.map((workspace) => { + const canDeleteWorkspace = canWorkspace(workspace.my_role, WORKSPACE_DELETE); + const canEditWorkspace = canWorkspace(workspace.my_role, WORKSPACE_EDIT); return (
-
- {workspace.thumbnail ? ( + {workspace.thumbnail ? ( +
{workspace.name} - ) : ( - workspace.name.trim().charAt(0).toUpperCase() || "W" - )} -
+
+ ) : ( +
+ {workspace.name.trim().charAt(0).toUpperCase() || "W"} +
+ )} {workspace.name} @@ -215,31 +217,31 @@ export default function Workspaces() { ); - })} - - {workspaces.length === 0 && ( -
-
-

{t.workspace?.emptyState || 'No workspaces found'}

-
-
- )} -
- - +
+

{t.workspace?.emptyState || 'No workspaces found'}

+
+
+ )} +
+ + -
- )} -
- - {deleteModal.workspace && ( - +
+ )} +
+ + {deleteModal.workspace && ( + { setDeleteModal({ isOpen: false, workspace: null });