diff options
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) |
