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-06-10 17:08:31 +01:00
|
|
|
import {
|
|
|
|
CX,
|
|
|
|
BREAKPOINT_EXTRA_SMALL,
|
|
|
|
} from '../constants'
|
|
|
|
import { me } from '../initial_state'
|
|
|
|
import NavigationBar from '../components/navigation_bar'
|
|
|
|
import FooterBar from '../components/footer_bar'
|
|
|
|
import Responsive from '../features/ui/util/responsive_component'
|
|
|
|
import ResponsiveClassesComponent from '../features/ui/util/responsive_classes_component'
|
|
|
|
import SettingsSidebar from '../components/settings_sidebar'
|
2020-08-12 23:52:46 +01:00
|
|
|
import WrappedBundle from '../features/ui/util/wrapped_bundle'
|
|
|
|
import {
|
|
|
|
SidebarXS,
|
|
|
|
} from '../features/ui/util/async_components'
|
2020-03-24 04:39:12 +00:00
|
|
|
|
2020-08-17 23:06:22 +01:00
|
|
|
class SettingsLayout extends React.PureComponent {
|
2020-03-24 04:39:12 +00:00
|
|
|
|
|
|
|
render() {
|
2020-06-10 17:08:31 +01:00
|
|
|
const { children, title } = this.props
|
|
|
|
|
|
|
|
const mainBlockClasses = CX({
|
|
|
|
default: 1,
|
|
|
|
width1015PX: 1,
|
|
|
|
flexRow: 1,
|
|
|
|
justifyContentEnd: 1,
|
|
|
|
py15: 1,
|
|
|
|
mlAuto: !me,
|
|
|
|
mrAuto: !me,
|
|
|
|
})
|
2020-03-24 04:39:12 +00:00
|
|
|
|
|
|
|
return (
|
2020-06-10 17:08:31 +01:00
|
|
|
<div className={[_s.default, _s.width100PC, _s.heightMin100VH, _s.bgTertiary].join(' ')}>
|
|
|
|
|
|
|
|
<Responsive max={BREAKPOINT_EXTRA_SMALL}>
|
2020-08-12 23:52:46 +01:00
|
|
|
<WrappedBundle component={SidebarXS} />
|
2020-06-10 17:08:31 +01:00
|
|
|
</Responsive>
|
|
|
|
|
|
|
|
<NavigationBar
|
|
|
|
title={title}
|
|
|
|
noSearch
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div className={[_s.default, _s.flexRow, _s.width100PC].join(' ')}>
|
|
|
|
|
|
|
|
<Responsive min={BREAKPOINT_EXTRA_SMALL}>
|
|
|
|
<SettingsSidebar title='Settings' />
|
|
|
|
</Responsive>
|
2020-03-24 04:39:12 +00:00
|
|
|
|
2020-06-10 17:08:31 +01:00
|
|
|
<ResponsiveClassesComponent
|
|
|
|
classNames={[_s.default, _s.flexShrink1, _s.flexGrow1].join(' ')}
|
|
|
|
classNamesSmall={[_s.default, _s.flexShrink1, _s.flexGrow1].join(' ')}
|
|
|
|
classNamesXS={[_s.default, _s.width100PC].join(' ')}
|
|
|
|
>
|
|
|
|
<main role='main'>
|
2020-03-24 04:39:12 +00:00
|
|
|
|
2020-06-10 17:08:31 +01:00
|
|
|
<ResponsiveClassesComponent
|
|
|
|
classNames={mainBlockClasses}
|
|
|
|
classNamesXS={[_s.default, _s.width1015PX, _s.justifyContentEnd, _s.pb15].join(' ')}
|
|
|
|
>
|
2020-03-24 04:39:12 +00:00
|
|
|
|
2020-06-10 17:08:31 +01:00
|
|
|
<div className={[_s.default, _s.width1015PX, _s.z1].join(' ')}>
|
2020-03-24 04:39:12 +00:00
|
|
|
|
2020-06-10 17:08:31 +01:00
|
|
|
<div className={_s.default}>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-03-24 04:39:12 +00:00
|
|
|
|
2020-06-10 17:08:31 +01:00
|
|
|
</ResponsiveClassesComponent>
|
2020-03-24 04:39:12 +00:00
|
|
|
|
2020-06-10 17:08:31 +01:00
|
|
|
</main>
|
|
|
|
</ResponsiveClassesComponent>
|
|
|
|
</div>
|
2020-03-24 04:39:12 +00:00
|
|
|
|
2020-06-10 17:08:31 +01:00
|
|
|
<Responsive max={BREAKPOINT_EXTRA_SMALL}>
|
|
|
|
<FooterBar />
|
|
|
|
</Responsive>
|
2020-03-24 04:39:12 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-08-17 23:06:22 +01:00
|
|
|
|
|
|
|
SettingsLayout.propTypes = {
|
|
|
|
title: PropTypes.string,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SettingsLayout
|