135 lines
5.0 KiB
JavaScript
Raw Normal View History

2020-02-28 10:20:47 -05:00
import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
2020-02-24 16:56:07 -05:00
import Sticky from 'react-stickynode'
import Sidebar from '../components/sidebar'
import Image from '../components/image'
2020-02-28 10:20:47 -05:00
import Text from '../components/text'
import Button from '../components/button'
import DisplayName from '../components/display_name'
import TabBar from '../components/tab_bar'
2020-02-24 16:56:07 -05:00
2020-02-28 10:20:47 -05:00
export default class ProfileLayout extends ImmutablePureComponent {
2020-02-24 16:56:07 -05:00
static propTypes = {
2020-02-28 10:20:47 -05:00
account: ImmutablePropTypes.map,
2020-02-24 16:56:07 -05:00
layout: PropTypes.object,
title: PropTypes.string,
showBackBtn: PropTypes.bool,
}
render() {
2020-02-28 10:20:47 -05:00
const { account, children, layout } = this.props
const tabs = !account ? null : [
{
to: `/${account.get('acct')}`,
title: 'Timeline',
},
{
to: `/${account.get('acct')}/comments`,
title: 'Comments',
},
{
2020-03-04 17:26:01 -05:00
to: `/${account.get('acct')}/media`,
title: 'Media',
2020-02-28 10:20:47 -05:00
},
{
to: '',
title: 'More',
},
]
2020-02-24 16:56:07 -05:00
return (
2020-03-03 22:45:16 -05:00
<div className={[_s.default, _s.flexRow, _s.width100PC, _s.heightMin100VH, _s.backgroundColorSecondary3].join(' ')}>
2020-02-24 16:56:07 -05:00
<Sidebar />
<main role='main' className={[_s.default, _s.flexShrink1, _s.flexGrow1, _s.borderColorSecondary2, _s.borderLeft1PX].join(' ')}>
2020-03-11 19:56:18 -04:00
<div className={[_s.default, _s.width1015PX, _s.flexRow, _s.justifyContentSpaceBetween, _s.pl15, _s.py15].join(' ')}>
2020-02-24 16:56:07 -05:00
<div className={[_s.default, _s.z1, _s.width100PC].join(' ')}>
2020-02-28 10:20:47 -05:00
<div className={[_s.default, _s.height350PX, _s.width100PC, _s.radiusSmall, _s.overflowHidden].join(' ')}>
<Image className={_s.height350PX} src={account.get('header')} />
2020-02-24 16:56:07 -05:00
</div>
2020-02-28 10:20:47 -05:00
<div className={[_s.default, _s.borderBottom1PX, _s.borderColorSecondary, _s.width100PC].join(' ')}>
2020-03-11 19:56:18 -04:00
<div className={[_s.default, _s.flexRow, _s.px15].join(' ')}>
2020-02-28 10:20:47 -05:00
<Image
className={[_s.circle, _s.marginTopNeg75PX, _s.borderColorWhite, _s.border2PX].join(' ')}
height='150px'
width='150px'
src={account.get('avatar')}
2020-02-28 10:20:47 -05:00
/>
2020-03-11 19:56:18 -04:00
<div className={[_s.default, _s.px15, _s.py10].join(' ')}>
2020-02-28 10:20:47 -05:00
<DisplayName account={account} multiline large />
</div>
</div>
2020-03-11 19:56:18 -04:00
<div className={[_s.default, _s.flexRow, _s.borderBottom1PX, _s.borderColorSecondary, _s.mt5, _s.height53PX].join(' ')}>
2020-02-28 10:20:47 -05:00
<div className={[_s.default].join(' ')}>
<TabBar tabs={tabs} large />
</div>
2020-03-11 19:56:18 -04:00
<div className={[_s.default, _s.flexRow, _s.marginLeftAuto, _s.py5].join(' ')}>
2020-02-28 10:20:47 -05:00
<Button
outline
icon='ellipsis'
iconWidth='18px'
iconHeight='18px'
iconClassName={_s.fillColorBrand}
color='brand'
backgroundColor='none'
2020-03-11 19:56:18 -04:00
className={[_s.justifyContentCenter, _s.alignItemsCenter, _s.mr10, _s.px10].join(' ')}
2020-02-28 10:20:47 -05:00
/>
<Button
outline
icon='chat'
iconWidth='18px'
iconHeight='18px'
iconClassName={_s.fillColorBrand}
color='brand'
backgroundColor='none'
2020-03-11 19:56:18 -04:00
className={[_s.justifyContentCenter, _s.alignItemsCenter, _s.mr10, _s.px10].join(' ')}
2020-02-28 10:20:47 -05:00
/>
<Button
className={[_s.justifyContentCenter, _s.alignItemsCenter].join(' ')}
>
2020-03-11 19:56:18 -04:00
<span className={[_s.px15].join(' ')}>
2020-02-28 10:20:47 -05:00
<Text
color='white'
weight='bold'
size='medium'
2020-03-11 19:56:18 -04:00
className={[_s.px15].join(' ')}
2020-02-28 10:20:47 -05:00
>
Follow
</Text>
</span>
</Button>
</div>
</div>
2020-02-24 16:56:07 -05:00
</div>
2020-03-11 19:56:18 -04:00
<div className={[_s.default, _s.width1015PX, _s.flexRow, _s.justifyContentSpaceBetween, _s.pr15, _s.py15].join(' ')}>
2020-02-24 16:56:07 -05: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 10:20:47 -05:00
<Sticky top={15} enabled>
2020-02-24 16:56:07 -05:00
<div className={[_s.default, _s.width340PX].join(' ')}>
{layout}
</div>
</Sticky>
</div>
</div>
</div>
</div>
</main>
</div>
)
}
}