From 6735bd3ea14cd3ba16472a5939b6632de556dc8a Mon Sep 17 00:00:00 2001 From: Rakesh Thera Date: Fri, 22 Apr 2022 19:44:29 +0530 Subject: [PATCH 1/5] New PR with right sign off Signed-off-by: Rakesh Thera --- .../core-components/src/layout/Sidebar/Items.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/core-components/src/layout/Sidebar/Items.tsx b/packages/core-components/src/layout/Sidebar/Items.tsx index 4a0376946a..b227d81dc1 100644 --- a/packages/core-components/src/layout/Sidebar/Items.tsx +++ b/packages/core-components/src/layout/Sidebar/Items.tsx @@ -369,6 +369,18 @@ const SidebarItemBase = forwardRef((props, ref) => { // Still waiting on a Q answered to fine tune the implementation const { isOpen } = useContext(SidebarContext); + const divStyle = + !isOpen && children ? { marginLeft: '24px', marginBottom: '4px' } : {}; + + const displayItemIcon = ( + <> +
+ + {!isOpen && children ? : <>} +
+ + ); + const itemIcon = ( ((props, ref) => { className={classnames({ [classes.closedItemIcon]: !isOpen })} > + {displayItemIcon} ); From aaffa18d8a9cdac5b1800b74430a1942b85245b9 Mon Sep 17 00:00:00 2001 From: Rakesh Thera Date: Mon, 25 Apr 2022 17:07:17 +0530 Subject: [PATCH 2/5] minor fixes Signed-off-by: Rakesh Thera --- packages/core-components/src/layout/Sidebar/Items.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/core-components/src/layout/Sidebar/Items.tsx b/packages/core-components/src/layout/Sidebar/Items.tsx index b227d81dc1..d2e2c22689 100644 --- a/packages/core-components/src/layout/Sidebar/Items.tsx +++ b/packages/core-components/src/layout/Sidebar/Items.tsx @@ -389,7 +389,6 @@ const SidebarItemBase = forwardRef((props, ref) => { invisible={!hasNotifications} className={classnames({ [classes.closedItemIcon]: !isOpen })} > - {displayItemIcon} ); From 521293b22e10e079fd3721ca6ee9b029ac05f41a Mon Sep 17 00:00:00 2001 From: Rakesh Thera Date: Tue, 26 Apr 2022 20:07:57 +0530 Subject: [PATCH 3/5] Inclued the changeset Signed-off-by: Rakesh Thera --- .changeset/tough-queens-hope.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tough-queens-hope.md diff --git a/.changeset/tough-queens-hope.md b/.changeset/tough-queens-hope.md new file mode 100644 index 0000000000..c86d7f39b0 --- /dev/null +++ b/.changeset/tough-queens-hope.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-components': patch +--- + +Added a chevron Indicator when the sidebar is collapsed and has a submenu From 42bdeb514fd408af71b5d9ed71547fd790862a62 Mon Sep 17 00:00:00 2001 From: Rakesh Thera Date: Wed, 27 Apr 2022 16:33:59 +0530 Subject: [PATCH 4/5] Corrected Spell checks Signed-off-by: Rakesh Thera --- .changeset/tough-queens-hope.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/tough-queens-hope.md b/.changeset/tough-queens-hope.md index c86d7f39b0..6816893611 100644 --- a/.changeset/tough-queens-hope.md +++ b/.changeset/tough-queens-hope.md @@ -2,4 +2,4 @@ '@backstage/core-components': patch --- -Added a chevron Indicator when the sidebar is collapsed and has a submenu +Added a chevron Indicator when the sidebar is collapsed and has a sub-menu From 22713888851847a978fcaeda35bc24660d783a8e Mon Sep 17 00:00:00 2001 From: rthera7 Date: Fri, 13 May 2022 18:32:58 +0530 Subject: [PATCH 5/5] Removed unwanted fragment, centered the Chevron indicator Signed-off-by: rthera7 --- .../core-components/src/layout/Sidebar/Items.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/core-components/src/layout/Sidebar/Items.tsx b/packages/core-components/src/layout/Sidebar/Items.tsx index d2e2c22689..c004f6904c 100644 --- a/packages/core-components/src/layout/Sidebar/Items.tsx +++ b/packages/core-components/src/layout/Sidebar/Items.tsx @@ -370,15 +370,13 @@ const SidebarItemBase = forwardRef((props, ref) => { const { isOpen } = useContext(SidebarContext); const divStyle = - !isOpen && children ? { marginLeft: '24px', marginBottom: '4px' } : {}; + !isOpen && children ? { display: 'flex', marginLeft: '24px' } : {}; const displayItemIcon = ( - <> -
- - {!isOpen && children ? : <>} -
- +
+ + {!isOpen && children ? : <>} +
); const itemIcon = (