diff --git a/src/components/Sidebar/SidebarMenu/index.js b/src/components/Sidebar/SidebarMenu/index.js index fea3b1e..6b91f58 100644 --- a/src/components/Sidebar/SidebarMenu/index.js +++ b/src/components/Sidebar/SidebarMenu/index.js @@ -15,7 +15,9 @@ import moon from "./moon.svg"; import sms from "./sms.svg"; import userEdit from "./user-edit.svg"; import Switch from "../../Switch"; - +const COMPONENTS = { + Switch: , +}; const SidebarMenu = ({ items, buttons }) => { return (
@@ -81,7 +83,7 @@ const SidebarMenu = ({ items, buttons }) => {

{/* من اینجا ۲ حالت در نظر گرفتم که یا میتونه عکس باشه یا یک کامپوننت به این دلیل که اون سویییچ را داخل یک کامپوننت دیگه درست کردم برای همین یا میشه بهش کامپوننت بدیم به عکس */} {button.component ? ( - button.component + COMPONENTS[button.component] ) : ( )} @@ -98,7 +100,7 @@ export default SidebarMenu; SidebarMenu.defaultProps = { items: [ { - icon: element, + icon: "/images/logo192.png", title: "داشبورد مدیریت", notification: null, subItems: [], @@ -155,7 +157,7 @@ SidebarMenu.defaultProps = { ], buttons: [ - { icon: moon, title: "حالت شب", leftIcon: null, component: }, + { icon: moon, title: "حالت شب", leftIcon: null, component: "Switch" }, { icon: logout, title: "خروج از حساب کاربری",