66 lines
1.6 KiB
JavaScript
Raw Normal View History

2020-02-22 18:26:23 -05:00
import { Fragment } from 'react'
2020-04-16 02:00:43 -04:00
import { defineMessages, injectIntl } from 'react-intl'
import PageTitle from '../features/ui/util/page_title'
2020-02-22 18:26:23 -05:00
import LinkFooter from '../components/link_footer'
2020-03-02 17:26:25 -05:00
import SearchFilterPanel from '../components/panel/search_filter_panel'
2020-04-28 22:24:35 -04:00
import Layout from '../layouts/layout'
2019-07-02 03:10:25 -04:00
2020-04-16 02:00:43 -04:00
const messages = defineMessages({
search: { id: 'search', defaultMessage: 'Search' },
2020-04-30 00:34:50 -04:00
top: { id: 'top', defaultMessage: 'Top' },
people: { id: 'people', defaultMessage: 'People' },
groups: { id: 'groups', defaultMessage: 'Groups' },
hashtags: { id: 'hashtags', defaultMessage: 'Hashtags' },
2020-04-16 02:00:43 -04:00
})
export default
@injectIntl
class SearchPage extends PureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,
children: PropTypes.node.isRequired,
2020-03-12 12:09:15 -04:00
}
render() {
2020-04-30 00:34:50 -04:00
const { intl, children } = this.props
2020-02-22 18:26:23 -05:00
2020-04-28 22:24:35 -04:00
const title = intl.formatMessage(messages.search)
const tabs = [
{
2020-04-30 00:34:50 -04:00
title: intl.formatMessage(messages.top),
2020-04-28 22:24:35 -04:00
to: '/search'
},
{
2020-04-30 00:34:50 -04:00
title: intl.formatMessage(messages.people),
2020-04-28 22:24:35 -04:00
to: '/search/people'
},
{
2020-04-30 00:34:50 -04:00
title: intl.formatMessage(messages.groups),
2020-04-28 22:24:35 -04:00
to: '/search/groups'
},
{
2020-04-30 00:34:50 -04:00
title: intl.formatMessage(messages.hashtags),
2020-04-28 22:24:35 -04:00
to: '/search/hashtags'
},
]
return (
2020-04-28 22:24:35 -04:00
<Layout
title={title}
2020-03-24 00:39:12 -04:00
showBackBtn
2020-04-28 22:24:35 -04:00
tabs={tabs}
2020-03-02 17:26:25 -05:00
layout={(
<Fragment>
<SearchFilterPanel />
<LinkFooter />
</Fragment>
)}
2020-03-24 00:39:12 -04:00
>
2020-04-28 22:24:35 -04:00
<PageTitle path={title} />
2020-02-22 18:26:23 -05:00
{children}
2020-04-28 22:24:35 -04:00
</Layout>
)
}
2020-04-16 02:00:43 -04:00
2020-02-22 18:26:23 -05:00
}