diff options
Diffstat (limited to 'frontend/views/index/containers')
| -rw-r--r-- | frontend/views/index/containers/graph.edit.js | 2 | ||||
| -rw-r--r-- | frontend/views/index/containers/graph.index.js | 19 |
2 files changed, 17 insertions, 4 deletions
diff --git a/frontend/views/index/containers/graph.edit.js b/frontend/views/index/containers/graph.edit.js index fadcabc..ce1b404 100644 --- a/frontend/views/index/containers/graph.edit.js +++ b/frontend/views/index/containers/graph.edit.js @@ -11,6 +11,7 @@ import GraphForm from '../components/graph.form' class GraphEdit extends Component { componentDidMount() { + console.log(this.props.match.params.id) actions.graph.show(this.props.match.params.id) } @@ -28,7 +29,6 @@ class GraphEdit extends Component { if (show.loading || !show.res) { return ( <div className='form'> - <h1>Loading...</h1> <Loader /> </div> ) diff --git a/frontend/views/index/containers/graph.index.js b/frontend/views/index/containers/graph.index.js index 7ac31da..c02ad79 100644 --- a/frontend/views/index/containers/graph.index.js +++ b/frontend/views/index/containers/graph.index.js @@ -13,17 +13,30 @@ class GraphIndex extends Component { } render() { const { index } = this.props - if (index.loading) { + console.log(this.props) + if (!index.order) { return ( <div className='graphIndex'> <Loader /> </div> ) } + // console.log(state) return ( <div className='graphIndex'> - <b>welcome, swimmer</b> - <Link to='/index/new'>+ new project</Link> + <div> + <b>welcome, swimmer</b> + <Link to='/index/new'>+ new project</Link> + </div> + {index.order.map(id => { + const graph = index.lookup[id] + return ( + <div key={id}> + <Link to={'/' + graph.path}>{graph.title}</Link> + <Link to={'/index/' + id + '/edit'}>{'edit project'}</Link> + </div> + ) + })} </div> ) } |
