summaryrefslogtreecommitdiff
path: root/frontend/views/index
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-06-02 20:25:23 +0200
committerJules Laplace <julescarbon@gmail.com>2020-06-02 20:25:23 +0200
commit04f7efe6c05153cbd1613e7b0c78b3b6478ae39b (patch)
treee181c4415a271a60e505fc536219eb5e72b6f6fb /frontend/views/index
parentf6d7fcbb50ef57f1f7d7ca8cacd711ffd576e600 (diff)
new page form
Diffstat (limited to 'frontend/views/index')
-rw-r--r--frontend/views/index/graph.reducer.js21
-rw-r--r--frontend/views/index/index.container.js12
2 files changed, 29 insertions, 4 deletions
diff --git a/frontend/views/index/graph.reducer.js b/frontend/views/index/graph.reducer.js
index 612ac14..7e573e1 100644
--- a/frontend/views/index/graph.reducer.js
+++ b/frontend/views/index/graph.reducer.js
@@ -4,6 +4,9 @@ import * as types from '../../types'
import { crudState, crudReducer } from '../../api/crud.reducer'
const initialState = crudState('graph', {
+ editor: {
+ addingPage: true,
+ },
options: {
}
})
@@ -14,6 +17,24 @@ export default function graphReducer(state = initialState, action) {
// console.log(action.type, action)
state = reducer(state, action)
switch (action.type) {
+ case types.graph.show_add_page_form:
+ return {
+ ...state,
+ editor: {
+ ...state.editor,
+ addingPage: true,
+ }
+ }
+
+ case types.graph.hide_add_page_form:
+ return {
+ ...state,
+ editor: {
+ ...state.editor,
+ addingPage: false,
+ }
+ }
+
default:
return state
}
diff --git a/frontend/views/index/index.container.js b/frontend/views/index/index.container.js
index 1e2326b..2da89cb 100644
--- a/frontend/views/index/index.container.js
+++ b/frontend/views/index/index.container.js
@@ -6,6 +6,7 @@ import { connect } from 'react-redux'
import './index.css'
import actions from '../../actions'
+import { Header } from '../../common'
// import * as uploadActions from './upload.actions'
import GraphIndex from './containers/graph.index'
@@ -18,10 +19,13 @@ class Container extends Component {
}
render() {
return (
- <div className='index'>
- <Route exact path='/index/new' component={GraphNew} />
- <Route exact path='/index/:id/edit' component={GraphEdit} />
- <Route exact path='/index' component={GraphIndex} />
+ <div className='body'>
+ <Header />
+ <div className='index'>
+ <Route exact path='/index/new' component={GraphNew} />
+ <Route exact path='/index/:id/edit' component={GraphEdit} />
+ <Route exact path='/index' component={GraphIndex} />
+ </div>
</div>
)
}