diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-06-02 20:25:23 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-06-02 20:25:23 +0200 |
| commit | 04f7efe6c05153cbd1613e7b0c78b3b6478ae39b (patch) | |
| tree | e181c4415a271a60e505fc536219eb5e72b6f6fb /frontend/views/graph/components/graph.header.js | |
| parent | f6d7fcbb50ef57f1f7d7ca8cacd711ffd576e600 (diff) | |
new page form
Diffstat (limited to 'frontend/views/graph/components/graph.header.js')
| -rw-r--r-- | frontend/views/graph/components/graph.header.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/frontend/views/graph/components/graph.header.js b/frontend/views/graph/components/graph.header.js new file mode 100644 index 0000000..6a927ec --- /dev/null +++ b/frontend/views/graph/components/graph.header.js @@ -0,0 +1,31 @@ +import React from 'react' +import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' +import { Link } from 'react-router-dom' + +import * as graphActions from '../graph.actions' + +function GraphHeader(props) { + return ( + <header> + <div> + <Link to="/" className="logo"><b>{props.site.siteTitle}</b></Link> + </div> + <div> + <button onClick={() => props.graphActions.showAddPageForm()}>+ Add page</button> + </div> + </header> + ) +} + +const mapStateToProps = (state) => ({ + // auth: state.auth, + site: state.site, + // isAuthenticated: state.auth.isAuthenticated, +}) + +const mapDispatchToProps = (dispatch) => ({ + graphActions: bindActionCreators({ ...graphActions }, dispatch), +}) + +export default connect(mapStateToProps, mapDispatchToProps)(GraphHeader) |
