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

62 lines
1.5 KiB
JavaScript
Raw Normal View History

2020-04-11 23:29:19 +01:00
import { defineMessages, injectIntl } from 'react-intl'
2020-03-25 03:08:43 +00:00
import { openModal } from '../actions/modal'
2020-04-11 23:29:19 +01:00
import PageTitle from '../features/ui/util/page_title'
2020-03-25 03:08:43 +00:00
import DefaultLayout from '../layouts/default_layout'
import {
LinkFooter,
GroupsPanel,
ProgressPanel,
TrendsPanel,
WhoToFollowPanel,
} from '../features/ui/util/async_components'
2020-03-25 03:08:43 +00:00
2020-04-11 23:29:19 +01:00
const messages = defineMessages({
2020-05-03 06:22:49 +01:00
community: { 'id': 'column.community', 'defaultMessage': 'Community feed' },
2020-04-11 23:29:19 +01:00
})
2020-03-25 03:08:43 +00:00
const mapDispatchToProps = (dispatch) => ({
onOpenCommunityPageSettingsModal() {
dispatch(openModal('COMMUNITY_TIMELINE_SETTINGS'))
},
})
export default
2020-04-11 23:29:19 +01:00
@injectIntl
2020-03-25 03:08:43 +00:00
@connect(null, mapDispatchToProps)
class CommunityPage extends PureComponent {
static propTypes = {
2020-04-11 23:29:19 +01:00
intl: PropTypes.object.isRequired,
children: PropTypes.node.isRequired,
2020-03-25 03:08:43 +00:00
onOpenCommunityPageSettingsModal: PropTypes.func.isRequired,
}
render() {
2020-04-11 23:29:19 +01:00
const { intl, children, onOpenCommunityPageSettingsModal } = this.props
const title = intl.formatMessage(messages.community)
2020-03-25 03:08:43 +00:00
return (
<DefaultLayout
2020-04-11 23:29:19 +01:00
title={title}
page='community'
2020-03-25 03:08:43 +00:00
actions={[
{
icon: 'ellipsis',
onClick: onOpenCommunityPageSettingsModal,
},
]}
layout={[
ProgressPanel,
TrendsPanel,
WhoToFollowPanel,
GroupsPanel,
LinkFooter,
]}
2020-03-25 03:08:43 +00:00
>
2020-04-11 23:29:19 +01:00
<PageTitle path={title} />
2020-03-25 03:08:43 +00:00
{children}
</DefaultLayout>
)
}
}