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