From e05904f2e992ce3184952a8e569d9c28d85d68de Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 21 May 2018 02:49:46 +0200 Subject: basic css for form elements --- app/client/live/actions.js | 10 ++ app/client/live/components/player.component.js | 16 ++++ app/client/live/index.js | 126 +++++++++++++++++++++++++ app/client/live/reducer.js | 35 +++++++ 4 files changed, 187 insertions(+) create mode 100644 app/client/live/actions.js create mode 100644 app/client/live/components/player.component.js create mode 100644 app/client/live/index.js create mode 100644 app/client/live/reducer.js (limited to 'app/client/live') diff --git a/app/client/live/actions.js b/app/client/live/actions.js new file mode 100644 index 0000000..30a25ff --- /dev/null +++ b/app/client/live/actions.js @@ -0,0 +1,10 @@ +import socket from '../socket' + +export const loadOptFromServer = (opt) => ({ + type: 'LIVE_LOAD_OPT_FROM_SERVER', opt, +}) +// export const updateOptFromServer = (key, value) => { +// return { +// type: 'LIVE_LOAD_OPT_FROM_SERVER', opt, +// } +// } diff --git a/app/client/live/components/player.component.js b/app/client/live/components/player.component.js new file mode 100644 index 0000000..3c5fc9e --- /dev/null +++ b/app/client/live/components/player.component.js @@ -0,0 +1,16 @@ +import { h, Component } from 'preact' +import { connect } from 'react-redux' + +function Player(props) { + return ( +
+ ) +} + +const mapStateToProps = state => ({ +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ +}) + +export default connect(mapStateToProps, mapDispatchToProps)(Player) diff --git a/app/client/live/index.js b/app/client/live/index.js new file mode 100644 index 0000000..80f531a --- /dev/null +++ b/app/client/live/index.js @@ -0,0 +1,126 @@ +import { h, Component } from 'preact' +import { connect } from 'react-redux' + +import Player from './components/player.component' +import ParamGroup from '../common/paramGroup.component' +import Slider from '../common/slider.component' + +function App(props) { + return ( +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ ) +} + +const mapStateToProps = state => ({ +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ +}) + +export default connect(mapStateToProps, mapDispatchToProps)(App) diff --git a/app/client/live/reducer.js b/app/client/live/reducer.js new file mode 100644 index 0000000..9d41c6f --- /dev/null +++ b/app/client/live/reducer.js @@ -0,0 +1,35 @@ +import { combineReducers } from 'redux' + +const liveInitialState = { + loading: false, + error: null, + opt: {}, +} + +const liveReducer = (state = liveInitialState, action) => { + let results; + + switch(action.type) { + case 'LIVE_LOAD_OPT_FROM_SERVER': + return { + ...state, + loading: false, + error: null, + opt: action.opt, + } + + case 'LIVE_SET_OPT': + return { + ...state, + opt: { + ...state.opt, + [action.key]: action.value, + } + } + + default: + return state + } +} + +export default liveReducer -- cgit v1.2.3-70-g09d2