2017-05-03 00:04:16 +00:00
|
|
|
import React from 'react';
|
2017-07-20 23:38:24 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2016-09-13 00:24:40 +00:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
2018-06-13 12:44:50 +00:00
|
|
|
import ActionBar from './action_bar';
|
2016-12-02 14:05:50 +00:00
|
|
|
import Avatar from '../../../components/avatar';
|
|
|
|
import Permalink from '../../../components/permalink';
|
2018-06-13 12:44:50 +00:00
|
|
|
import IconButton from '../../../components/icon_button';
|
2016-11-16 16:20:52 +00:00
|
|
|
import { FormattedMessage } from 'react-intl';
|
2017-05-03 00:04:16 +00:00
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
2016-09-13 00:24:40 +00:00
|
|
|
|
2017-06-23 17:36:54 +00:00
|
|
|
export default class NavigationBar extends ImmutablePureComponent {
|
2016-09-13 00:24:40 +00:00
|
|
|
|
2017-05-12 12:44:10 +00:00
|
|
|
static propTypes = {
|
2017-05-20 15:31:47 +00:00
|
|
|
account: ImmutablePropTypes.map.isRequired,
|
2017-11-24 12:13:17 +00:00
|
|
|
onClose: PropTypes.func,
|
2017-05-12 12:44:10 +00:00
|
|
|
};
|
|
|
|
|
2016-09-13 00:24:40 +00:00
|
|
|
render () {
|
|
|
|
return (
|
2017-02-09 00:20:09 +00:00
|
|
|
<div className='navigation-bar'>
|
2017-05-03 00:04:16 +00:00
|
|
|
<Permalink href={this.props.account.get('url')} to={`/accounts/${this.props.account.get('id')}`}>
|
2017-07-27 22:54:48 +00:00
|
|
|
<span style={{ display: 'none' }}>{this.props.account.get('acct')}</span>
|
2017-08-07 17:44:55 +00:00
|
|
|
<Avatar account={this.props.account} size={40} />
|
2017-05-03 00:04:16 +00:00
|
|
|
</Permalink>
|
2016-09-13 00:24:40 +00:00
|
|
|
|
2017-04-23 02:26:55 +00:00
|
|
|
<div className='navigation-bar__profile'>
|
2017-04-25 02:45:27 +00:00
|
|
|
<Permalink href={this.props.account.get('url')} to={`/accounts/${this.props.account.get('id')}`}>
|
|
|
|
<strong className='navigation-bar__profile-account'>@{this.props.account.get('acct')}</strong>
|
|
|
|
</Permalink>
|
2017-05-03 00:04:16 +00:00
|
|
|
|
2017-04-23 02:26:55 +00:00
|
|
|
<a href='/settings/profile' className='navigation-bar__profile-edit'><FormattedMessage id='navigation_bar.edit_profile' defaultMessage='Edit profile' /></a>
|
2016-09-13 00:24:40 +00:00
|
|
|
</div>
|
2017-07-20 23:38:24 +00:00
|
|
|
|
2018-06-13 12:44:50 +00:00
|
|
|
<div class='navigation-bar__actions'>
|
|
|
|
<IconButton className='close' title='' icon='close' onClick={this.props.onClose} />
|
|
|
|
<ActionBar account={this.props.account} />
|
|
|
|
</div>
|
2016-09-13 00:24:40 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-04-21 18:05:35 +00:00
|
|
|
}
|