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

88 lines
2.7 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 WhoToFollowPanel from '../components/panel/who_to_follow_panel'
import GroupSidebarPanel from '../components/panel/groups_panel'
import LinkFooter from '../components/link_footer'
2020-04-11 23:29:19 +01:00
import GroupHeader from '../components/group_header'
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,
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,
2020-04-11 23:29:19 +01:00
layout,
relationships,
2020-05-03 06:22:49 +01:00
showBackBtn,
title,
2020-05-09 03:17:19 +01:00
noComposeButton,
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}
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
2020-05-09 03:17:19 +01:00
<GroupHeader group={group} relationships={relationships}>
<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(' ')}>
<GroupInfoPanel group={group} />
<WhoToFollowPanel />
<GroupSidebarPanel isSlim />
<LinkFooter />
</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
)
}
}