diff --git a/src/sections/Projects/Sistent/components/list/code.js b/src/sections/Projects/Sistent/components/list/code.js index e354b33cd774..723695f3488f 100644 --- a/src/sections/Projects/Sistent/components/list/code.js +++ b/src/sections/Projects/Sistent/components/list/code.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, { useState } from "react"; import { navigate } from "gatsby"; import { useLocation } from "@reach/router"; import { List, ListItemIcon, ListItemAvatar, ListItemText,ListItem,ListSubheader, ListItemButton, SistentThemeProvider, Divider } from "@layer5/sistent"; @@ -6,6 +6,9 @@ import { CodeBlock } from "./code-block"; import { SistentLayout } from "../../sistent-layout"; import TabButton from "../../../../../reusecore/Button"; import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode"; +import ExpandLess from "@mui/icons-material/ExpandLess"; +import ExpandMore from "@mui/icons-material/ExpandMore"; +import Collapse from "@mui/material/Collapse"; const codes = [ // Basic List with List Items @@ -40,11 +43,41 @@ const codes = [ alert("Clicked!")}> Layer5 Sistent Action 1 alert("Clicked!")}>Layer5 Sistent Action 2 `, + // Nested List Example + ` + Layer5 Main Section + + + {open1 ? : } + + + + + + + + + + + {open2 ? : } + + + + + + + + `, ]; const ListCode = () => { const location = useLocation(); const { isDark } = useStyledDarkMode(); + const [open1, setOpen1] = useState(false); + const [open2, setOpen2] = useState(false); + + const toggleOpen1 = () => setOpen1((prev) => !prev); + const toggleOpen2 = () => setOpen2((prev) => !prev); return ( @@ -177,6 +210,62 @@ const ListCode = () => { + + {/* List with Nested Items */} + List with Nested Items + Lists can also be nested to represent hierarchical structures. + + + + + + Layer5 Main Section + + + {/* Main Item 1 with Nested Items */} + + + {open1 ? : } + + + + + + + + + + + + + {/* Main Item 2 with Nested Items */} + + + {open2 ? : } + + + + + + + + + + + + + + + +
Lists can also be nested to represent hierarchical structures.