-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfde740
commit b67d98b
Showing
18 changed files
with
290 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,149 @@ | ||
import List from "@mui/material/List" | ||
import ListItem from "@mui/material/ListItem" | ||
import ListItemButton from "@mui/material/ListItemButton" | ||
import ListItemIcon from "@mui/material/ListItemIcon" | ||
import ListItemText from "@mui/material/ListItemText" | ||
import DashboardCustomizeIcon from "@mui/icons-material/DashboardCustomize" | ||
import AttachMoneyIcon from "@mui/icons-material/AttachMoney" | ||
import InventoryIcon from "@mui/icons-material/Inventory" | ||
import StoreIcon from "@mui/icons-material/Store" | ||
import StarsIcon from "@mui/icons-material/Stars" | ||
import ShoppingCartIcon from "@mui/icons-material/ShoppingCart" | ||
import { useNavigate } from "react-router-dom" | ||
import List from "@mui/material/List"; | ||
import ListItem from "@mui/material/ListItem"; | ||
import ListItemButton from "@mui/material/ListItemButton"; | ||
import ListItemIcon from "@mui/material/ListItemIcon"; | ||
import DashboardCustomizeIcon from "@mui/icons-material/DashboardCustomize"; | ||
import AttachMoneyIcon from "@mui/icons-material/AttachMoney"; | ||
import InventoryIcon from "@mui/icons-material/Inventory"; | ||
import StoreIcon from "@mui/icons-material/Store"; | ||
import StarsIcon from "@mui/icons-material/Stars"; | ||
import ShoppingCartIcon from "@mui/icons-material/ShoppingCart"; | ||
import * as React from "react"; | ||
import { styled } from "@mui/material/styles"; | ||
import Menu from "@mui/material/Menu"; | ||
import MenuItem from "@mui/material/MenuItem"; | ||
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; | ||
import FormatListBulletedIcon from '@mui/icons-material/FormatListBulleted'; | ||
import AddToPhotosIcon from '@mui/icons-material/AddToPhotos'; | ||
|
||
const DrawerList = ({handleClickPath}) => { | ||
|
||
const icons = [ | ||
{ | ||
title: "Dashboard", | ||
iconName: <DashboardCustomizeIcon />, | ||
path: "/stock", | ||
}, | ||
{ | ||
title: "Purchases", | ||
iconName: <ShoppingCartIcon />, | ||
path: "/stock/purchases/", | ||
}, | ||
{ | ||
title: "Sales", | ||
iconName: <AttachMoneyIcon />, | ||
path: "/stock/sales/", | ||
const StyledMenu = styled((props) => ( | ||
<Menu | ||
elevation={0} | ||
anchorOrigin={{ | ||
vertical: "bottom", | ||
horizontal: "right", | ||
}} | ||
transformOrigin={{ | ||
vertical: "top", | ||
horizontal: "right", | ||
}} | ||
{...props} | ||
/> | ||
))(({ theme }) => ({ | ||
"& .MuiPaper-root": { | ||
borderRadius: 6, | ||
marginTop: theme.spacing(1), | ||
minWidth: 180, | ||
boxShadow: | ||
"rgb(255, 255, 255) 0px 0px 0px 0px, rgba(0, 0, 0, 0.05) 0px 0px 0px 1px, rgba(0, 0, 0, 0.1) 0px 10px 15px -3px, rgba(0, 0, 0, 0.05) 0px 4px 6px -2px", | ||
"& .MuiMenu-list": { | ||
padding: "4px 0", | ||
}, | ||
{ | ||
title: "Firms", | ||
iconName: <StoreIcon />, | ||
path: "/stock/firms/", | ||
"& .MuiMenuItem-root": { | ||
"& .MuiSvgIcon-root": { | ||
fontSize: 18, | ||
marginRight: theme.spacing(1.5), | ||
}, | ||
}, | ||
{ | ||
title: "Brands", | ||
iconName: <StarsIcon />, | ||
path: "/stock/brands/", | ||
}, | ||
{ | ||
title: "Products", | ||
iconName: <InventoryIcon />, | ||
path: "/stock/products/", | ||
}, | ||
] | ||
}, | ||
})); | ||
|
||
const DrawerList = ({ handleClickPath }) => { | ||
const [anchorEl, setAnchorEl] = React.useState(null); | ||
const [selectedMenu, setSelectedMenu] = React.useState(null); | ||
|
||
const handleMenuClick = (event, index) => { | ||
setAnchorEl(event.currentTarget); | ||
setSelectedMenu(index); | ||
}; | ||
|
||
const handleClose = () => { | ||
setAnchorEl(null); | ||
setSelectedMenu(null); | ||
}; | ||
|
||
const icons = [ | ||
{ title: "Dashboard", icon: <DashboardCustomizeIcon />, path: "/stock" }, | ||
{ title: "Purchases", icon: <ShoppingCartIcon />}, | ||
{ title: "Sales", icon: <AttachMoneyIcon />}, | ||
{ title: "Firms", icon: <StoreIcon />}, | ||
{ title: "Brands", icon: <StarsIcon /> }, | ||
{ title: "Products", icon: <InventoryIcon />}, | ||
]; | ||
|
||
const menuItems = [ | ||
[], | ||
[ | ||
{ title: "Add Purchase", icon: <AddToPhotosIcon />, path: "/stock/addpurchase" }, | ||
{ title: "List Purchases", icon: <FormatListBulletedIcon />, path: "/stock/listpuchases" }, | ||
], | ||
[ | ||
{ title: "Add Sales", icon: <AddToPhotosIcon />, path: "/stock/addsales" }, | ||
{ title: "List Sales", icon: <FormatListBulletedIcon />, path: "/stock/listsales" }, | ||
], | ||
[ | ||
{ title: "Add Firm", icon: <AddToPhotosIcon />, path: "/stock/addfirm" }, | ||
{ title: "List Firms", icon: <FormatListBulletedIcon />, path: "/stock/listfirms" }, | ||
], | ||
[ | ||
{ title: "Add Brand", icon: <AddToPhotosIcon />, path: "/stock/addbrand" }, | ||
{ title: "List Brands", icon: <FormatListBulletedIcon />, path: "/stock/listbrands" }, | ||
], | ||
[ | ||
{ title: "Add Product", icon: <AddToPhotosIcon />, path: "/stock/addproduct" }, | ||
{ title: "List Products", icon: <FormatListBulletedIcon />, path: "/stock/listproducts" }, | ||
], | ||
]; | ||
|
||
return ( | ||
<List> | ||
{icons.map((item, index) => ( | ||
<ListItem | ||
key={index} | ||
disablePadding | ||
onClick={() => handleClickPath(item.path)} | ||
<List> | ||
{icons.map((item, index) => ( | ||
<ListItem key={index} disablePadding> | ||
|
||
<ListItemButton | ||
sx={{ | ||
":hover":{backgroundColor:"#0551B6"}, | ||
color: "white", | ||
":hover": { backgroundColor: "#0551B6" }, | ||
"& .MuiSvgIcon-root": { color: "white" }, | ||
|
||
}} | ||
aria-controls={selectedMenu === index ? "demo-customized-menu" : undefined} | ||
aria-haspopup="true" | ||
aria-expanded={selectedMenu === index ? "true" : undefined} | ||
variant="text" | ||
onClick={(event) => handleMenuClick(event, index)} | ||
> | ||
<ListItemIcon>{item.icon}</ListItemIcon> | ||
{item.title} | ||
<KeyboardArrowDownIcon sx={{ ml: "auto" }} /> | ||
</ListItemButton> | ||
<StyledMenu | ||
id="demo-customized-menu" | ||
MenuListProps={{ | ||
"aria-labelledby": "demo-customized-button", | ||
}} | ||
anchorEl={anchorEl} | ||
open={selectedMenu === index} | ||
onClose={handleClose} | ||
> | ||
<ListItemButton> | ||
<ListItemIcon>{item.iconName}</ListItemIcon> | ||
<ListItemText primary={item.title} /> | ||
</ListItemButton> | ||
</ListItem> | ||
))} | ||
</List> | ||
) | ||
} | ||
{menuItems[index].map((menuItem, idx) => ( | ||
<MenuItem | ||
key={idx} | ||
onClick={() => { | ||
handleClose(); | ||
handleClickPath(menuItem.path); | ||
}} | ||
sx={{ ":hover": { backgroundColor: "#064EAF", color: "white" } }} | ||
disableRipple | ||
> | ||
{menuItem.icon} | ||
{menuItem.title} | ||
</MenuItem> | ||
))} | ||
</StyledMenu> | ||
</ListItem> | ||
))} | ||
</List> | ||
); | ||
}; | ||
|
||
export default DrawerList | ||
export default DrawerList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
|
||
const AddBrand = () => { | ||
return ( | ||
<div> | ||
Brands ekleme | ||
</div> | ||
) | ||
} | ||
|
||
export default AddBrand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
const AddFirm = () => { | ||
return ( | ||
<div> | ||
Firma ekleme | ||
</div> | ||
) | ||
} | ||
|
||
export default AddFirm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
const AddProduct = () => { | ||
return ( | ||
<div> | ||
add product | ||
</div> | ||
) | ||
} | ||
|
||
export default AddProduct |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
const AddPurchase = () => { | ||
return ( | ||
<div> | ||
add purchase | ||
</div> | ||
) | ||
} | ||
|
||
export default AddPurchase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
const AddSales = () => { | ||
return ( | ||
<div> | ||
add sales | ||
</div> | ||
) | ||
} | ||
|
||
export default AddSales |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
const Home = () => { | ||
return ( | ||
<div> | ||
|
||
Home sayfası | ||
</div> | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
|
||
const ListBrands = () => { | ||
return ( | ||
<div> | ||
|
||
</div> | ||
) | ||
} | ||
|
||
export default ListBrands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react' | ||
|
||
const Brands = () => { | ||
const ListFirms = () => { | ||
return ( | ||
<div> | ||
|
||
</div> | ||
) | ||
} | ||
|
||
export default Brands | ||
export default ListFirms |
Oops, something went wrong.