summaryrefslogtreecommitdiff
path: root/frontend/views
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/views')
-rw-r--r--frontend/views/index/containers/graph.edit.js2
-rw-r--r--frontend/views/index/containers/graph.index.js19
-rw-r--r--frontend/views/index/graph.reducer.js2
-rw-r--r--frontend/views/index/index.container.js2
-rw-r--r--frontend/views/index/index.css24
5 files changed, 42 insertions, 7 deletions
diff --git a/frontend/views/index/containers/graph.edit.js b/frontend/views/index/containers/graph.edit.js
index fadcabc..ce1b404 100644
--- a/frontend/views/index/containers/graph.edit.js
+++ b/frontend/views/index/containers/graph.edit.js
@@ -11,6 +11,7 @@ import GraphForm from '../components/graph.form'
class GraphEdit extends Component {
componentDidMount() {
+ console.log(this.props.match.params.id)
actions.graph.show(this.props.match.params.id)
}
@@ -28,7 +29,6 @@ class GraphEdit extends Component {
if (show.loading || !show.res) {
return (
<div className='form'>
- <h1>Loading...</h1>
<Loader />
</div>
)
diff --git a/frontend/views/index/containers/graph.index.js b/frontend/views/index/containers/graph.index.js
index 7ac31da..c02ad79 100644
--- a/frontend/views/index/containers/graph.index.js
+++ b/frontend/views/index/containers/graph.index.js
@@ -13,17 +13,30 @@ class GraphIndex extends Component {
}
render() {
const { index } = this.props
- if (index.loading) {
+ console.log(this.props)
+ if (!index.order) {
return (
<div className='graphIndex'>
<Loader />
</div>
)
}
+ // console.log(state)
return (
<div className='graphIndex'>
- <b>welcome, swimmer</b>
- <Link to='/index/new'>+ new project</Link>
+ <div>
+ <b>welcome, swimmer</b>
+ <Link to='/index/new'>+ new project</Link>
+ </div>
+ {index.order.map(id => {
+ const graph = index.lookup[id]
+ return (
+ <div key={id}>
+ <Link to={'/' + graph.path}>{graph.title}</Link>
+ <Link to={'/index/' + id + '/edit'}>{'edit project'}</Link>
+ </div>
+ )
+ })}
</div>
)
}
diff --git a/frontend/views/index/graph.reducer.js b/frontend/views/index/graph.reducer.js
index 612ac14..20aed8e 100644
--- a/frontend/views/index/graph.reducer.js
+++ b/frontend/views/index/graph.reducer.js
@@ -11,7 +11,7 @@ const initialState = crudState('graph', {
const reducer = crudReducer('graph')
export default function graphReducer(state = initialState, action) {
- // console.log(action.type, action)
+ console.log(action.type, action)
state = reducer(state, action)
switch (action.type) {
default:
diff --git a/frontend/views/index/index.container.js b/frontend/views/index/index.container.js
index 7805e83..0e7127a 100644
--- a/frontend/views/index/index.container.js
+++ b/frontend/views/index/index.container.js
@@ -10,12 +10,14 @@ import './index.css'
import GraphIndex from './containers/graph.index'
import GraphNew from './containers/graph.new'
+import GraphEdit from './containers/graph.edit'
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>
)
diff --git a/frontend/views/index/index.css b/frontend/views/index/index.css
index 48c5abc..028f6c2 100644
--- a/frontend/views/index/index.css
+++ b/frontend/views/index/index.css
@@ -1,18 +1,38 @@
* {
}
-
+.index {
+ width: 100%;
+ height: 100%;
+ background: linear-gradient(
+ -45deg,
+ rgba(0, 0, 64, 0.5),
+ rgba(128, 0, 64, 0.5)
+ );
+ padding: 1rem;
+}
.index > div {
- margin: 1rem;
+ display: inline-block;
padding: 1rem;
max-height: calc(100% - 2rem);
overflow: scroll;
background: rgba(64,12,64,0.9);
+ box-shadow: 3px 3px 6px rgba(0,0,0,0.4),
+ inset 0 0 60px rgba(128,255,255,0.1);
}
.graphIndex {
+ min-width: 20rem;
display: flex;
flex-direction: column;
}
.graphIndex > * {
margin-bottom: 0.5rem;
+}
+.graphIndex > div {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between
+}
+.graphIndex > div > a:first-child {
+ color: #fff;
} \ No newline at end of file