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

62 lines
1.7 KiB
JavaScript
Raw Normal View History

2020-03-25 03:08:43 +00:00
import { Fragment } from 'react'
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 GroupSidebarPanel from '../components/panel/groups_panel'
import LinkFooter from '../components/link_footer'
import WhoToFollowPanel from '../components/panel/who_to_follow_panel'
import ProgressPanel from '../components/panel/progress_panel'
import TrendsPanel from '../components/panel/trends_panel'
import DefaultLayout from '../layouts/default_layout'
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}
2020-03-25 03:08:43 +00:00
actions={[
{
icon: 'ellipsis',
onClick: onOpenCommunityPageSettingsModal,
},
]}
layout={(
<Fragment>
<ProgressPanel />
<TrendsPanel />
<WhoToFollowPanel />
<GroupSidebarPanel />
<LinkFooter />
</Fragment>
)}
>
2020-04-11 23:29:19 +01:00
<PageTitle path={title} />
2020-03-25 03:08:43 +00:00
{children}
</DefaultLayout>
)
}
}