Skip to content

Commit

Permalink
feat: Sidebar expansion close (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
PritishBudhiraja authored Dec 22, 2023
1 parent 1b86323 commit ea91fba
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/screens/HyperSwitch/Sidebar/Sidebar.res
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,15 @@ module SidebarNestedSection = {
None
}, (isSectionExpanded, isSideBarExpanded))

React.useEffect2(() => {
if isSideBarExpanded {
setIsSectionExpanded(_ => isAnySubItemSelected)
} else {
setIsSectionExpanded(_ => false)
}
None
}, (isSideBarExpanded, isAnySubItemSelected))

let toggleSectionExpansion = React.useCallback4(_ev => {
if !isSideBarExpanded {
setIsSidebarExpanded(_ => true)
Expand Down

0 comments on commit ea91fba

Please sign in to comment.