From 0cc2fb4cd829f7284f01bc846926bbacb3326f71 Mon Sep 17 00:00:00 2001 From: Roman Date: Sat, 20 Mar 2021 18:41:06 +0200 Subject: [PATCH] adding @jsdoc comments to SidebarItem Signed-off-by: Roman --- src/renderer/components/layout/sidebar-item.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/layout/sidebar-item.tsx b/src/renderer/components/layout/sidebar-item.tsx index 4c3cebd646..da36b43c17 100644 --- a/src/renderer/components/layout/sidebar-item.tsx +++ b/src/renderer/components/layout/sidebar-item.tsx @@ -10,14 +10,23 @@ import { sidebarStorage } from "./sidebar-storage"; import { isActiveRoute } from "../../navigation"; interface SidebarItemProps { - id: string; // unique id, used in storage and integration tests + /** + * Unique id, used in storage and integration tests + */ + id: string; url: string; className?: string; text: React.ReactNode; icon?: React.ReactNode; isHidden?: boolean; - isActive?: boolean; // marks a link, by default checks `props.url` to identify active state - subMenus?: React.ReactNode | React.ComponentType[]; // props.children could be used too + /** + * Forces this item to be also show as active or not. + * + * Default: dynamically checks the location against the `url` props to determine if + * this item should be shown as active + */ + isActive?: boolean; + subMenus?: React.ReactNode | React.ComponentType[]; } @observer