summaryrefslogtreecommitdiff
path: root/frontend/app/views/graph/components/graph.header.js
blob: f99f7dc4f8be6782254828affb928d2af4d206aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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 arrow">{"◁ "}</Link>
        <b>{props.site.siteTitle}</b>
      </div>
      <div>
        <button onClick={() => props.graphActions.toggleAddPageForm()}>+ Add page</button>
        <button onClick={() => props.graphActions.toggleCursorList()}>+ Cursors</button>
        <button onClick={() => props.graphActions.toggleAudioList()}>+ Audio</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)