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

91 lines
2.9 KiB
JavaScript
Raw Normal View History

2020-02-22 23:26:23 +00:00
import Sticky from 'react-stickynode'
2020-02-24 21:56:07 +00:00
import Search from '../components/search'
import ColumnHeader from '../components/column_header'
import Sidebar from '../components/sidebar'
2020-02-22 23:26:23 +00:00
export default class SearchLayout extends PureComponent {
static propTypes = {
actions: PropTypes.array,
layout: PropTypes.object,
showBackBtn: PropTypes.bool,
}
render() {
2020-03-14 17:31:29 +00:00
const { children, showBackBtn, layout, actions } = this.props
2020-02-22 23:26:23 +00:00
// const shouldHideFAB = path => path.match(/^\/posts\/|^\/search|^\/getting-started/);
// const floatingActionButton = shouldHideFAB(this.context.router.history.location.pathname) ? null : <button key='floating-action-button' onClick={this.handleOpenComposeModal} className='floating-action-button' aria-label={intl.formatMessage(messages.publish)}></button>;
2020-03-14 17:31:29 +00:00
const tabs = [
{
title: 'Top',
to: '/search'
},
{
title: 'People',
to: '/search/people'
},
{
title: 'Groups',
to: '/search/groups'
},
{
title: 'Gabs',
to: '/search/gabs'
},
{
title: 'Hashtags',
to: '/search/hashtags'
},
]
2020-02-22 23:26:23 +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-22 23:26:23 +00:00
<Sidebar />
<main role='main' className={[_s.default, _s.flexShrink1, _s.flexGrow1, _s.borderColorSecondary2, _s.borderLeft1PX].join(' ')}>
2020-03-04 03:45:16 +00:00
<div className={[_s.default, _s.height53PX, _s.borderBottom1PX, _s.borderColorSecondary2, _s.backgroundColorSecondary3, _s.z3, _s.top0, _s.positionFixed].join(' ')}>
2020-03-11 23:56:18 +00:00
<div className={[_s.default, _s.height53PX, _s.pl15, _s.width1015PX, _s.flexRow, _s.justifyContentSpaceBetween].join(' ')}>
2020-02-22 23:26:23 +00:00
<div className={[_s.default, _s.width645PX].join(' ')}>
<ColumnHeader
2020-03-02 22:26:25 +00:00
title={'Search'}
2020-02-22 23:26:23 +00:00
showBackBtn={showBackBtn}
actions={actions}
tabs={tabs}
/>
</div>
<div className={[_s.default, _s.width340PX].join(' ')}>
<Search />
</div>
</div>
</div>
<div className={[_s.default, _s.height53PX].join(' ')}></div>
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-22 23:26:23 +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(' ')}>
<Sticky top={73} enabled>
<div className={[_s.default, _s.width340PX].join(' ')}>
{layout}
</div>
</Sticky>
</div>
</div>
</main>
</div>
)
}
}