From 8910dee69b1a32678dcf2ffab4788ec4f9e64492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cintia=20S=C3=A1nchez=20Garc=C3=ADa?= Date: Tue, 28 May 2024 10:40:03 +0200 Subject: [PATCH] Improve filters for mobile devices (#609) Signed-off-by: Cintia Sanchez Garcia --- web/package.json | 2 +- web/src/layout/common/Card.tsx | 34 +++++++++++++------ web/src/layout/search/Filters.module.css | 8 +++++ web/src/layout/search/Filters.tsx | 9 +++-- .../layout/search/FiltersInLine.module.css | 4 +++ web/src/layout/search/FiltersInLine.tsx | 2 ++ web/yarn.lock | 6 ++-- 7 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 web/src/layout/search/Filters.module.css diff --git a/web/package.json b/web/package.json index 93b58dd..ace9d38 100644 --- a/web/package.json +++ b/web/package.json @@ -6,7 +6,7 @@ "type": "module", "dependencies": { "classnames": "^2.5.1", - "clo-ui": "https://github.com/cncf/clo-ui.git#v0.2.5", + "clo-ui": "https://github.com/cncf/clo-ui.git#v0.3.0", "lodash": "^4.17.21", "moment": "^2.30.1", "react": "^18.3.1", diff --git a/web/src/layout/common/Card.tsx b/web/src/layout/common/Card.tsx index a288dea..341d30c 100644 --- a/web/src/layout/common/Card.tsx +++ b/web/src/layout/common/Card.tsx @@ -60,6 +60,16 @@ const Card = (props: Props) => { }); }; + const searchByProject = (project: string, foundation: string) => { + navigate({ + pathname: '/search', + search: prepareQueryString({ + pageNumber: 1, + filters: { [FilterKind.Project]: [project], [FilterKind.Foundation]: [foundation], ...getExtraFilter() }, + }), + }); + }; + const searchByFilter = (filter: FilterKind, value: string) => { navigate({ pathname: '/search', @@ -128,12 +138,15 @@ const Card = (props: Props) => { effective_theme={effective} /> -
-
- +
+
+
@@ -199,7 +212,7 @@ const Card = (props: Props) => {