2020-08-17 21:07:16 +01:00
|
|
|
import React from 'react'
|
2020-08-17 21:59:29 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2020-07-10 21:22:13 +01:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes'
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component'
|
|
|
|
import { injectIntl, defineMessages } from 'react-intl'
|
2020-09-02 00:13:11 +01:00
|
|
|
import { me } from '../../initial_state'
|
|
|
|
import SidebarSectionTitle from '../sidebar_section_title'
|
|
|
|
import SidebarSectionItem from '../sidebar_section_item'
|
|
|
|
import Heading from '../heading'
|
|
|
|
import BackButton from '../back_button'
|
|
|
|
import ResponsiveClassesComponent from '../../features/ui/util/responsive_classes_component'
|
2020-07-10 21:22:13 +01:00
|
|
|
|
|
|
|
class AboutSidebar extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
intl,
|
|
|
|
title,
|
|
|
|
items,
|
|
|
|
} = this.props
|
|
|
|
|
|
|
|
return (
|
2020-08-18 21:49:11 +01:00
|
|
|
<header role='banner' className={[_s.d, _s.flexGrow1, _s.z3, _s.aiEnd].join(' ')}>
|
2020-07-10 21:22:13 +01:00
|
|
|
<ResponsiveClassesComponent
|
2020-08-18 21:49:11 +01:00
|
|
|
classNames={[_s.d, _s.w240PX].join(' ')}
|
|
|
|
classNamesXS={[_s.d, _s.w100PC].join(' ')}
|
2020-07-10 21:22:13 +01:00
|
|
|
>
|
|
|
|
<ResponsiveClassesComponent
|
2020-08-18 21:49:11 +01:00
|
|
|
classNames={[_s.d, _s.posFixed, _s.calcH53PX, _s.bottom0].join(' ')}
|
|
|
|
classNamesXS={[_s.d, _s.px15].join(' ')}
|
2020-07-10 21:22:13 +01:00
|
|
|
>
|
|
|
|
<ResponsiveClassesComponent
|
2020-08-18 21:49:11 +01:00
|
|
|
classNames={[_s.d, _s.h100PC, _s.aiStart, _s.w240PX, _s.pr15, _s.py10, _s.noScrollbar, _s.overflowYScroll].join(' ')}
|
|
|
|
classNamesXS={[_s.d, _s.aiStart, _s.w100PC, _s.py10, _s.borderBottom1PX, _s.borderColorSecondary].join(' ')}
|
2020-07-10 21:22:13 +01:00
|
|
|
>
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.w100PC].join(' ')}>
|
|
|
|
<div className={[_s.d, _s.flexRow, _s.px5, _s.pt10].join(' ')}>
|
2020-07-10 21:22:13 +01:00
|
|
|
{
|
|
|
|
me && <BackButton icon='arrow-left' toHome />
|
|
|
|
}
|
|
|
|
<Heading size='h1'>
|
|
|
|
{title}
|
|
|
|
</Heading>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2020-08-18 21:49:11 +01:00
|
|
|
<nav aria-label='Primary' role='navigation' className={[_s.d, _s.w100PC, _s.mb15].join(' ')}>
|
2020-07-10 21:22:13 +01:00
|
|
|
<SidebarSectionTitle>{intl.formatMessage(messages.menu)}</SidebarSectionTitle>
|
|
|
|
{
|
|
|
|
items.map((menuItem, i) => (
|
|
|
|
<SidebarSectionItem {...menuItem} key={`about-sidebar-item-menu-${i}`} />
|
|
|
|
))
|
|
|
|
}
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
</ResponsiveClassesComponent>
|
|
|
|
</ResponsiveClassesComponent>
|
|
|
|
</ResponsiveClassesComponent>
|
|
|
|
</header>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2020-08-17 23:06:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },
|
|
|
|
mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },
|
|
|
|
preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },
|
|
|
|
menu: { id: 'menu', defaultMessage: 'Menu' },
|
|
|
|
})
|
|
|
|
|
|
|
|
AboutSidebar.propTypes = {
|
|
|
|
intl: PropTypes.object.isRequired,
|
|
|
|
account: ImmutablePropTypes.map,
|
|
|
|
title: PropTypes.string,
|
|
|
|
items: PropTypes.array.isRequired,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default injectIntl(AboutSidebar)
|