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-02-28 15:20:47 +00:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes'
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component'
|
|
|
|
import Sticky from 'react-stickynode'
|
2020-05-09 03:17:19 +01:00
|
|
|
import { BREAKPOINT_EXTRA_SMALL } from '../constants'
|
2020-04-11 23:29:19 +01:00
|
|
|
import Layout from './layout'
|
|
|
|
import GroupHeader from '../components/group_header'
|
2020-07-16 05:05:08 +01:00
|
|
|
import SidebarPanelGroup from '../components/sidebar_panel_group'
|
2020-08-12 23:52:46 +01:00
|
|
|
import Responsive from '../features/ui/util/responsive_component'
|
|
|
|
import WrappedBundle from '../features/ui/util/wrapped_bundle'
|
|
|
|
import {
|
|
|
|
LinkFooter,
|
|
|
|
SignUpPanel,
|
2020-08-13 00:39:50 +01:00
|
|
|
GroupsPanel,
|
2020-08-12 23:52:46 +01:00
|
|
|
GroupInfoPanel,
|
|
|
|
} from '../features/ui/util/async_components'
|
2020-02-28 15:20:47 +00:00
|
|
|
|
2020-08-14 18:45:59 +01:00
|
|
|
class GroupLayout extends ImmutablePureComponent {
|
2020-02-28 15:20:47 +00:00
|
|
|
|
|
|
|
render() {
|
2020-04-11 23:29:19 +01:00
|
|
|
const {
|
|
|
|
children,
|
2020-05-03 06:22:49 +01:00
|
|
|
group,
|
2020-07-16 05:05:08 +01:00
|
|
|
groupId,
|
2020-04-11 23:29:19 +01:00
|
|
|
relationships,
|
2020-05-03 06:22:49 +01:00
|
|
|
title,
|
2020-04-11 23:29:19 +01:00
|
|
|
} = this.props
|
2020-02-29 15:42:47 +00:00
|
|
|
|
2020-02-28 15:20:47 +00:00
|
|
|
return (
|
2020-04-11 23:29:19 +01:00
|
|
|
<Layout
|
|
|
|
noRightSidebar
|
2020-08-14 18:45:59 +01:00
|
|
|
showBackBtn
|
2020-05-03 06:22:49 +01:00
|
|
|
title={title}
|
2020-07-16 05:05:08 +01:00
|
|
|
page='group'
|
2020-04-11 23:29:19 +01:00
|
|
|
>
|
2020-05-09 03:17:19 +01:00
|
|
|
<Responsive max={BREAKPOINT_EXTRA_SMALL}>
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.w100PC].join(' ')}>
|
2020-04-11 23:29:19 +01:00
|
|
|
|
2020-08-06 05:57:42 +01:00
|
|
|
<GroupHeader group={group} relationships={relationships} isXS>
|
2020-08-13 00:39:50 +01:00
|
|
|
<WrappedBundle component={GroupInfoPanel} componentParams={{ group, noPanel: true }} />
|
2020-05-09 03:17:19 +01:00
|
|
|
</GroupHeader>
|
2020-04-11 23:29:19 +01:00
|
|
|
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.w100PC, _s.z1].join(' ')}>
|
2020-05-09 03:17:19 +01:00
|
|
|
{children}
|
2020-02-28 15:20:47 +00:00
|
|
|
</div>
|
|
|
|
|
2020-05-09 03:17:19 +01:00
|
|
|
</div>
|
|
|
|
</Responsive>
|
|
|
|
|
|
|
|
<Responsive min={BREAKPOINT_EXTRA_SMALL}>
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.w100PC, _s.pl15].join(' ')}>
|
2020-05-09 03:17:19 +01:00
|
|
|
|
|
|
|
<GroupHeader group={group} relationships={relationships} />
|
|
|
|
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.flexRow, _s.w100PC, _s.jcEnd].join(' ')}>
|
|
|
|
<div className={[_s.d, _s.w645PX, _s.z1].join(' ')}>
|
|
|
|
<div className={_s.d}>
|
2020-05-09 03:17:19 +01:00
|
|
|
{children}
|
2020-02-29 15:42:47 +00:00
|
|
|
</div>
|
2020-05-09 03:17:19 +01:00
|
|
|
</div>
|
|
|
|
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.ml15, _s.w340PX].join(' ')}>
|
2020-05-09 03:17:19 +01:00
|
|
|
<Sticky top={73} enabled>
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.w340PX].join(' ')}>
|
2020-07-16 05:05:08 +01:00
|
|
|
<SidebarPanelGroup
|
|
|
|
page={`group.${groupId}`}
|
|
|
|
layout={[
|
2020-08-12 23:52:46 +01:00
|
|
|
<WrappedBundle component={GroupInfoPanel} componentParams={{ group }} />,
|
|
|
|
SignUpPanel,
|
2020-08-13 00:39:50 +01:00
|
|
|
GroupsPanel,
|
2020-08-12 23:52:46 +01:00
|
|
|
LinkFooter,
|
2020-07-16 05:05:08 +01:00
|
|
|
]}
|
|
|
|
/>
|
2020-05-09 03:17:19 +01:00
|
|
|
</div>
|
|
|
|
</Sticky>
|
|
|
|
</div>
|
2020-02-28 15:20:47 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2020-05-09 03:17:19 +01:00
|
|
|
</Responsive>
|
2020-04-11 23:29:19 +01:00
|
|
|
</Layout>
|
2020-02-28 15:20:47 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-08-14 18:45:59 +01:00
|
|
|
|
|
|
|
GroupLayout.propTypes = {
|
|
|
|
children: PropTypes.node,
|
|
|
|
group: ImmutablePropTypes.map,
|
|
|
|
groupId: PropTypes.string,
|
|
|
|
relationships: ImmutablePropTypes.map,
|
|
|
|
title: PropTypes.string,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default GroupLayout
|