client directory structure is changed

This commit is contained in:
Sukchan Lee
2017-06-19 23:35:54 +09:00
parent 6d8eeb2a10
commit d6d7efbde1
17 changed files with 49 additions and 51 deletions

View File

@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import withRedux from 'next-redux-wrapper';
import { initStore } from 'store.js';
import { initStore } from 'modules/store.js';
import withSession from 'helpers/with-session';
import Auth from 'containers/Auth';

View File

@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators, compose } from 'redux';
import * as uiActions from 'actions/ui';
import * as uiActions from 'modules/ui';
import withWidth, { SMALL } from 'helpers/with-width';
import { Layout } from 'components';

View File

@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as uiActions from 'actions/ui';
import * as uiActions from 'modules/ui';
import Session from 'services/session';

View File

@@ -4,7 +4,7 @@ import { connect } from 'react-redux';
import { bindActionCreators, compose } from 'redux';
import withWidth, { SMALL } from 'helpers/with-width';
import * as uiActions from 'actions/ui';
import * as uiActions from 'modules/ui';
import { Sidebar } from 'components';

View File

@@ -2,8 +2,7 @@ import { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { fetchSubscribers } from 'actions/subscriber';
import { fetchCollection } from 'actions/crud';
import { fetchSubscribers } from 'modules/crud/subscriber';
class SubscriberContainer extends Component {
componentWillMount() {

View File

@@ -1,4 +1,4 @@
import { AUTH } from 'actions/auth';
import { AUTH } from './actions';
const initialState = {
isAuthenticating: false,

View File

@@ -1,7 +1,7 @@
import { take, fork, cancel, call, put } from 'redux-saga/effects';
import Session from 'services/session';
import { AUTH, loginSuccess } from 'actions/auth';
import { AUTH, loginSuccess } from './actions';
function* authorize(username, password) {
try {

View File

@@ -1,4 +1,4 @@
import { CRUD } from 'actions/crud';
import { CRUD } from './actions';
import { fromJS, toJS } from 'immutable';
import { isEqual } from 'lodash/lang';

View File

@@ -1,6 +1,6 @@
import axios from 'axios';
import { all, takeEvery, put, call, take, fork } from 'redux-saga/effects';
import { CRUD } from 'actions/crud';
import { CRUD } from './actions';
const crudApi = (method, url, { params, data } = {} ) => {
return axios({ baseURL: '/api/db', method, url, params, data });

View File

@@ -1,6 +1,6 @@
import {
fetchCollection
} from 'actions/crud'
} from './actions'
const MODEL = 'subscribers';
const ID = 'imsi';

View File

@@ -1,7 +1,7 @@
import { combineReducers } from 'redux';
import auth from './auth';
import crud from './crud';
import auth from './auth/reducers';
import crud from './crud/reducers';
import ui from './ui';
export default combineReducers({

View File

@@ -1,6 +1,6 @@
import { all, fork } from 'redux-saga/effects';
import auth from './auth';
import crud from './crud';
import auth from './auth/sagas';
import crud from './crud/sagas';
export default function* rootSaga() {
yield all([

View File

@@ -1,4 +1,5 @@
import { createAction } from 'redux-actions';
import { handleActions } from 'redux-actions';
export const UI = {
TOGGLE_SIDEBAR: 'ui/TOGGLE_SIDEBAR',
@@ -25,3 +26,34 @@ export const toggleSidebar = createAction(UI.TOGGLE_SIDEBAR);
export const setSidebarVisibility = createAction(UI.SET_SIDEBAR_VISIBILITY);
export const selectView = createAction(UI.SELECT_VIEW);
export const testUI = ({type:UI.TEST_UI, argu:true})
const initialState = {
sidebar: {
isOpen: false,
view: "subscriber"
}
}
export default handleActions({
[UI.TOGGLE_SIDEBAR]: (state, action) => ({
...state,
sidebar: {
...state.sidebar,
isOpen: !state.sidebar.isOpen
}
}),
[UI.SET_SIDEBAR_VISIBILITY]: (state, action) => ({
...state,
sidebar: {
...state.sidebar,
isOpen: action.payload
}
}),
[UI.SELECT_VIEW]: (state, action) => ({
...state,
sidebar: {
...state.sidebar,
view: action.payload
}
})
}, initialState);

View File

@@ -1,33 +0,0 @@
import { handleActions } from 'redux-actions';
import { UI } from 'actions/ui';
const initialState = {
sidebar: {
isOpen: false,
view: "subscriber"
}
}
export default handleActions({
[UI.TOGGLE_SIDEBAR]: (state, action) => ({
...state,
sidebar: {
...state.sidebar,
isOpen: !state.sidebar.isOpen
}
}),
[UI.SET_SIDEBAR_VISIBILITY]: (state, action) => ({
...state,
sidebar: {
...state.sidebar,
isOpen: action.payload
}
}),
[UI.SELECT_VIEW]: (state, action) => ({
...state,
sidebar: {
...state.sidebar,
view: action.payload
}
})
}, initialState);