|
|
@ -8,26 +8,38 @@ import MoreHorizOutlinedIcon from "@material-ui/icons/MoreHorizOutlined"; |
|
|
|
import Switch from "@material-ui/core/Switch"; |
|
|
|
import Switch from "@material-ui/core/Switch"; |
|
|
|
import { withStyles } from "@material-ui/core/styles"; |
|
|
|
import { withStyles } from "@material-ui/core/styles"; |
|
|
|
import BlockIcon from '@material-ui/icons/Block'; |
|
|
|
import BlockIcon from '@material-ui/icons/Block'; |
|
|
|
|
|
|
|
import KeyboardArrowLeftIcon from '@material-ui/icons/KeyboardArrowLeft'; |
|
|
|
|
|
|
|
import KeyboardBackspaceIcon from '@material-ui/icons/KeyboardBackspace'; |
|
|
|
|
|
|
|
import CloseIcon from '@material-ui/icons/Close'; |
|
|
|
|
|
|
|
|
|
|
|
import user2 from "../../../assets/images/user2.png"; |
|
|
|
import user2 from "../../../assets/images/user2.png"; |
|
|
|
|
|
|
|
|
|
|
|
import "./index.scss"; |
|
|
|
import "./index.scss"; |
|
|
|
|
|
|
|
|
|
|
|
const maxDesktopSize = 1250; |
|
|
|
const maxDesktopSize = 1250; |
|
|
|
|
|
|
|
const maxMobileSize = 650; |
|
|
|
|
|
|
|
|
|
|
|
const fontSize = { |
|
|
|
const fontSize = { |
|
|
|
desktop: { |
|
|
|
desktop: { |
|
|
|
h1: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 70, |
|
|
|
h1: window.innerWidth > maxDesktopSize ? 20 : window.innerWidth / 70, |
|
|
|
h2: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 80, |
|
|
|
h2: window.innerWidth > maxDesktopSize ? 18 : window.innerWidth / 80, |
|
|
|
p: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 85, |
|
|
|
p: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 85, |
|
|
|
h3: window.innerWidth > maxDesktopSize ? 17 : window.innerWidth / 85, |
|
|
|
h3: window.innerWidth > maxDesktopSize ? 16 : window.innerWidth / 85, |
|
|
|
span: window.innerWidth > maxDesktopSize ? 17 : window.innerWidth / 85, |
|
|
|
span: window.innerWidth > maxDesktopSize ? 14 : window.innerWidth / 85, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
mobile: { |
|
|
|
|
|
|
|
h1: window.innerWidth > maxMobileSize ? 20 : window.innerWidth / 20, |
|
|
|
|
|
|
|
h2: window.innerWidth > maxMobileSize ? 18 : window.innerWidth / 23, |
|
|
|
|
|
|
|
p: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 30, |
|
|
|
|
|
|
|
h3: window.innerWidth > maxMobileSize ? 16 : window.innerWidth / 25, |
|
|
|
|
|
|
|
span: window.innerWidth > maxMobileSize ? 14 : window.innerWidth / 28, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
export default class ChatInfo extends Component { |
|
|
|
export default class ChatInfo extends Component { |
|
|
|
constructor(props) { |
|
|
|
constructor(props) { |
|
|
|
super(props); |
|
|
|
super(props); |
|
|
|
this.state = { |
|
|
|
this.state = { |
|
|
|
|
|
|
|
gallery : false, |
|
|
|
alarms: false, |
|
|
|
alarms: false, |
|
|
|
buttons: [ |
|
|
|
buttons: [ |
|
|
|
{ |
|
|
|
{ |
|
|
@ -55,7 +67,6 @@ export default class ChatInfo extends Component { |
|
|
|
backgroundColor: "grey", |
|
|
|
backgroundColor: "grey", |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
], |
|
|
|
gallery: null, |
|
|
|
|
|
|
|
user: { |
|
|
|
user: { |
|
|
|
profileImages: [ |
|
|
|
profileImages: [ |
|
|
|
{ id: 0, src: user2 }, |
|
|
|
{ id: 0, src: user2 }, |
|
|
@ -93,7 +104,16 @@ export default class ChatInfo extends Component { |
|
|
|
<> |
|
|
|
<> |
|
|
|
{window.innerWidth > 1000 ? ( |
|
|
|
{window.innerWidth > 1000 ? ( |
|
|
|
<section className="desktop-contact-info d-flex flex-column"> |
|
|
|
<section className="desktop-contact-info d-flex flex-column"> |
|
|
|
<header className="desktop-contact-info__header d-flex align-items-center justify-content-center"></header> |
|
|
|
<header className="desktop-contact-info__header d-flex align-items-center justify-content-center"> |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
this.state.gallery ? |
|
|
|
|
|
|
|
<KeyboardBackspaceIcon onClick={() => this.setState({ gallery: false})} style={{ cursor: 'pointer', width: 35, height: 35, position: 'absolute', left: 10, top: 10}} /> :
|
|
|
|
|
|
|
|
<CloseIcon onClick={ () => this.props.parent.handleDrawerClose()} style={{ cursor: 'pointer', width: 35, height: 35, position: 'absolute', left: 10, top: 10}} /> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</header> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
!this.state.gallery ?
|
|
|
|
<div className="desktop-contact-info__body d-flex flex-column align-items-center"> |
|
|
|
<div className="desktop-contact-info__body d-flex flex-column align-items-center"> |
|
|
|
<img |
|
|
|
<img |
|
|
|
className="desktop-contact-info__body--profileImage" |
|
|
|
className="desktop-contact-info__body--profileImage" |
|
|
@ -107,7 +127,7 @@ export default class ChatInfo extends Component { |
|
|
|
<h2 style={{ fontSize: fontSize.desktop.h2 }}>مشخصات تحصیلی</h2> |
|
|
|
<h2 style={{ fontSize: fontSize.desktop.h2 }}>مشخصات تحصیلی</h2> |
|
|
|
<ul> |
|
|
|
<ul> |
|
|
|
{user.educationalInfo.map((item, i) => ( |
|
|
|
{user.educationalInfo.map((item, i) => ( |
|
|
|
<li key={i}>{item}</li> |
|
|
|
<li key={i} style={{ fontSize: fontSize.desktop.p}}>{item}</li> |
|
|
|
))} |
|
|
|
))} |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -127,50 +147,88 @@ export default class ChatInfo extends Component { |
|
|
|
<div className="desktop-contact-info__body--options d-flex justify-content-between align-items-center"> |
|
|
|
<div className="desktop-contact-info__body--options d-flex justify-content-between align-items-center"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<h3 style={{ fontSize: fontSize.desktop.h3 }}>اعلانات</h3> |
|
|
|
<h3 style={{ fontSize: fontSize.desktop.h3 }}>اعلانات</h3> |
|
|
|
<span style={{color: alarms ? '#00CC69' : 'red'}}>{alarms ? 'روشن ': 'خاموش'}</span> |
|
|
|
<span style={{ fontSize: fontSize.desktop.span }}>{alarms ? 'روشن ': 'خاموش'}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<AntSwitch |
|
|
|
<AntSwitch |
|
|
|
checked={alarms} |
|
|
|
checked={alarms} |
|
|
|
onChange={() => this.handleChange()} |
|
|
|
onChange={() => this.handleChange()} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="desktop-contact-info__body--options d-flex justify-content-between"> |
|
|
|
<div className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center" onClick={() => this.setState({ gallery: true })}> |
|
|
|
<span style={{ color : 'red',fontSize: fontSize.desktop.h3 }}>مسدود سازی مخاطب</span> |
|
|
|
<h3 style={{ fontSize: fontSize.desktop.h3 }}>رسانه,فیلم,عکس</h3> |
|
|
|
<BlockIcon style={{width : 35, height : 35, color : 'red'}} /> |
|
|
|
<KeyboardArrowLeftIcon style={{width : 30, height : 30, color : 'grey'}} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center"> |
|
|
|
|
|
|
|
<h3 style={{ color : 'red',fontSize: fontSize.desktop.h3 }}>مسدود سازی مخاطب</h3> |
|
|
|
|
|
|
|
<BlockIcon style={{width : 30, height : 30, color : 'red'}} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> : <FileTabs /> |
|
|
|
|
|
|
|
} |
|
|
|
</section> |
|
|
|
</section> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
{window.innerWidth < 1000 ? ( |
|
|
|
{window.innerWidth < 1000 ? ( |
|
|
|
<div className="contact-info d-flex flex-column"> |
|
|
|
<section className="desktop-contact-info d-flex flex-column"> |
|
|
|
<div className="chat-info__image d-flex"> |
|
|
|
<header className="desktop-contact-info__header d-flex align-items-center justify-content-center"> |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
this.state.gallery ? |
|
|
|
|
|
|
|
<KeyboardBackspaceIcon onClick={() => this.setState({ gallery: false})} style={{ cursor: 'pointer', width: 35, height: 35, position: 'absolute', left: 10, top: 10}} /> :
|
|
|
|
|
|
|
|
<CloseIcon onClick={ () => window.innerWidth > 1000 ? this.props.parent.handleDrawerClose() : this.props.parent.setState({ page : 'chatroom' })} style={{ cursor: 'pointer', width: 35, height: 35, position: 'absolute', left: 10, top: 10}} /> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</header> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
!this.state.gallery ?
|
|
|
|
|
|
|
|
<div className="desktop-contact-info__body d-flex flex-column align-items-center"> |
|
|
|
<img |
|
|
|
<img |
|
|
|
|
|
|
|
className="desktop-contact-info__body--profileImage" |
|
|
|
src={user.profileImages[0].src} |
|
|
|
src={user.profileImages[0].src} |
|
|
|
onClick={() => this.setGallery("profile")} |
|
|
|
alt="عکس کاربر" |
|
|
|
alt="" |
|
|
|
|
|
|
|
/> |
|
|
|
/> |
|
|
|
<div |
|
|
|
<h1 style={{ fontSize: fontSize.mobile.h1 }}>{user.name}</h1> |
|
|
|
className="chat-info__image--float d-flex" |
|
|
|
<div className="desktop-contact-info__body--bio d-flex flex-column"> |
|
|
|
onClick={() => this.props.parent.handleDrawerClose()} |
|
|
|
<h2 style={{ fontSize: fontSize.mobile.h2 }}>اطلاعات</h2> |
|
|
|
> |
|
|
|
<p style={{ fontSize: fontSize.mobile.p }}>{user.bio}</p> |
|
|
|
<ChatIcon style={{ color: "white", width: 46, height: 46 }} /> |
|
|
|
<h2 style={{ fontSize: fontSize.mobile.h2 }}>مشخصات تحصیلی</h2> |
|
|
|
|
|
|
|
<ul> |
|
|
|
|
|
|
|
{user.educationalInfo.map((item, i) => ( |
|
|
|
|
|
|
|
<li key={i} style={{ fontSize: fontSize.mobile.p}}>{item}</li> |
|
|
|
|
|
|
|
))} |
|
|
|
|
|
|
|
</ul> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div className="desktop-contact-info__body--buttons d-flex justify-content-around"> |
|
|
|
|
|
|
|
{buttons.map((item, i) => ( |
|
|
|
|
|
|
|
<li style={{ backgroundColor: item.backgroundColor }} key={i}> |
|
|
|
|
|
|
|
{item.icon} |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
|
|
))} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="chat-info__box d-flex flex-column"> |
|
|
|
<div className="desktop-contact-info__body--options d-flex justify-content-between"> |
|
|
|
<div className="chat-info__box--status d-flex flex-column"> |
|
|
|
<h3 style={{ fontSize: fontSize.mobile.h3 }}>نام کاربری</h3> |
|
|
|
<h1>{user.name}</h1> |
|
|
|
<span style={{ fontSize: fontSize.mobile.span }}> |
|
|
|
<p>{user.lastAct}</p> |
|
|
|
{user.username}@ |
|
|
|
|
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="chat-info__box--description d-flex"> |
|
|
|
<div className="desktop-contact-info__body--options d-flex justify-content-between align-items-center"> |
|
|
|
<p>{user.bio}</p> |
|
|
|
<div> |
|
|
|
|
|
|
|
<h3 style={{ fontSize: fontSize.mobile.h3 }}>اعلانات</h3> |
|
|
|
|
|
|
|
<span style={{ fontSize: fontSize.mobile.span }}>{alarms ? 'روشن ': 'خاموش'}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<FileTabs onClick={this.setGallery} /> |
|
|
|
<AntSwitch |
|
|
|
|
|
|
|
checked={alarms} |
|
|
|
|
|
|
|
onChange={() => this.handleChange()} |
|
|
|
|
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{gallery === "profile" ? ( |
|
|
|
<div className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center" onClick={() => this.setState({ gallery: true })}> |
|
|
|
<Gallery data={user.profileImages} onClick={this.setGallery} /> |
|
|
|
<h3 style={{ fontSize: fontSize.mobile.h3 }}>رسانه,فیلم,عکس</h3> |
|
|
|
) : null} |
|
|
|
<KeyboardArrowLeftIcon style={{width : 30, height : 30, color : 'grey'}} /> |
|
|
|
{gallery === "media" ? <Gallery data={null} /> : null} |
|
|
|
</div> |
|
|
|
|
|
|
|
<div className="desktop-contact-info__body--options desktop-contact-info__body--options__click d-flex justify-content-between align-items-center"> |
|
|
|
|
|
|
|
<h3 style={{ color : 'red',fontSize: fontSize.mobile.h3 }}>مسدود سازی مخاطب</h3> |
|
|
|
|
|
|
|
<BlockIcon style={{width : 30, height : 30, color : 'red'}} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> : <FileTabs /> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</section> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
</> |
|
|
|
</> |
|
|
|
); |
|
|
|
); |
|
|
|