diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-06-02 22:34:16 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-06-02 22:34:16 +0200 |
| commit | abd277bc02d36570038de4c0646a672f5585fa84 (patch) | |
| tree | 91a8955ce1838892dc55389c920370a06ac04a91 /frontend/views/page/components/page.header.js | |
| parent | 70a29089cdb05df27cf50b50fcbc2e53d8975571 (diff) | |
stubbing in page editor
Diffstat (limited to 'frontend/views/page/components/page.header.js')
| -rw-r--r-- | frontend/views/page/components/page.header.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/frontend/views/page/components/page.header.js b/frontend/views/page/components/page.header.js new file mode 100644 index 0000000..a6c47ee --- /dev/null +++ b/frontend/views/page/components/page.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 pageActions from '../page.actions' + +function PageHeader(props) { + return ( + <header> + <div> + <Link to="/" className="logo"><b>{props.site.siteTitle}</b></Link> + </div> + <div> + <button onClick={() => props.pageActions.showAddTileForm()}>+ Add tile</button> + </div> + </header> + ) +} + +const mapStateToProps = (state) => ({ + // auth: state.auth, + site: state.site, + // isAuthenticated: state.auth.isAuthenticated, +}) + +const mapDispatchToProps = (dispatch) => ({ + pageActions: bindActionCreators({ ...pageActions }, dispatch), +}) + +export default connect(mapStateToProps, mapDispatchToProps)(PageHeader) |
