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

64 lines
1.5 KiB
JavaScript
Raw Normal View History

import React from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
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 { MODAL_COMMUNITY_TIMELINE_SETTINGS } from '../constants'
import {
LinkFooter,
GroupsPanel,
ProgressPanel,
TrendsPanel,
WhoToFollowPanel,
} from '../features/ui/util/async_components'
2020-03-25 03:08:43 +00:00
class CommunityPage extends React.PureComponent {
2020-03-25 03:08:43 +00:00
onOpenCommunityPageSettingsModal = () => {
this.props.dispatch(openModal(MODAL_COMMUNITY_TIMELINE_SETTINGS))
2020-03-25 03:08:43 +00:00
}
render() {
const { children, intl } = this.props
2020-04-11 23:29:19 +01:00
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: this.onOpenCommunityPageSettingsModal,
2020-03-25 03:08:43 +00:00
},
]}
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>
)
}
}
const messages = defineMessages({
community: { 'id': 'column.community', 'defaultMessage': 'Community feed' },
})
CommunityPage.propTypes = {
children: PropTypes.node.isRequired,
dispatch: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
}
export default injectIntl(connect()(CommunityPage))