File size: 1,373 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
// @flow
import * as React from 'react';
import compose from 'recompose/compose';
import { connect } from 'react-redux';
import type { GetCommunityType } from 'shared/graphql/queries/community/getCommunity';
import CommunityMembers from './components/communityMembers';
import type { Dispatch } from 'redux';
import { withCurrentUser } from 'src/components/withCurrentUser';
import { SectionsContainer, Column } from 'src/components/settingsViews/style';
import { ErrorBoundary, SettingsFallback } from 'src/components/error';
import { ErrorView } from 'src/views/viewHelpers';
type Props = {
currentUser: Object,
community: GetCommunityType,
dispatch: Dispatch<Object>,
match: Object,
history: Object,
};
class CommunityMembersSettings extends React.Component<Props> {
render() {
const { community, history } = this.props;
if (community && community.id) {
return (
<SectionsContainer>
<Column>
<ErrorBoundary fallbackComponent={SettingsFallback}>
<CommunityMembers
history={history}
id={community.id}
community={community}
/>
</ErrorBoundary>
</Column>
</SectionsContainer>
);
}
return <ErrorView />;
}
}
export default compose(
withCurrentUser,
connect()
)(CommunityMembersSettings);
|