From 5b480258322682fdc4fa987770df9e719315f167 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 2 Jun 2020 16:39:00 +0200 Subject: editing graph meta works --- frontend/views/index/containers/graph.edit.js | 2 +- frontend/views/index/containers/graph.index.js | 19 ++++++++++++++++--- frontend/views/index/graph.reducer.js | 2 +- frontend/views/index/index.container.js | 2 ++ frontend/views/index/index.css | 24 ++++++++++++++++++++++-- 5 files changed, 42 insertions(+), 7 deletions(-) (limited to 'frontend/views/index') 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 (
-

Loading...

) 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 (
) } + // console.log(state) return (
- welcome, swimmer - + new project +
+ welcome, swimmer + + new project +
+ {index.order.map(id => { + const graph = index.lookup[id] + return ( +
+ {graph.title} + {'edit project'} +
+ ) + })}
) } 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 (
+
) 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 -- cgit v1.2.3-70-g09d2