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