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