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