import React, { Component } from "react"; import MoreVertIcon from "@material-ui/icons/MoreVert"; import ArrowForwardIcon from "@material-ui/icons/ArrowForward"; import Menu from "@material-ui/core/Menu"; import MenuItem from "@material-ui/core/MenuItem"; import StatusAvatar from "./Avatar/index.js"; import { connect } from "react-redux"; import "./index.scss"; class Header extends Component { constructor(props) { super(props); this.state = { anchorEl: null, }; } handleClick = (event) => { this.setState({ anchorEl: event.currentTarget, }); }; handleClose = () => { this.setState({ anchorEl: null, }); }; back = () => { window.history.back(); }; render() { const { page, setPage, chatInfo, parent } = this.props; const { anchorEl } = this.state; return (
{window.innerWidth < 1000 ? ( page === "chatroom" ? this.back() : setPage("chatroom") } style={{ color: "grey", width: 29, height: 29, marginTop: 4 }} /> ) : null}
window.innerWidth < 1000 ? setPage("info") : parent.handleDrawerOpen() } className="chat-header__info d-flex mr-1" >

{chatInfo ? chatInfo.title : null}

{chatInfo ? chatInfo.subTitle : null}
{/* */}
this.handleClose()} className="fontLight rtl" > this.handleClose()} > پروفایل this.handleClose()} > حساب کاربری this.handleClose()} > خروج
); } } export default connect((state) => ({ chatInfo: state.chat.info }), {})(Header);