|
|
@ -1,7 +1,7 @@ |
|
|
|
import React, { useState, useEffect } from "react"; |
|
|
|
import React, { useState, useEffect } from "react"; |
|
|
|
import Avatar from "../../../../components/Avatar"; |
|
|
|
import Avatar from "../../../../components/Avatar"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import { connect } from "react-redux"; |
|
|
|
import {useNavigate} from "react-router-dom"; |
|
|
|
import { useNavigate } from "react-router-dom"; |
|
|
|
import { publicApi, user, dialog } from "../../../../redux/actions"; |
|
|
|
import { publicApi, user, dialog } from "../../../../redux/actions"; |
|
|
|
|
|
|
|
|
|
|
|
import "./index.scss"; |
|
|
|
import "./index.scss"; |
|
|
@ -136,10 +136,10 @@ const SidebarMenu = ({ |
|
|
|
]; |
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
if(!isLogin){ |
|
|
|
if (!isLogin) { |
|
|
|
navigate('/'); |
|
|
|
navigate("/"); |
|
|
|
} |
|
|
|
} |
|
|
|
},[isLogin]); |
|
|
|
}, [isLogin]); |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div |
|
|
|
<div |
|
|
|
className="bg-gray-50 py-5 border-l-2 pl-4 pr-2 shadow-sm border-gray-300 border-solid overflow-y-scroll no-scrollbar divide-y divide-solid divide-gray-200" |
|
|
|
className="bg-gray-50 py-5 border-l-2 pl-4 pr-2 shadow-sm border-gray-300 border-solid overflow-y-scroll no-scrollbar divide-y divide-solid divide-gray-200" |
|
|
@ -152,7 +152,9 @@ const SidebarMenu = ({ |
|
|
|
<div className="flex flex-row items-center mb-10"> |
|
|
|
<div className="flex flex-row items-center mb-10"> |
|
|
|
<Avatar size={60} rounded={true} /> |
|
|
|
<Avatar size={60} rounded={true} /> |
|
|
|
<p className="text-green7B font-bold text-base flex-1 mx-2"> |
|
|
|
<p className="text-green7B font-bold text-base flex-1 mx-2"> |
|
|
|
{user.firstName + " " + user.lastName} |
|
|
|
{`${user.firstName === null ? user.firstName : " "}` + |
|
|
|
|
|
|
|
" " + |
|
|
|
|
|
|
|
user.lastName} |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<Dropdown |
|
|
|
<Dropdown |
|
|
@ -204,7 +206,7 @@ const mapStateToProps = (state) => ({ |
|
|
|
const mapDispatchToProps = { |
|
|
|
const mapDispatchToProps = { |
|
|
|
setDashboardOptions: publicApi.setDashboardOptions, |
|
|
|
setDashboardOptions: publicApi.setDashboardOptions, |
|
|
|
logout: user.logout, |
|
|
|
logout: user.logout, |
|
|
|
setDialog : dialog.set, |
|
|
|
setDialog: dialog.set, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SidebarMenu); |
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SidebarMenu); |
|
|
@ -222,8 +224,6 @@ SidebarMenu.defaultProps = { |
|
|
|
icon: sms, |
|
|
|
icon: sms, |
|
|
|
title: "پشتیبانی", |
|
|
|
title: "پشتیبانی", |
|
|
|
notification: null, |
|
|
|
notification: null, |
|
|
|
list: [ |
|
|
|
list: [{ title: "ثبت نظر", value: "setTicket" }], |
|
|
|
{ title: "ثبت نظر", value: "setTicket" }, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|