gab-social/app/javascript/gabsocial/pages/list_page.js
2020-02-25 11:04:44 -05:00

50 lines
1.1 KiB
JavaScript

import { Fragment } from 'react'
import ImmutablePropTypes from 'react-immutable-proptypes'
import ImmutablePureComponent from 'react-immutable-pure-component'
import LinkFooter from '../components/link_footer'
import DefaultLayout from '../layouts/default_layout'
import ListDetailsPanel from '../components/panel/list_details_panel'
const mapStateToProps = (state, props) => ({
list: state.getIn(['lists', props.params.id]),
});
export default
@connect(mapStateToProps)
class ListPage extends ImmutablePureComponent {
static propTypes = {
list: ImmutablePropTypes.map,
};
handleEditListTimeline () {
console.log("handleEditListTimeline")
}
render() {
const { children, list } = this.props
const title = list ? list.get('title') : ''
return (
<DefaultLayout
title={title}
actions={[
{
icon: 'ellipsis',
onClick: this.handleEditListTimeline
},
]}
layout={(
<Fragment>
<ListDetailsPanel />
<LinkFooter />
</Fragment>
)}
showBackBtn
>
{ children }
</DefaultLayout>
)
}
}