From d877f931ef2b93d18016d7df5862b4ac4e2c9fa1 Mon Sep 17 00:00:00 2001 From: jeafreezy Date: Mon, 21 Oct 2024 13:17:10 +0200 Subject: [PATCH] fix: improved models list layout --- frontend/src/app/routes/models/index.tsx | 21 ++++++++++++------- .../features/models/components/model-card.tsx | 4 +++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/routes/models/index.tsx b/frontend/src/app/routes/models/index.tsx index dc026ef3..6bc0d30e 100644 --- a/frontend/src/app/routes/models/index.tsx +++ b/frontend/src/app/routes/models/index.tsx @@ -111,15 +111,16 @@ const LayoutToggle = ({ query, updateQuery, isMobile, + disabled=false }: { updateQuery: (params: TQueryParams) => void; query: TQueryParams; isMobile?: boolean; + disabled?:boolean }) => { const activeLayout = query[SEARCH_PARAMS.layout]; return ( -
@@ -130,13 +131,14 @@ const LayoutToggle = ({ : LayoutView.GRID, }) } + disabled={disabled} > {activeLayout !== LayoutView.LIST ? ( - + ) : ( )} -
+ ); }; @@ -290,11 +292,13 @@ export const ModelsPage = () => { if (mapViewIsActive) { return ( -
-
+
+
+
+
-
+
{modelsMapDataIsPending ? (
) : ( @@ -342,6 +346,7 @@ export const ModelsPage = () => { updateQuery={updateQuery} query={query} isMobile + disabled={mapViewIsActive as boolean} />
{
{/* Desktop */} - +
{/* Mobile */} diff --git a/frontend/src/features/models/components/model-card.tsx b/frontend/src/features/models/components/model-card.tsx index d1ac1897..9bf6775c 100644 --- a/frontend/src/features/models/components/model-card.tsx +++ b/frontend/src/features/models/components/model-card.tsx @@ -21,10 +21,12 @@ const ModelCard: React.FC = ({ model }) => { disableLinkStyle href={`${APPLICATION_ROUTES.MODELS}/${model.id}`} title={model.name} - className="w-[300px] mx-auto min-h-[450px] flex flex-col border border-gray-border hover:shadow-md overflow-hidden group" + className="w-[300px] mx-auto h-auto flex flex-col border border-gray-border hover:shadow-md overflow-hidden group" >