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