2017-05-03 02:04:16 +02:00
|
|
|
import React from 'react';
|
2017-07-21 01:38:24 +02:00
|
|
|
import PropTypes from 'prop-types';
|
2016-09-13 02:24:40 +02:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
2018-06-13 14:44:50 +02:00
|
|
|
import ActionBar from './action_bar';
|
2016-12-02 15:05:50 +01:00
|
|
|
import Avatar from '../../../components/avatar';
|
|
|
|
import Permalink from '../../../components/permalink';
|
2018-06-13 14:44:50 +02:00
|
|
|
import IconButton from '../../../components/icon_button';
|
2016-11-16 17:20:52 +01:00
|
|
|
import { FormattedMessage } from 'react-intl';
|
2017-05-03 02:04:16 +02:00
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
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 = {
|
2019-12-18 16:16:08 +01:00
|
|
|
account : ImmutablePropTypes.map.isRequired,
|
2019-08-26 18:24:10 +02:00
|
|
|
onLogout: PropTypes.func.isRequired,
|
2019-12-18 16:16:08 +01:00
|
|
|
onClose : PropTypes.func,
|
2017-05-12 14:44:10 +02:00
|
|
|
};
|
|
|
|
|
2019-12-18 16:16:08 +01:00
|
|
|
render() {
|
2016-09-13 02:24:40 +02:00
|
|
|
return (
|
2017-02-09 01:20:09 +01:00
|
|
|
<div className='navigation-bar'>
|
2019-12-18 16:16:08 +01:00
|
|
|
<Permalink
|
|
|
|
href={this.props.account.get('url')}
|
|
|
|
to={`/accounts/${this.props.account.get('id')}`}
|
|
|
|
>
|
|
|
|
<span style={{ display: 'none' }}>{this.props.account.get('acct')}</span >
|
|
|
|
<Avatar
|
|
|
|
account={this.props.account}
|
|
|
|
size={48}
|
|
|
|
/>
|
|
|
|
</Permalink >
|
2016-09-13 02:24:40 +02:00
|
|
|
|
2017-04-23 04:26:55 +02:00
|
|
|
<div className='navigation-bar__profile'>
|
2019-12-18 16:16:08 +01: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-03 02:04:16 +02:00
|
|
|
|
2019-12-18 16:16:08 +01:00
|
|
|
<a
|
|
|
|
href='/settings/profile'
|
|
|
|
className='navigation-bar__profile-edit'
|
|
|
|
>
|
2020-02-27 13:48:21 +01:00
|
|
|
<i className='fa fa-pencil' />
|
2019-12-18 16:16:08 +01:00
|
|
|
<FormattedMessage
|
|
|
|
id='navigation_bar.edit_profile'
|
|
|
|
defaultMessage='Edit profile'
|
|
|
|
/></a >
|
|
|
|
</div >
|
2017-07-21 01:38:24 +02:00
|
|
|
|
2018-06-14 08:03:07 +02:00
|
|
|
<div className='navigation-bar__actions'>
|
2019-12-18 16:16:08 +01:00
|
|
|
<IconButton
|
|
|
|
className='close'
|
|
|
|
title=''
|
|
|
|
icon='close'
|
|
|
|
onClick={this.props.onClose}
|
|
|
|
/>
|
|
|
|
<ActionBar
|
|
|
|
account={this.props.account}
|
|
|
|
onLogout={this.props.onLogout}
|
|
|
|
/>
|
|
|
|
</div >
|
|
|
|
</div >
|
2016-09-13 02:24:40 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-04-21 20:05:35 +02:00
|
|
|
}
|