100 lines
2.9 KiB
JavaScript
Raw Normal View History

2020-02-28 10:20:47 -05:00
import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import Sticky from 'react-stickynode'
2020-05-08 22:17:19 -04:00
import { BREAKPOINT_EXTRA_SMALL } from '../constants'
2020-04-11 18:29:19 -04:00
import Layout from './layout'
import GroupHeader from '../components/group_header'
import SidebarPanelGroup from '../components/sidebar_panel_group'
import Responsive from '../features/ui/util/responsive_component'
import WrappedBundle from '../features/ui/util/wrapped_bundle'
import {
LinkFooter,
SignUpPanel,
GroupSidebarPanel,
GroupInfoPanel,
} from '../features/ui/util/async_components'
2020-02-28 10:20:47 -05:00
export default class GroupLayout extends ImmutablePureComponent {
2020-05-03 01:22:49 -04:00
2020-02-28 10:20:47 -05:00
static propTypes = {
actions: PropTypes.array,
2020-05-03 01:22:49 -04:00
children: PropTypes.node,
2020-02-28 10:20:47 -05:00
group: ImmutablePropTypes.map,
groupId: PropTypes.string,
isTimeline: PropTypes.bool,
2020-02-28 10:20:47 -05:00
layout: PropTypes.object,
2020-05-03 01:22:49 -04:00
relationships: ImmutablePropTypes.map,
2020-02-28 10:20:47 -05:00
showBackBtn: PropTypes.bool,
2020-05-03 01:22:49 -04:00
title: PropTypes.string,
2020-02-28 10:20:47 -05:00
}
render() {
2020-04-11 18:29:19 -04:00
const {
2020-05-03 01:22:49 -04:00
actions,
2020-04-11 18:29:19 -04:00
children,
2020-05-03 01:22:49 -04:00
group,
groupId,
isTimeline,
2020-04-11 18:29:19 -04:00
relationships,
2020-05-03 01:22:49 -04:00
showBackBtn,
title,
2020-04-11 18:29:19 -04:00
} = this.props
2020-02-29 10:42:47 -05:00
2020-02-28 10:20:47 -05:00
return (
2020-04-11 18:29:19 -04:00
<Layout
noRightSidebar
actions={actions}
showBackBtn={showBackBtn}
2020-05-03 01:22:49 -04:00
title={title}
page='group'
2020-04-11 18:29:19 -04:00
>
2020-05-08 22:17:19 -04:00
<Responsive max={BREAKPOINT_EXTRA_SMALL}>
<div className={[_s.default, _s.width100PC].join(' ')}>
2020-04-11 18:29:19 -04:00
<GroupHeader group={group} relationships={relationships} isXS>
2020-05-08 22:17:19 -04:00
<GroupInfoPanel group={group} noPanel />
</GroupHeader>
2020-04-11 18:29:19 -04:00
2020-05-08 22:17:19 -04:00
<div className={[_s.default, _s.width100PC, _s.z1].join(' ')}>
{children}
2020-02-28 10:20:47 -05:00
</div>
2020-05-08 22:17:19 -04:00
</div>
</Responsive>
<Responsive min={BREAKPOINT_EXTRA_SMALL}>
<div className={[_s.default, _s.width100PC, _s.pl15].join(' ')}>
<GroupHeader group={group} relationships={relationships} />
<div className={[_s.default, _s.flexRow, _s.width100PC, _s.justifyContentEnd].join(' ')}>
<div className={[_s.default, _s.width645PX, _s.z1].join(' ')}>
<div className={_s.default}>
{children}
2020-02-29 10:42:47 -05:00
</div>
2020-05-08 22:17:19 -04:00
</div>
<div className={[_s.default, _s.ml15, _s.width340PX].join(' ')}>
<Sticky top={73} enabled>
<div className={[_s.default, _s.width340PX].join(' ')}>
<SidebarPanelGroup
page={`group.${groupId}`}
layout={[
<WrappedBundle component={GroupInfoPanel} componentParams={{ group }} />,
SignUpPanel,
GroupSidebarPanel,
LinkFooter,
]}
/>
2020-05-08 22:17:19 -04:00
</div>
</Sticky>
</div>
2020-02-28 10:20:47 -05:00
</div>
</div>
2020-05-08 22:17:19 -04:00
</Responsive>
2020-04-11 18:29:19 -04:00
</Layout>
2020-02-28 10:20:47 -05:00
)
}
}