merge confilict
This commit is contained in:
41
src/components/MapTest.jsx
Normal file
41
src/components/MapTest.jsx
Normal file
@@ -0,0 +1,41 @@
|
||||
"use client"
|
||||
import {Typography} from "@mui/material";
|
||||
|
||||
const data = [
|
||||
{
|
||||
id : "hello",
|
||||
Subitems : [
|
||||
{id : "amin",firstName : "amin", lastName:"ali",Subitems : [{id : "shahrokh",shahrokh : "shahrokh"}], hasSubitems : true, showSubitems : false},
|
||||
{id : "amir",firstName : "amir", lastName:"akbar", hasSubitems : false, showSubitems : false},
|
||||
],
|
||||
hasSubitems : true,
|
||||
showSubitems : false
|
||||
},
|
||||
{
|
||||
id : "hi",
|
||||
Subitems : [
|
||||
{id : "ali",firstName : "ali", lastName:"ali", hasSubitems : false, showSubitems : false},
|
||||
{id : "akbar",firstName : "akbar", lastName:"akbar", hasSubitems : false, showSubitems : false},
|
||||
],
|
||||
hasSubitems : true,
|
||||
showSubitems : false
|
||||
}
|
||||
]
|
||||
const MapTest = () => {
|
||||
const Amin = data.map((item) => {
|
||||
return item.hasSubitems ? {...item, Subitems: item.Subitems.map((subitem) => true ? {
|
||||
...subitem, showSubitems: !item.showSubitems
|
||||
} : subitem)} : item
|
||||
})
|
||||
|
||||
|
||||
console.log(Amin)
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Typography>hello</Typography>
|
||||
</>
|
||||
)
|
||||
}
|
||||
export default MapTest
|
||||
@@ -4,6 +4,7 @@ import {Box, Drawer, IconButton, Paper, styled, Toolbar, Typography} from "@mui/
|
||||
import MuiAppBar from '@mui/material/AppBar';
|
||||
import MenuIcon from '@mui/icons-material/Menu';
|
||||
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
||||
import SidebarMenu from "@/core/components/SidebarMenu";
|
||||
|
||||
const drawerWidth = 260;
|
||||
|
||||
@@ -82,6 +83,7 @@ const HeaderWithSidebar = ({children}) => {
|
||||
<ChevronRightIcon/>
|
||||
</IconButton>
|
||||
</DrawerHeader>
|
||||
<SidebarMenu />
|
||||
</Drawer>
|
||||
<Main elevation={0} open={open}>
|
||||
<DrawerHeader/>
|
||||
|
||||
Reference in New Issue
Block a user