2019-04-21 03:32:16 +09:00
|
|
|
import React from 'react';
|
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
|
import Avatar from 'flavours/glitch/components/avatar';
|
|
|
|
import Permalink from 'flavours/glitch/components/permalink';
|
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
|
|
|
import { profileLink } from 'flavours/glitch/util/backend_links';
|
|
|
|
|
|
|
|
export default class NavigationBar extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
account: ImmutablePropTypes.map.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
render () {
|
|
|
|
return (
|
|
|
|
<div className='drawer--account'>
|
2021-09-26 12:46:13 +09:00
|
|
|
<Permalink className='avatar' href={this.props.account.get('url')} to={`/@${this.props.account.get('acct')}`}>
|
2019-04-21 03:32:16 +09:00
|
|
|
<span style={{ display: 'none' }}>{this.props.account.get('acct')}</span>
|
2019-05-26 04:27:00 +09:00
|
|
|
<Avatar account={this.props.account} size={48} />
|
2019-04-21 03:32:16 +09:00
|
|
|
</Permalink>
|
|
|
|
|
2019-06-19 22:41:17 +09:00
|
|
|
<div className='navigation-bar__profile'>
|
2021-09-26 12:46:13 +09:00
|
|
|
<Permalink className='acct' href={this.props.account.get('url')} to={`/@${this.props.account.get('acct')}`}>
|
2019-06-19 22:41:17 +09:00
|
|
|
<strong>@{this.props.account.get('acct')}</strong>
|
|
|
|
</Permalink>
|
2019-04-21 03:32:16 +09:00
|
|
|
|
2019-06-19 22:41:17 +09:00
|
|
|
{ profileLink !== undefined && (
|
|
|
|
<a
|
|
|
|
className='edit'
|
|
|
|
href={ profileLink }
|
|
|
|
><FormattedMessage id='navigation_bar.edit_profile' defaultMessage='Edit profile' /></a>
|
|
|
|
)}
|
|
|
|
</div>
|
2019-04-21 03:32:16 +09:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
}
|