summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/editor/align/containers/sidebar.container.js
blob: 8c1724ec5bec0cc8ed4772f1a5a773a579da0e84 (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, { Component } from 'react'
// import { Link } from 'react-router-dom'
import { connect } from 'react-redux'

import actions from 'app/actions'

import Script from '../components/sidebar/script.component.js'
import TableOfContents from '../components/sidebar/tableOfContents.component.js'

export default class Sidebar extends Component {
  state = {
    mode: "toc",
  }
  render() {
    if (this.state.mode === "toc") {
      return (
        <div className='sidebar'>
          <button onClick={() => this.setState({ mode: "script" })}>
            +
          </button>
          <TableOfContents />
        </div>
      )
    }
    return (
      <div className='sidebar'>
        <Script />
        <button onClick={() => this.setState({ mode: "toc" })}>
          x
        </button>
      </div>
    )
  }
}