mirror of https://framagit.org/tykayn/mastodon.git
66 lines
1.6 KiB
JavaScript
66 lines
1.6 KiB
JavaScript
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
import Permalink from '../../../../components/permalink';
|
|
|
|
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() {
|
|
const account = this.props.account;
|
|
return (
|
|
<div
|
|
className='contact media'
|
|
onClick={this.openConversationWithAccount}
|
|
>
|
|
<div className='name media-left'>
|
|
|
|
<Permalink
|
|
key={account.id}
|
|
className='account__display-name'
|
|
title={account.acct}
|
|
href={account.url}
|
|
to={`/accounts/${account.id}`}
|
|
>
|
|
|
|
<div className='avatar image is-32x32'>
|
|
<img
|
|
className='is-rounded'
|
|
src={this.props.account.avatar}
|
|
alt='avatar'
|
|
/>
|
|
</div >
|
|
</Permalink >
|
|
</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 >
|
|
);
|
|
}
|
|
|
|
}
|