gab-social/app/javascript/gabsocial/layouts/group_layout.js

97 lines
3.1 KiB
JavaScript
Raw Normal View History

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'
2020-05-09 03:17:19 +01:00
import GroupInfoPanel from '../components/panel/group_info_panel'
import GroupSidebarPanel from '../components/panel/groups_panel'
import SignupPanel from '../components/panel/sign_up_panel'
2020-05-09 03:17:19 +01:00
import LinkFooter from '../components/link_footer'
2020-04-11 23:29:19 +01:00
import GroupHeader from '../components/group_header'
import SidebarPanelGroup from '../components/sidebar_panel_group'
2020-05-09 03:17:19 +01:00
import Responsive from '../features/ui/util/responsive_component';
2020-02-28 15:20:47 +00:00
export default class GroupLayout extends ImmutablePureComponent {
2020-05-03 06:22:49 +01:00
2020-02-28 15:20:47 +00:00
static propTypes = {
actions: PropTypes.array,
2020-05-03 06:22:49 +01:00
children: PropTypes.node,
2020-02-28 15:20:47 +00:00
group: ImmutablePropTypes.map,
groupId: PropTypes.string,
isTimeline: PropTypes.bool,
2020-02-28 15:20:47 +00:00
layout: PropTypes.object,
2020-05-03 06:22:49 +01:00
relationships: ImmutablePropTypes.map,
2020-02-28 15:20:47 +00:00
showBackBtn: PropTypes.bool,
2020-05-03 06:22:49 +01:00
title: PropTypes.string,
2020-02-28 15:20:47 +00:00
}
render() {
2020-04-11 23:29:19 +01:00
const {
2020-05-03 06:22:49 +01:00
actions,
2020-04-11 23:29:19 +01:00
children,
2020-05-03 06:22:49 +01:00
group,
groupId,
isTimeline,
2020-04-11 23:29:19 +01:00
relationships,
2020-05-03 06:22:49 +01:00
showBackBtn,
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
actions={actions}
showBackBtn={showBackBtn}
2020-05-03 06:22:49 +01:00
title={title}
page='group'
2020-04-11 23:29:19 +01:00
>
2020-05-09 03:17:19 +01:00
<Responsive max={BREAKPOINT_EXTRA_SMALL}>
<div className={[_s.default, _s.width100PC].join(' ')}>
2020-04-11 23:29:19 +01:00
<GroupHeader group={group} relationships={relationships} isXS>
2020-05-09 03:17:19 +01:00
<GroupInfoPanel group={group} noPanel />
</GroupHeader>
2020-04-11 23:29:19 +01:00
2020-05-09 03:17:19 +01:00
<div className={[_s.default, _s.width100PC, _s.z1].join(' ')}>
{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}>
<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 15:42:47 +00:00
</div>
2020-05-09 03:17:19 +01: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={[
<GroupInfoPanel group={group} key='group-page-info-panel' />,
<SignupPanel key='group-page-signup-panel' />,
<GroupSidebarPanel isSlim key='group-page-group-panel' />,
<LinkFooter key='group-page-link-footer' />,
]}
/>
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
)
}
}