2020-08-17 15:07:16 -05:00
|
|
|
import React from 'react'
|
2020-08-17 15:59:29 -05:00
|
|
|
import PropTypes from 'prop-types'
|
2020-08-17 15:39:25 -05:00
|
|
|
import { connect } from 'react-redux'
|
2020-04-11 18:29:19 -04:00
|
|
|
import { defineMessages, injectIntl } from 'react-intl'
|
2020-03-24 23:08:43 -04:00
|
|
|
import { openModal } from '../actions/modal'
|
2020-04-11 18:29:19 -04:00
|
|
|
import PageTitle from '../features/ui/util/page_title'
|
2020-03-24 23:08:43 -04:00
|
|
|
import DefaultLayout from '../layouts/default_layout'
|
2020-08-14 12:45:59 -05:00
|
|
|
import { MODAL_COMMUNITY_TIMELINE_SETTINGS } from '../constants'
|
2020-08-12 17:52:46 -05:00
|
|
|
import {
|
|
|
|
LinkFooter,
|
2020-08-12 18:39:50 -05:00
|
|
|
GroupsPanel,
|
2020-08-12 17:52:46 -05:00
|
|
|
ProgressPanel,
|
|
|
|
TrendsPanel,
|
2020-09-01 11:54:01 -05:00
|
|
|
UserSuggestionsPanel,
|
2020-08-12 17:52:46 -05:00
|
|
|
} from '../features/ui/util/async_components'
|
2020-03-24 23:08:43 -04:00
|
|
|
|
2020-08-17 15:07:16 -05:00
|
|
|
class CommunityPage extends React.PureComponent {
|
2020-03-24 23:08:43 -04:00
|
|
|
|
2020-08-14 12:45:59 -05:00
|
|
|
onOpenCommunityPageSettingsModal = () => {
|
|
|
|
this.props.dispatch(openModal(MODAL_COMMUNITY_TIMELINE_SETTINGS))
|
2020-03-24 23:08:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2020-08-14 12:45:59 -05:00
|
|
|
const { children, intl } = this.props
|
2020-04-11 18:29:19 -04:00
|
|
|
|
|
|
|
const title = intl.formatMessage(messages.community)
|
2020-03-24 23:08:43 -04:00
|
|
|
|
|
|
|
return (
|
|
|
|
<DefaultLayout
|
2020-04-11 18:29:19 -04:00
|
|
|
title={title}
|
2020-07-15 23:05:08 -05:00
|
|
|
page='community'
|
2020-03-24 23:08:43 -04:00
|
|
|
actions={[
|
|
|
|
{
|
|
|
|
icon: 'ellipsis',
|
2020-08-14 12:45:59 -05:00
|
|
|
onClick: this.onOpenCommunityPageSettingsModal,
|
2020-03-24 23:08:43 -04:00
|
|
|
},
|
|
|
|
]}
|
2020-07-15 23:05:08 -05:00
|
|
|
layout={[
|
2020-08-12 17:52:46 -05:00
|
|
|
ProgressPanel,
|
|
|
|
TrendsPanel,
|
2020-09-01 11:54:01 -05:00
|
|
|
UserSuggestionsPanel,
|
2020-08-12 18:39:50 -05:00
|
|
|
GroupsPanel,
|
2020-08-12 17:52:46 -05:00
|
|
|
LinkFooter,
|
2020-07-15 23:05:08 -05:00
|
|
|
]}
|
2020-03-24 23:08:43 -04:00
|
|
|
>
|
2020-04-11 18:29:19 -04:00
|
|
|
<PageTitle path={title} />
|
2020-03-24 23:08:43 -04:00
|
|
|
{children}
|
|
|
|
</DefaultLayout>
|
|
|
|
)
|
|
|
|
}
|
2020-08-14 12:45:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
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))
|