Updated groups so that anyone can create
• Updated: - groups so that anyone can create
This commit is contained in:
@@ -8,8 +8,6 @@ import Text from '../components/text'
|
||||
import DefaultLayout from '../layouts/default_layout'
|
||||
import GroupsCollection from '../features/groups_collection'
|
||||
import WrappedBundle from '../features/ui/util/wrapped_bundle'
|
||||
import { openModal } from '../actions/modal'
|
||||
import { MODAL_PRO_UPGRADE } from '../constants'
|
||||
import {
|
||||
GroupsPanel,
|
||||
LinkFooter,
|
||||
@@ -17,16 +15,11 @@ import {
|
||||
|
||||
class GroupsPage extends React.PureComponent {
|
||||
|
||||
handleOpenProUpgradeModal = () => {
|
||||
this.props.dispatch(openModal(MODAL_PRO_UPGRADE))
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
activeTab,
|
||||
intl,
|
||||
children,
|
||||
isPro,
|
||||
} = this.props
|
||||
|
||||
const dontShowChildren = (activeTab === 'timeline' && !me)
|
||||
@@ -52,14 +45,11 @@ class GroupsPage extends React.PureComponent {
|
||||
title: intl.formatMessage(messages.categories),
|
||||
to: '/groups/browse/categories',
|
||||
},
|
||||
] : []
|
||||
|
||||
if (isPro) {
|
||||
tabs.push({
|
||||
{
|
||||
title: intl.formatMessage(messages.admin),
|
||||
to: '/groups/browse/admin',
|
||||
})
|
||||
}
|
||||
},
|
||||
] : []
|
||||
|
||||
const title = intl.formatMessage(messages.groups)
|
||||
|
||||
@@ -76,8 +66,7 @@ class GroupsPage extends React.PureComponent {
|
||||
{
|
||||
attrTitle: 'Create',
|
||||
icon: 'add',
|
||||
to: isPro ? '/groups/create' : undefined,
|
||||
onClick: isPro ? undefined : this.handleOpenProUpgradeModal,
|
||||
to: '/groups/create',
|
||||
},
|
||||
{
|
||||
icon: 'search',
|
||||
@@ -114,15 +103,10 @@ const messages = defineMessages({
|
||||
admin: { id: 'admin', defaultMessage: 'Admin' },
|
||||
})
|
||||
|
||||
const mapStateToProps = (state) => ({
|
||||
isPro: state.getIn(['accounts', me, 'is_pro']),
|
||||
})
|
||||
|
||||
GroupsPage.propTypes = {
|
||||
activeTab: PropTypes.string.isRequired,
|
||||
intl: PropTypes.object.isRequired,
|
||||
children: PropTypes.node.isRequired,
|
||||
isPro: PropTypes.bool,
|
||||
}
|
||||
|
||||
export default injectIntl(connect(mapStateToProps)(GroupsPage))
|
||||
export default injectIntl(connect()(GroupsPage))
|
||||
Reference in New Issue
Block a user