2020-02-22 23:26:23 +00:00
|
|
|
import { Fragment } from 'react'
|
2020-02-08 06:12:01 +00:00
|
|
|
import { NavLink } from 'react-router-dom'
|
2020-02-05 22:45:48 +00:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes'
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component'
|
|
|
|
import { me } from '../initial_state'
|
|
|
|
import { makeGetAccount } from '../selectors'
|
2020-02-25 16:04:44 +00:00
|
|
|
import GabLogo from '../assets/gab_logo'
|
2020-02-22 23:26:23 +00:00
|
|
|
import SidebarSectionItem from './sidebar_section_item'
|
2020-03-27 23:08:19 +00:00
|
|
|
import Text from './text'
|
2019-08-15 04:04:03 +01:00
|
|
|
|
|
|
|
const mapStateToProps = state => {
|
2020-02-05 22:45:48 +00:00
|
|
|
const getAccount = makeGetAccount()
|
2019-08-15 04:04:03 +01:00
|
|
|
|
|
|
|
return {
|
|
|
|
account: getAccount(state, me),
|
2020-02-05 22:45:48 +00:00
|
|
|
}
|
|
|
|
}
|
2019-08-15 04:04:03 +01:00
|
|
|
|
2020-02-28 15:20:47 +00:00
|
|
|
export default
|
|
|
|
@connect(mapStateToProps)
|
2020-02-22 23:26:23 +00:00
|
|
|
class SidebarHeader extends ImmutablePureComponent {
|
2019-08-15 04:04:03 +01:00
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
account: ImmutablePropTypes.map,
|
2020-02-08 06:12:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2020-02-22 23:26:23 +00:00
|
|
|
const { account } = this.props
|
2020-02-08 06:12:01 +00:00
|
|
|
|
|
|
|
return (
|
2020-02-22 23:26:23 +00:00
|
|
|
<Fragment>
|
|
|
|
<h1 className={[_s.default].join(' ')}>
|
2020-03-27 23:08:19 +00:00
|
|
|
<NavLink to='/' aria-label='Gab' className={[_s.default, _s.flexRow, _s.noSelect, _s.noUnderline, _s.height50PX, _s.cursorPointer, _s.px10].join(' ')}>
|
2020-02-22 23:26:23 +00:00
|
|
|
<GabLogo />
|
2020-03-27 23:23:27 +00:00
|
|
|
<Text weight='bold' color='brand' size='extraSmall' className={[_s.pb5].join(' ')}>
|
2020-03-27 23:08:19 +00:00
|
|
|
BETA
|
|
|
|
</Text>
|
2020-02-22 23:26:23 +00:00
|
|
|
</NavLink>
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
{
|
|
|
|
(!!me && !!account) &&
|
|
|
|
<SidebarSectionItem
|
|
|
|
image={account.get('avatar')}
|
|
|
|
title={account.get('acct')}
|
|
|
|
to={`/${account.get('acct')}`}
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
</Fragment>
|
2020-02-08 06:12:01 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|