2020-08-17 21:07:16 +01:00
|
|
|
import React from 'react'
|
2020-08-17 21:59:29 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2020-08-17 21:39:25 +01:00
|
|
|
import { connect } from 'react-redux'
|
2020-08-06 06:00:03 +01:00
|
|
|
import ImmutablePropTypes from 'react-immutable-proptypes'
|
|
|
|
import ImmutablePureComponent from 'react-immutable-pure-component'
|
|
|
|
import isObject from 'lodash.isobject'
|
|
|
|
import { BREAKPOINT_EXTRA_SMALL } from '../constants'
|
|
|
|
import ColumnIndicator from '../components/column_indicator'
|
|
|
|
import Responsive from './ui/util/responsive_component'
|
2020-08-12 23:52:46 +01:00
|
|
|
import Bundle from '../features/ui/util/bundle'
|
|
|
|
import {
|
|
|
|
GroupInfoPanel
|
|
|
|
} from '../features/ui/util/async_components'
|
|
|
|
|
2020-08-06 06:00:03 +01:00
|
|
|
class GroupAbout extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const { group } = this.props
|
|
|
|
|
|
|
|
return (
|
2020-08-18 21:49:11 +01:00
|
|
|
<div className={[_s.d, _s.w100PC].join(' ')}>
|
2020-08-06 06:00:03 +01:00
|
|
|
<Responsive min={BREAKPOINT_EXTRA_SMALL}>
|
|
|
|
<ColumnIndicator type='missing' />
|
|
|
|
</Responsive>
|
|
|
|
<Responsive max={BREAKPOINT_EXTRA_SMALL}>
|
2020-08-12 23:52:46 +01:00
|
|
|
<Bundle
|
|
|
|
fetchComponent={GroupInfoPanel}
|
|
|
|
loading={this.renderLoading}
|
|
|
|
error={this.renderError}
|
|
|
|
renderDelay={150}
|
|
|
|
>
|
|
|
|
{
|
|
|
|
(Component) => <Component group={group} />
|
|
|
|
}
|
|
|
|
</Bundle>
|
2020-08-06 06:00:03 +01:00
|
|
|
</Responsive>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-08-19 01:22:15 +01:00
|
|
|
|
|
|
|
const mapStateToProps = (state, { params }) => {
|
|
|
|
const groupId = isObject(params) ? params['id'] : null
|
|
|
|
const group = state.getIn(['groups', groupId])
|
|
|
|
|
|
|
|
return { group }
|
|
|
|
}
|
|
|
|
|
|
|
|
GroupAbout.propTypes = {
|
|
|
|
group: ImmutablePropTypes.map,
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(GroupAbout)
|