Adjusted Sidebar According to an API change
This commit is contained in:
parent
b3a666066c
commit
1ed48f0fae
@ -18,12 +18,14 @@ interface Props {
|
||||
|
||||
export default function SidebarDropdown({ onChange }: Props) {
|
||||
const [value, setValue] = React.useState("");
|
||||
const sidebar = useSelector(selectNavigationSidebar)[0]?.links;
|
||||
const sidebar = useSelector(selectNavigationSidebar)?.links;
|
||||
const handleChange = (event: SelectChangeEvent<string>) => {
|
||||
setValue(event.target.value);
|
||||
onChange?.(event);
|
||||
};
|
||||
|
||||
console.log("sidebar", sidebar);
|
||||
|
||||
return (
|
||||
<FormControl fullWidth variant="outlined" sx={{ minWidth: 200 }}>
|
||||
<InputLabel id="sidebar-dropdown-label">Navigate To</InputLabel>
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
"use client";
|
||||
|
||||
import { useSelector } from "react-redux";
|
||||
import DashboardIcon from "@mui/icons-material/Dashboard";
|
||||
import { ElementType, useState } from "react";
|
||||
import PageLinks from "../../../components/PageLinks/PageLinks";
|
||||
import "./sideBar.scss";
|
||||
import KeyboardArrowRightIcon from "@mui/icons-material/KeyboardArrowRight";
|
||||
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
|
||||
import ChevronLeftIcon from "@mui/icons-material/ChevronLeft";
|
||||
import ChevronRightIcon from "@mui/icons-material/ChevronRight";
|
||||
import { selectNavigationSidebar } from "@/app/redux/metadata/selectors";
|
||||
import { useSelector } from "react-redux";
|
||||
import { SidebarItem } from "@/app/redux/metadata/metadataSlice";
|
||||
import { resolveIcon } from "@/app/utils/iconMap";
|
||||
import "./sideBar.scss";
|
||||
|
||||
interface SidebarProps {
|
||||
isOpen?: boolean;
|
||||
@ -20,7 +20,7 @@ interface SidebarProps {
|
||||
|
||||
const SideBar = ({ isOpen = true, onClose }: SidebarProps) => {
|
||||
const [openMenus, setOpenMenus] = useState<Record<string, boolean>>({});
|
||||
const sidebar = useSelector(selectNavigationSidebar)[0]?.links;
|
||||
const sidebar = useSelector(selectNavigationSidebar)?.links;
|
||||
const toggleMenu = (title: string) => {
|
||||
setOpenMenus(prev => ({ ...prev, [title]: !prev[title] }));
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user