2022-12-01 19:06:08 +00:00
|
|
|
import PropTypes from 'prop-types';
|
2023-05-28 14:38:10 +00:00
|
|
|
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
|
2019-04-20 18:32:16 +00:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
2023-05-28 14:38:10 +00:00
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
|
|
|
2023-05-09 01:11:56 +00:00
|
|
|
import { Avatar } from 'flavours/glitch/components/avatar';
|
2019-04-20 18:32:16 +00:00
|
|
|
import Permalink from 'flavours/glitch/components/permalink';
|
2022-10-11 08:41:15 +00:00
|
|
|
import { profileLink } from 'flavours/glitch/utils/backend_links';
|
2019-04-20 18:32:16 +00:00
|
|
|
|
2023-05-28 14:38:10 +00:00
|
|
|
import ActionBar from './action_bar';
|
|
|
|
|
2019-04-20 18:32:16 +00:00
|
|
|
export default class NavigationBar extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
account: ImmutablePropTypes.map.isRequired,
|
2022-12-01 19:06:08 +00:00
|
|
|
onLogout: PropTypes.func.isRequired,
|
2019-04-20 18:32:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
render () {
|
|
|
|
return (
|
2022-12-01 19:06:08 +00:00
|
|
|
<div className='navigation-bar'>
|
2021-09-26 03:46:13 +00:00
|
|
|
<Permalink className='avatar' href={this.props.account.get('url')} to={`/@${this.props.account.get('acct')}`}>
|
2019-04-20 18:32:16 +00:00
|
|
|
<span style={{ display: 'none' }}>{this.props.account.get('acct')}</span>
|
2019-05-25 19:27:00 +00:00
|
|
|
<Avatar account={this.props.account} size={48} />
|
2019-04-20 18:32:16 +00:00
|
|
|
</Permalink>
|
|
|
|
|
2019-06-19 13:41:17 +00:00
|
|
|
<div className='navigation-bar__profile'>
|
2021-09-26 03:46:13 +00:00
|
|
|
<Permalink className='acct' href={this.props.account.get('url')} to={`/@${this.props.account.get('acct')}`}>
|
2019-06-19 13:41:17 +00:00
|
|
|
<strong>@{this.props.account.get('acct')}</strong>
|
|
|
|
</Permalink>
|
2019-04-20 18:32:16 +00:00
|
|
|
|
2019-06-19 13:41:17 +00:00
|
|
|
{ profileLink !== undefined && (
|
|
|
|
<a
|
|
|
|
className='edit'
|
2022-12-01 19:06:08 +00:00
|
|
|
href={profileLink}
|
2019-06-19 13:41:17 +00:00
|
|
|
><FormattedMessage id='navigation_bar.edit_profile' defaultMessage='Edit profile' /></a>
|
|
|
|
)}
|
|
|
|
</div>
|
2022-12-01 19:06:08 +00:00
|
|
|
|
|
|
|
<div className='navigation-bar__actions'>
|
|
|
|
<ActionBar account={this.props.account} onLogout={this.props.onLogout} />
|
|
|
|
</div>
|
2019-04-20 18:32:16 +00:00
|
|
|
</div>
|
|
|
|
);
|
2022-12-01 19:06:08 +00:00
|
|
|
}
|
|
|
|
|
2019-04-20 18:32:16 +00:00
|
|
|
}
|