import { Fragment } from 'react' import ImmutablePropTypes from 'react-immutable-proptypes' import ImmutablePureComponent from 'react-immutable-pure-component' import { openModal } from '../actions/modal' import LinkFooter from '../components/link_footer' import DefaultLayout from '../layouts/default_layout' import ListDetailsPanel from '../components/panel/list_details_panel' import WhoToFollowPanel from '../components/panel/who_to_follow_panel' import TrendsPanel from '../components/panel/trends_panel' const mapStateToProps = (state, props) => ({ list: state.getIn(['lists', props.params.id]), }) const mapDispatchToProps = (dispatch, { list }) => ({ onOpenListEditModal() { dispatch(openModal('LIST_EDIT', { list, })) }, onOpenListTimelineSettingsModal() { dispatch(openModal('LIST_TIMELINE_SETTINGS')) }, }) export default @connect(mapStateToProps, mapDispatchToProps) class ListPage extends ImmutablePureComponent { static propTypes = { list: ImmutablePropTypes.map, onOpenListEditModal: PropTypes.func.isRequired, onOpenListTimelineSettingsModal: PropTypes.func.isRequired, } componentDidMount() { const { list } = this.props const listTitle = !list ? '...' : list.get('title') document.title = `List / ${listTitle} - Gab` } render() { const { children, list, onOpenListEditModal, onOpenListTimelineSettingsModal } = this.props const title = !!list ? list.get('title') : '' return ( )} showBackBtn > { children } ) } }