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

65 lines
2.1 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'
2020-02-24 21:56:07 +00:00
import Sticky from 'react-stickynode'
2020-03-14 17:31:29 +00:00
import classNames from 'classnames/bind'
2020-02-24 21:56:07 +00:00
import Sidebar from '../components/sidebar'
2020-03-14 17:31:29 +00:00
import Avatar from '../components/avatar'
2020-02-24 21:56:07 +00:00
import Image from '../components/image'
2020-02-28 15:20:47 +00:00
import Text from '../components/text'
import Button from '../components/button'
import DisplayName from '../components/display_name'
import TabBar from '../components/tab_bar'
2020-03-14 17:31:29 +00:00
import ProfileHeader from '../components/profile_header'
const cx = classNames.bind(_s)
2020-02-24 21:56:07 +00:00
2020-02-28 15:20:47 +00:00
export default class ProfileLayout extends ImmutablePureComponent {
2020-02-24 21:56:07 +00:00
static propTypes = {
2020-02-28 15:20:47 +00:00
account: ImmutablePropTypes.map,
2020-02-24 21:56:07 +00:00
layout: PropTypes.object,
title: PropTypes.string,
showBackBtn: PropTypes.bool,
}
render() {
2020-02-28 15:20:47 +00:00
const { account, children, layout } = this.props
2020-02-24 21:56:07 +00:00
return (
2020-03-04 03:45:16 +00:00
<div className={[_s.default, _s.flexRow, _s.width100PC, _s.heightMin100VH, _s.backgroundColorSecondary3].join(' ')}>
2020-02-24 21:56:07 +00:00
<Sidebar />
<main role='main' className={[_s.default, _s.flexShrink1, _s.flexGrow1, _s.borderColorSecondary2, _s.borderLeft1PX].join(' ')}>
2020-03-11 23:56:18 +00:00
<div className={[_s.default, _s.width1015PX, _s.flexRow, _s.justifyContentSpaceBetween, _s.pl15, _s.py15].join(' ')}>
2020-02-24 21:56:07 +00:00
<div className={[_s.default, _s.z1, _s.width100PC].join(' ')}>
2020-03-14 17:31:29 +00:00
<ProfileHeader account={account} />
2020-02-24 21:56:07 +00:00
2020-03-11 23:56:18 +00:00
<div className={[_s.default, _s.width1015PX, _s.flexRow, _s.justifyContentSpaceBetween, _s.pr15, _s.py15].join(' ')}>
2020-02-24 21:56:07 +00:00
<div className={[_s.default, _s.width645PX, _s.z1].join(' ')}>
<div className={_s.default}>
{children}
</div>
</div>
<div className={[_s.default, _s.width340PX].join(' ')}>
2020-02-28 15:20:47 +00:00
<Sticky top={15} enabled>
2020-02-24 21:56:07 +00:00
<div className={[_s.default, _s.width340PX].join(' ')}>
{layout}
</div>
</Sticky>
</div>
</div>
2020-03-14 17:31:29 +00:00
2020-02-24 21:56:07 +00:00
</div>
</div>
</main>
</div>
)
}
}