init
Dieser Commit ist enthalten in:
@@ -0,0 +1 @@
|
||||
export const CHART = 'CHART';
|
||||
@@ -0,0 +1,23 @@
|
||||
import { CHART } from '../actions/type';
|
||||
|
||||
const initialState = {
|
||||
statistics: {
|
||||
name: 'Statistics',
|
||||
data: [33, 33, 34],
|
||||
},
|
||||
};
|
||||
|
||||
const DoughnutChart = (state = initialState, action) => {
|
||||
const { payload, type } = action;
|
||||
switch (type) {
|
||||
case CHART:
|
||||
return {
|
||||
...state,
|
||||
payload,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default DoughnutChart;
|
||||
@@ -0,0 +1,24 @@
|
||||
import { CHART } from '../actions/type';
|
||||
|
||||
const initialState = {
|
||||
expenses: {
|
||||
name: 'Expenses',
|
||||
youtube: [65, 59, 80, 81, 56, 55, 40,80, 81, 56, 55, 40],
|
||||
facebook: [40, 105, 92, 155, 138, 205, 120,92, 155, 138, 205, 120],
|
||||
},
|
||||
};
|
||||
|
||||
const LineChart = (state = initialState, action) => {
|
||||
const { payload, type } = action;
|
||||
switch (type) {
|
||||
case CHART:
|
||||
return {
|
||||
...state,
|
||||
payload,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default LineChart;
|
||||
@@ -0,0 +1,23 @@
|
||||
import { CHART } from '../actions/type';
|
||||
|
||||
const initialState = {
|
||||
investment: {
|
||||
name: 'Investment',
|
||||
data: [50, 26, 36, 30, 46, 38, 60],
|
||||
},
|
||||
};
|
||||
|
||||
const LineInvestment = (state = initialState, action) => {
|
||||
const { payload, type } = action;
|
||||
switch (type) {
|
||||
case CHART:
|
||||
return {
|
||||
...state,
|
||||
payload,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default LineInvestment;
|
||||
@@ -0,0 +1,11 @@
|
||||
import { combineReducers } from 'redux';
|
||||
import LineChart from './lineChart';
|
||||
import DoughnutChart from './doughnutChart';
|
||||
import LineInvestment from './lineInvestment'
|
||||
|
||||
|
||||
export default combineReducers({
|
||||
LineChart,
|
||||
DoughnutChart,
|
||||
LineInvestment
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import { applyMiddleware, createStore } from "redux";
|
||||
import thunk from "redux-thunk";
|
||||
import rootReducers from "./reducers/root";
|
||||
|
||||
const initialState = {};
|
||||
|
||||
const middleware = [thunk];
|
||||
|
||||
const store = createStore(
|
||||
rootReducers,
|
||||
initialState,
|
||||
applyMiddleware(...middleware)
|
||||
)
|
||||
|
||||
export default store;
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren