mirror of https://framagit.org/tykayn/mastodon.git
56 lines
1.2 KiB
JavaScript
56 lines
1.2 KiB
JavaScript
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import React from 'react';
|
||
|
|
||
|
export default class Contact extends ImmutablePureComponent {
|
||
|
|
||
|
static propTypes = {
|
||
|
account: PropTypes.object,
|
||
|
};
|
||
|
static defaultProps = {};
|
||
|
|
||
|
constructor(props) {
|
||
|
super(props);
|
||
|
this.state = {
|
||
|
account: this.props.account,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
openConversationWithAccount = (accountId) => {
|
||
|
dispatchEvent({ type: 'openConversation', target: accountId });
|
||
|
};
|
||
|
|
||
|
render() {
|
||
|
return (
|
||
|
<div
|
||
|
className='contact media'
|
||
|
onClick={this.openConversationWithAccount}
|
||
|
>
|
||
|
<div className='name media-left'>
|
||
|
|
||
|
<div className='avatar image is-32x32'>
|
||
|
<img
|
||
|
className='is-rounded'
|
||
|
src={this.props.account.avatar}
|
||
|
alt='avatar'
|
||
|
/>
|
||
|
</div >
|
||
|
|
||
|
</div >
|
||
|
<div className='media-content'>
|
||
|
<div className='username'>
|
||
|
{this.props.account.username}
|
||
|
</div >
|
||
|
</div >
|
||
|
<div className='media-right'>
|
||
|
<div className='last-seen'>
|
||
|
<i className='fa fa-clock-o' />
|
||
|
</div >
|
||
|
</div >
|
||
|
|
||
|
</div >
|
||
|
);
|
||
|
}
|
||
|
|
||
|
}
|