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