import React, { Component } from "react"; import AddCircleOutlineRoundedIcon from "@material-ui/icons/AddCircleOutlineRounded"; import { Link } from "react-router-dom"; import { toast } from "react-toastify"; import Avatar from "@material-ui/core/Avatar"; import CheckIcon from "@material-ui/icons/Check"; import KeyboardArrowUpIcon from "@material-ui/icons/KeyboardArrowUp"; import KeyboardArrowDownIcon from "@material-ui/icons/KeyboardArrowDown"; // import { logout } from '../../../../Redux/actions/user'; // import { connect } from 'react-redux'; import user1 from "~/assets/images/user1.png"; import user2 from "~/assets/images/user2.png"; import mobileHome from "~/assets/icons/mobileHome.svg"; import mobileAr from "~/assets/icons/mobileAr.svg"; import qrcode from "~/assets/icons/drawer-qr.png"; import mobileBasket from "~/assets/icons/mobileBasket.svg"; import mobileBlog from "~/assets/icons/mobileBlog.svg"; import mobileMail from "~/assets/icons/mobileMail.svg"; import mobileProfile from "~/assets/icons/mobileProfile.svg"; import mobileDanger from "~/assets/icons/mobileDanger.svg"; import mobileLogout from "~/assets/icons/mobileLogout.svg"; import "./NavbarDrawer.scss"; class NavbarDrawer extends Component { state = { dropdown: false, }; render() { return (
{this.props.users.map((item, i) => item.status === 1 ? (

{item.firstName + " " + item.lastName}

{item.title}
) : null )} {this.state.dropdown ? (
this.setState({ dropdown: false })} > 25 امتیاز
) : (
this.setState({ dropdown: true })} > 25 امتیاز
)}
{this.state.dropdown ? (
اضافه کردن کاربر
{/* {item.message &&
{item.message}
} */}
{this.props.users.map((item, i) => ( ))}
) : null}
{this.props.links.map((item, key) => ( (item.link === "" ? toast.error(item.toast) : null)) } >
{item.icon}
{item.name}
{item.message &&
{item.message}
}
))} {/*
نسخه نرم‌افزار 3.1
*/}
); } } export default NavbarDrawer; // export default connect((state) => ({ isLogin: state.user.isLogin }), { logout })(NavbarDrawer); NavbarDrawer.defaultProps = { users: [ { id: 1, firstName: "اکبر", lastName: "خراسانی", title: "استاد علوم تجربی", image: user2, status: 1, }, ], links: [ { name: "صفحه اصلی", link: "/", icon: صفحه اصلی, toast: "", message: "", }, { name: "واقعیت افزوده", link: "/ar", icon: واقعیت افزوده, toast: "", message: "", }, { name: "بارکد خوان", link: "/qr-scan", icon: بارکد خوان, toast: "", message: "", }, { name: "کتاب‌های من", link: "/mybooks", icon: کتاب‌های من, toast: "", message: "", }, { name: "فروشگاه", link: "/products", icon: فروشگاه, toast: "", message: "", }, { name: "بلاگ", link: "/blogs", icon: بلاگ, toast: "", message: "", }, { name: "پیام رسان", link: "/", icon: پیام رسان, toast: "", message: "", }, { name: "پشتیبانی", link: "/support", icon: پشتیبانی, toast: "", message: "", // onClick: this.props.logout, }, { name: "ویرایش مشخصات", link: "/profile", icon: ویرایش مشخصات, toast: "", message: "4 پیام", }, { name: "خروج", link: "/", icon: خروج, toast: "", message: "", // onClick: this.props.logout, }, ], }; const User = (props) => { return (

{props.data.firstName + " " + props.data.lastName}

{props.data.title}
{props.data.status === 1 ? (
) : null}
); };