From 5b2f8bcf38f743a0416e1957d46d84aa788af470 Mon Sep 17 00:00:00 2001 From: mahdi Date: Sat, 7 May 2022 13:14:47 +0430 Subject: [PATCH] update 5 files --- src/components/Sidebar/SidebarMenu/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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: "خروج از حساب کاربری",