From 5eadde323918db7c5473823444b654cddaffdb51 Mon Sep 17 00:00:00 2001 From: Ilyar Date: Sun, 18 Aug 2024 06:35:14 +0200 Subject: [PATCH] feat: add showSearch toggle --- README.md | 1 + data/config.default.json | 1 + src/components/Navigation/Navigation.tsx | 19 ++++++++++--------- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 17291842..aab5bea5 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,7 @@ Open the `config.json` file and configure the radar to your needs. | Attribute | Description | | ---------------- | ------------------------------------------------------- | +| showSearch | Render the radar search on the header? | | showChart | Render the radar visualization on the homepage? | | showTagFilter | Render the tag filter below the radar? | | showQuadrantList | Render the items below the radar? | diff --git a/data/config.default.json b/data/config.default.json index 7f1c6ae2..be74bb45 100644 --- a/data/config.default.json +++ b/data/config.default.json @@ -5,6 +5,7 @@ "logoFile": "logo.svg", "jsFile": "", "toggles": { + "showSearch": false, "showChart": true, "showTagFilter": true, "showQuadrantList": true, diff --git a/src/components/Navigation/Navigation.tsx b/src/components/Navigation/Navigation.tsx index 8f939192..ee6a5d6b 100644 --- a/src/components/Navigation/Navigation.tsx +++ b/src/components/Navigation/Navigation.tsx @@ -4,7 +4,8 @@ import styles from "./Navigation.module.css"; import IconOverview from "@/components/Icons/Overview"; import IconQuestion from "@/components/Icons/Question"; -import { getLabel } from "@/lib/data"; +import IconSearch from "@/components/Icons/Search"; +import { getLabel, getToggle } from "@/lib/data"; export function Navigation() { return ( @@ -22,14 +23,14 @@ export function Navigation() { {getLabel("pageOverview")} - {/* -
  • - - - {getLabel("pageSearch")} - -
  • - */} + {getToggle("showSearch") && ( +
  • + + + {getLabel("pageSearch")} + +
  • + )} );