diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-07-22 14:05:15 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-07-22 14:05:15 +0200 |
| commit | ef78bc6a084f92b4794e987b5832240d85b6479e (patch) | |
| tree | b314b630800db6aa60f28ef0b115625e6ca176db /animism-align/frontend/app/views/site | |
| parent | 85d4cb9addf9ca887d3440b2786665d67d9917c4 (diff) | |
refactor app using babel module-resolver
Diffstat (limited to 'animism-align/frontend/app/views/site')
3 files changed, 66 insertions, 0 deletions
diff --git a/animism-align/frontend/app/views/site/component.template.js b/animism-align/frontend/app/views/site/component.template.js new file mode 100644 index 0000000..5b22206 --- /dev/null +++ b/animism-align/frontend/app/views/site/component.template.js @@ -0,0 +1,28 @@ +import React, { Component } from 'react' +// import { Link } from 'react-router-dom' +// import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' + +import actions from 'app/actions' +// import * as uploadActions from './upload.actions' + +class ComponentTemplate extends Component { + componentDidMount() { + } + render() { + const { } = this.props + return ( + <div className=""> + </div> + ) + } +} + +const mapStateToProps = state => ({ +}) + +const mapDispatchToProps = dispatch => ({ + // uploadActions: bindActionCreators({ ...uploadActions }, dispatch), +}) + +export default connect(mapStateToProps, mapDispatchToProps)(ComponentTemplate) diff --git a/animism-align/frontend/app/views/site/site.actions.js b/animism-align/frontend/app/views/site/site.actions.js new file mode 100644 index 0000000..b894c64 --- /dev/null +++ b/animism-align/frontend/app/views/site/site.actions.js @@ -0,0 +1,14 @@ +import * as types from 'app/types' +import { api, post, pad, preloadImage } from 'app/utils' + +export const loadPeaks = (asdf) => dispatch => { + api(dispatch, types.peaks, 'peaks', '/static/data_store/peaks/peaks.json') +} + +export const loadText = (asdf) => dispatch => { + api(dispatch, types.text, 'text', '/static/data_store/peaks/text.txt') +} + +export const updateText = text => dispatch => { + dispatch({ type: types.text.loaded, data: text }) +}
\ No newline at end of file diff --git a/animism-align/frontend/app/views/site/site.reducer.js b/animism-align/frontend/app/views/site/site.reducer.js new file mode 100644 index 0000000..fbb53fc --- /dev/null +++ b/animism-align/frontend/app/views/site/site.reducer.js @@ -0,0 +1,24 @@ +import * as types from 'app/types' + +const initialState = { + peaks: { loading: true }, + text: { loading: true }, +} + +export default function siteReducer(state = initialState, action) { + // console.log(action.type, action) + switch (action.type) { + case types.peaks.loaded: + return { + ...state, + peaks: action.data, + } + case types.text.loaded: + return { + ...state, + text: action.data, + } + default: + return state + } +} |
