gab-social/app/javascript/gabsocial/pages/lists_page.js
mgabdev 014e476b5d Updated pages, layout component structures
• Updated:
- pages, layout component structures
2020-08-14 12:45:59 -05:00

58 lines
1.3 KiB
JavaScript

import { openModal } from '../actions/modal'
import { defineMessages, injectIntl } from 'react-intl'
import PageTitle from '../features/ui/util/page_title'
import DefaultLayout from '../layouts/default_layout'
import { MODAL_LIST_CREATE } from '../constants'
import {
LinkFooter,
TrendsPanel,
WhoToFollowPanel,
} from '../features/ui/util/async_components'
class ListsPage extends PureComponent {
onOpenListCreateModal = () => {
this.props.dispatch(openModal(MODAL_LIST_CREATE))
}
render() {
const { children, intl } = this.props
const title = intl.formatMessage(messages.lists)
return (
<DefaultLayout
showBackBtn
title={title}
page='lists'
actions={[
{
icon: 'add',
onClick: this.onOpenListCreateModal,
},
]}
layout={[
TrendsPanel,
WhoToFollowPanel,
LinkFooter,
]}
>
<PageTitle path={title} />
{children}
</DefaultLayout>
)
}
}
const messages = defineMessages({
lists: { id: 'lists', defaultMessage: 'Lists' },
})
ListsPage.propTypes = {
intl: PropTypes.object.isRequired,
children: PropTypes.node.isRequired,
dispatch: PropTypes.func.isRequired,
}
export default injectIntl(connect()(ListsPage))