diff options
| author | lens <lens@neural.garden> | 2020-12-26 20:59:17 +0000 |
|---|---|---|
| committer | lens <lens@neural.garden> | 2020-12-26 20:59:17 +0000 |
| commit | 7c15f34186622410e25ee85c01d832e48e012140 (patch) | |
| tree | e0a8dbd5e7b6a3936e7b9a666c2622ecc7ff1a65 /frontend/app/views/index/containers/graph.index.js | |
| parent | 94234db6a771f687788d3decc6dd1ba01731f7af (diff) | |
| parent | 85bfb949fea4e69dabc5b7544ce70d26d3d11393 (diff) | |
Merge branch 'master' of asdf.us:swimmer
Diffstat (limited to 'frontend/app/views/index/containers/graph.index.js')
| -rw-r--r-- | frontend/app/views/index/containers/graph.index.js | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/frontend/app/views/index/containers/graph.index.js b/frontend/app/views/index/containers/graph.index.js new file mode 100644 index 0000000..91098a7 --- /dev/null +++ b/frontend/app/views/index/containers/graph.index.js @@ -0,0 +1,53 @@ +import React, { Component } from 'react' +import { Link } from 'react-router-dom' +import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' + +import { Loader } from 'app/common' +import actions from 'app/actions' +// import * as uploadActions from './upload.actions' + +class GraphIndex extends Component { + componentDidMount() { + actions.graph.index() + } + render() { + const { index } = this.props + // console.log(this.props) + if (!index.order) { + return ( + <div className='graphIndex'> + <Loader /> + </div> + ) + } + // console.log(state) + return ( + <div className='graphIndex'> + <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> + ) + } +} + +const mapStateToProps = state => ({ + index: state.graph.index, +}) + +const mapDispatchToProps = dispatch => ({ + // uploadActions: bindActionCreators({ ...uploadActions }, dispatch), +}) + +export default connect(mapStateToProps, mapDispatchToProps)(GraphIndex) |
