/* Please direct questions to Hansi Xu (Wallace LaWall on Discord) */ import React from 'react'; import './chats.css'; class Contact extends React.Component { constructor(props) { super(props) this.state = { selected : this.props.selected } } onClick() { // This toggling of the contact selection is for demo purposes only // Once backend is implemented, only one contact can be selected if (this.state.selected === "false") { this.setState({selected : "true"}) } else { this.setState({selected : "false"}) } } render() { return (
this.onClick()} alt="profile" />
this.onClick()}>{this.props.name}
) } } export default Contact;