gab-social/app/javascript/gabsocial/pages/lists_page.js

62 lines
1.5 KiB
JavaScript
Raw Normal View History

2020-02-19 23:57:07 +00:00
import { Fragment } from 'react'
2020-04-11 23:29:19 +01:00
import { openModal } from '../actions/modal'
2020-04-16 07:00:43 +01:00
import { defineMessages, injectIntl } from 'react-intl'
2020-04-11 23:29:19 +01:00
import PageTitle from '../features/ui/util/page_title'
2020-02-19 23:57:07 +00:00
import LinkFooter from '../components/link_footer'
import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
import TrendsPanel from '../components/panel/trends_panel'
2020-02-24 21:56:07 +00:00
import DefaultLayout from '../layouts/default_layout'
2020-02-19 23:57:07 +00:00
2020-04-16 07:00:43 +01:00
const messages = defineMessages({
lists: { id: 'lists', defaultMessage: 'Lists' },
})
2020-04-11 23:29:19 +01:00
const mapDispatchToProps = (dispatch) => ({
2020-03-25 03:08:43 +00:00
onOpenListCreateModal() {
dispatch(openModal('LIST_CREATE'))
},
})
2020-02-19 23:57:07 +00:00
2020-03-25 03:08:43 +00:00
export default
2020-04-16 07:00:43 +01:00
@injectIntl
2020-03-25 03:08:43 +00:00
@connect(null, mapDispatchToProps)
class ListsPage extends PureComponent {
static propTypes = {
2020-04-16 07:00:43 +01:00
intl: PropTypes.object.isRequired,
children: PropTypes.node.isRequired,
2020-03-25 03:08:43 +00:00
onOpenListCreateModal: PropTypes.func.isRequired,
2020-02-19 23:57:07 +00:00
}
render() {
2020-04-16 07:00:43 +01:00
const {
intl,
children,
onOpenListCreateModal,
} = this.props
2020-02-19 23:57:07 +00:00
return (
<DefaultLayout
2020-04-16 07:00:43 +01:00
title={intl.formatMessage(messages.lists)}
2020-02-19 23:57:07 +00:00
actions={[
{
2020-04-08 02:06:59 +01:00
icon: 'add',
onClick: onOpenListCreateModal,
2020-02-19 23:57:07 +00:00
},
]}
layout={(
<Fragment>
<TrendsPanel />
<WhoToFollowPanel />
<LinkFooter />
</Fragment>
)}
showBackBtn
>
2020-04-16 07:00:43 +01:00
<PageTitle path={intl.formatMessage(messages.lists)} />
2020-02-19 23:57:07 +00:00
{children}
</DefaultLayout>
)
}
2020-04-08 02:06:59 +01:00
2020-02-19 23:57:07 +00:00
}