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-07-10 21:22:13 +01:00
|
|
|
import {
|
|
|
|
CX,
|
|
|
|
BREAKPOINT_EXTRA_SMALL,
|
|
|
|
} from '../constants'
|
|
|
|
import { me } from '../initial_state'
|
2020-09-02 00:13:11 +01:00
|
|
|
import DefaultNavigationBar from '../components/navigation_bar/default_navigation_bar'
|
|
|
|
import LoggedOutNavigationBar from '../components/navigation_bar/logged_out_navigation_bar'
|
2020-07-10 21:22:13 +01:00
|
|
|
import FooterBar from '../components/footer_bar'
|
|
|
|
import Responsive from '../features/ui/util/responsive_component'
|
|
|
|
import ResponsiveClassesComponent from '../features/ui/util/responsive_classes_component'
|
2020-08-12 23:52:46 +01:00
|
|
|
import WrappedBundle from '../features/ui/util/wrapped_bundle'
|
|
|
|
import {
|
|
|
|
AboutSidebar,
|
|
|
|
GlobalFooter,
|
|
|
|
SidebarXS,
|
|
|
|
} from '../features/ui/util/async_components'
|
2020-07-10 21:22:13 +01:00
|
|
|
|
2020-08-17 23:06:22 +01:00
|
|
|
class SettingsLayout extends React.PureComponent {
|
2020-07-10 21:22:13 +01:00
|
|
|
|
|
|
|
componentWillMount() {
|
|
|
|
this.menuItems = [
|
|
|
|
{
|
|
|
|
title: 'About',
|
|
|
|
to: '/about',
|
|
|
|
},
|
2020-09-12 00:02:07 +01:00
|
|
|
{
|
|
|
|
title: 'Assets',
|
|
|
|
to: '/about/assets',
|
|
|
|
},
|
2020-07-10 21:22:13 +01:00
|
|
|
{
|
|
|
|
title: 'DMCA',
|
|
|
|
to: '/about/dmca',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Investors',
|
|
|
|
to: '/about/investors',
|
|
|
|
},
|
2020-09-12 00:02:07 +01:00
|
|
|
{
|
|
|
|
title: 'Press',
|
|
|
|
to: '/about/press',
|
|
|
|
},
|
2020-07-10 21:22:13 +01:00
|
|
|
{
|
|
|
|
title: 'Privacy Policy',
|
|
|
|
to: '/about/privacy',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Terms of Sale',
|
|
|
|
to: '/about/sales',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: 'Terms of Service',
|
|
|
|
to: '/about/tos',
|
|
|
|
},
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { children, title } = this.props
|
|
|
|
const { menuItems } = this
|
|
|
|
|
|
|
|
const mainBlockClasses = CX({
|
2020-08-18 21:49:11 +01:00
|
|
|
d: 1,
|
2020-08-18 21:43:06 +01:00
|
|
|
w1015PX: 1,
|
2020-07-10 21:22:13 +01:00
|
|
|
flexRow: 1,
|
2020-08-18 21:43:06 +01:00
|
|
|
jcEnd: 1,
|
2020-07-10 21:22:13 +01:00
|
|
|
py15: 1,
|
|
|
|
mlAuto: !me,
|
|
|
|
mrAuto: !me,
|
|
|
|
})
|
|
|
|
|
|
|
|
return (
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.w100PC, _s.minH100VH, _s.bgPrimary].join(' ')}>
|
2020-07-10 21:22:13 +01:00
|
|
|
|
|
|
|
<Responsive max={BREAKPOINT_EXTRA_SMALL}>
|
2020-08-12 23:52:46 +01:00
|
|
|
<WrappedBundle component={SidebarXS} />
|
2020-07-10 21:22:13 +01:00
|
|
|
</Responsive>
|
|
|
|
|
|
|
|
{
|
|
|
|
me &&
|
2020-09-02 00:13:11 +01:00
|
|
|
<DefaultNavigationBar title={title} noSearch />
|
2020-07-10 21:22:13 +01:00
|
|
|
}
|
|
|
|
{
|
|
|
|
!me &&
|
|
|
|
<LoggedOutNavigationBar />
|
|
|
|
}
|
|
|
|
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.flexRow, _s.w100PC].join(' ')}>
|
2020-07-10 21:22:13 +01:00
|
|
|
|
|
|
|
<Responsive min={BREAKPOINT_EXTRA_SMALL}>
|
2020-08-12 23:52:46 +01:00
|
|
|
<WrappedBundle component={AboutSidebar} componentParams={{ title, items: menuItems }} />
|
2020-07-10 21:22:13 +01:00
|
|
|
</Responsive>
|
|
|
|
|
|
|
|
<ResponsiveClassesComponent
|
2020-08-18 21:49:11 +01:00
|
|
|
classNames={[_s.d, _s.flexShrink1, _s.flexGrow1].join(' ')}
|
|
|
|
classNamesSmall={[_s.d, _s.flexShrink1, _s.flexGrow1].join(' ')}
|
|
|
|
classNamesXS={[_s.d, _s.w100PC].join(' ')}
|
2020-07-10 21:22:13 +01:00
|
|
|
>
|
|
|
|
<main role='main'>
|
|
|
|
|
|
|
|
<ResponsiveClassesComponent
|
|
|
|
classNames={mainBlockClasses}
|
2020-08-18 21:49:11 +01:00
|
|
|
classNamesXS={[_s.d, _s.w1015PX, _s.jcEnd, _s.pb15].join(' ')}
|
2020-07-10 21:22:13 +01:00
|
|
|
>
|
|
|
|
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.w1015PX, _s.z1].join(' ')}>
|
2020-07-10 21:22:13 +01:00
|
|
|
|
|
|
|
<Responsive max={BREAKPOINT_EXTRA_SMALL}>
|
2020-08-12 23:52:46 +01:00
|
|
|
<WrappedBundle component={AboutSidebar} componentParams={{ title, items: menuItems }} />
|
2020-07-10 21:22:13 +01:00
|
|
|
</Responsive>
|
|
|
|
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={_s.d}>
|
2020-07-10 21:22:13 +01:00
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</ResponsiveClassesComponent>
|
|
|
|
|
|
|
|
</main>
|
|
|
|
</ResponsiveClassesComponent>
|
|
|
|
</div>
|
|
|
|
|
2020-08-12 23:52:46 +01:00
|
|
|
<WrappedBundle component={GlobalFooter} />
|
2020-07-10 21:22:13 +01:00
|
|
|
|
|
|
|
<Responsive max={BREAKPOINT_EXTRA_SMALL}>
|
|
|
|
<FooterBar />
|
|
|
|
</Responsive>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-08-17 23:06:22 +01:00
|
|
|
|
|
|
|
SettingsLayout.propTypes = {
|
|
|
|
title: PropTypes.string,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SettingsLayout
|