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

63 lines
1.6 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-04-11 23:29:19 +01:00
import Layout from './layout'
import GroupHeader from '../components/group_header'
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-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-04-30 05:34:50 +01:00
<div className={[_s.default, _s.width100PC, _s.pl15].join(' ')}>
2020-04-11 23:29:19 +01:00
<GroupHeader group={group} relationships={relationships} />
2020-04-30 05:34:50 +01:00
<div className={[_s.default, _s.flexRow, _s.width100PC, _s.justifyContentEnd].join(' ')}>
2020-04-11 23:29:19 +01:00
<div className={[_s.default, _s.width645PX, _s.z1].join(' ')}>
<div className={_s.default}>
{children}
2020-02-28 15:20:47 +00:00
</div>
</div>
2020-04-30 05:34:50 +01:00
<div className={[_s.default, _s.ml15, _s.width340PX].join(' ')}>
2020-04-11 23:29:19 +01:00
<Sticky top={73} enabled>
<div className={[_s.default, _s.width340PX].join(' ')}>
{layout}
2020-02-29 15:42:47 +00:00
</div>
2020-04-11 23:29:19 +01:00
</Sticky>
2020-02-28 15:20:47 +00:00
</div>
</div>
2020-04-11 23:29:19 +01:00
</div>
</Layout>
2020-02-28 15:20:47 +00:00
)
}
}