Add expanded field to SidebarSubmenuItem
Signed-off-by: Chase Bennett <chase_bennett@carmax.com>
This commit is contained in:
committed by
Vincenzo Scamporlino
parent
137cee2198
commit
8a96409d53
@@ -131,6 +131,7 @@ export type SidebarSubmenuItemProps = {
|
||||
icon?: IconComponent;
|
||||
dropdownItems?: SidebarSubmenuItemDropdownItem[];
|
||||
exact?: boolean;
|
||||
expanded?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -149,7 +150,7 @@ export const SidebarSubmenuItem = (props: SidebarSubmenuItemProps) => {
|
||||
const currentLocation = useLocation();
|
||||
let isActive = isLocationMatch(currentLocation, toLocation, exact);
|
||||
|
||||
const [showDropDown, setShowDropDown] = useState(false);
|
||||
const [showDropDown, setShowDropDown] = useState(props.expanded ?? false);
|
||||
const handleClickDropdown = () => {
|
||||
setShowDropDown(!showDropDown);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user