bigbuffet-rw/app/soapbox/features/ui/components/columns_area.js

41 lines
978 B
JavaScript
Raw Normal View History

2020-03-27 13:59:38 -07:00
import PropTypes from 'prop-types';
import React from 'react';
2020-03-27 13:59:38 -07:00
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { injectIntl } from 'react-intl';
2020-03-27 13:59:38 -07:00
2022-03-21 11:09:01 -07:00
import { Layout } from '../../../components/ui';
2020-03-27 13:59:38 -07:00
export default @(component => injectIntl(component, { withRef: true }))
class ColumnsArea extends ImmutablePureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,
columns: ImmutablePropTypes.list.isRequired,
children: PropTypes.node,
layout: PropTypes.object,
};
render() {
2020-04-14 13:45:38 -07:00
const { children } = this.props;
const layout = this.props.layout || { LEFT: null, RIGHT: null };
2020-03-27 13:59:38 -07:00
return (
2022-03-21 11:09:01 -07:00
<Layout>
<Layout.Sidebar>
{layout.LEFT}
</Layout.Sidebar>
<Layout.Main>
{children}
</Layout.Main>
<Layout.Aside>
{layout.RIGHT}
</Layout.Aside>
</Layout>
2020-04-14 11:44:40 -07:00
);
2020-03-27 13:59:38 -07:00
}
2020-04-14 11:44:40 -07:00
2020-03-27 13:59:38 -07:00
}