$.each(arr, (i, val) => {
$('.wrap').append(`
<div class="block">
<div class="author">${val.author}</div>
<div class="rate">
<b>Рейтинг:</b>
<span class="star filled"></span>
<span class="star filled"></span>
<span class="star filled"></span>
<span class="star"></span>
<span class="star"></span>
</div>
</div>
`)
}
class ChatContainer extends React.Component {
constructor(props) {
super(props)
this.openCurrentUserInfo = this.openCurrentUserInfo.bind(this)
this.state = {
showCurrentUserInfo: null
}
}
openCurrentUserInfo(event, conversation, type) {
this.setState({
showCurrentUserInfo: conversation
})
console.log(this.state.showCurrentUserInfo)
}
render() {
return (
<ChatWrapper>
<ChatHeader
<b>openCurrentUserInfo={this.openCurrentUserInfo}</b>
/>
</ChatWrapper>
)
}
}
const ChatHeader = ({
<b>openCurrentUserInfo</b>,
}) => {
return (
<React.Fragment>
<ChatHeaderWrapper>
<CurrentUserInfo
<b> openCurrentUserInfo={openCurrentUserInfo}</b>
</ChatHeaderWrapper>
</React.Fragment>
)
}
const CurrentUserInfo = ({ openCurrentUserInfo }) => {
const handleClick = event => {
let type = 'rightMenu'
<b>openCurrentUserInfo(event, conversation, type)</b>
};
return (
<React.Fragment>
<UserInfoWrapper>
<UserNameWrapper onClick={e => handleClick(e)}>
</UserNameWrapper>
</UserInfoWrapper>
</React.Fragment>
)
}
export default CurrentUserInfo