-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'universal-redux' into fullstack
- Loading branch information
Showing
25 changed files
with
259 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export const colors = { | ||
primary: ['#1976d2', '#2196f3', '#71bcf7', '#c2e2fb'], | ||
secondary: ['#c2185b', '#e91e63', '#f06292', '#f8bbd0'], | ||
danger: ['#d32f2f', '#f44336', '#f8877f', '#ffcdd2'], | ||
alert: ['#ffa000', '#ffc107', '#ffd761', '#ffecb3'], | ||
success: ['#388e3c', '#4caf50', '#7cc47f', '#c8e6c9'], | ||
grayscale: ['#212121', '#616161', '#9e9e9e', '#bdbdbd', '#e0e0e0', '#eeeeee', '#ffffff'] | ||
} | ||
|
||
export const reverseColors = {} | ||
|
||
Object.keys(colors).forEach((key) => { | ||
reverseColors[key] = [ ...colors[key] ].reverse() | ||
}) | ||
|
||
export const fonts = { | ||
primary: 'Helvetica Neue, Helvetica, Roboto, sans-serif', | ||
pre: 'Consolas, Liberation Mono, Menlo, Courier, monospace', | ||
quote: 'Georgia, serif' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
export * from './atoms' | ||
export * from './molecules' | ||
export * from './organisms' | ||
export * from './templates' | ||
export * from './pages' | ||
export App from './App' | ||
export Html from './Html' | ||
const req = require.context('.', true, /\.\/[^/]+\/[^/]+\/index\.js$/) | ||
|
||
req.keys().forEach((key) => { | ||
const componentName = key.replace(/^.+\/([^/]+)\/index\.js/, '$1') | ||
module.exports[componentName] = req(key).default | ||
}) |
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const req = require.context('.', false, /^((?!index).)*$/) | ||
|
||
req.keys().forEach((key) => { | ||
const containerName = key.replace(/^\.\/([^.]+)\.js$/, '$1') | ||
module.exports[containerName] = req(key).default | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import forIn from 'lodash/forIn' | ||
|
||
const req = require.context('.', true, /\.\/.+\/actions\.js$/) | ||
|
||
req.keys().forEach((key) => { | ||
const actions = req(key) | ||
|
||
forIn(actions, (action, name) => { | ||
module.exports[name] = action | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { combineReducers } from 'redux' | ||
import { routerReducer as routing } from 'react-router-redux' | ||
import { reducer as form } from 'redux-form' | ||
|
||
const reducers = { | ||
routing, | ||
form | ||
} | ||
|
||
const req = require.context('.', true, /\.\/.+\/reducer\.js$/) | ||
|
||
req.keys().forEach((key) => { | ||
const storeName = key.replace(/\.\/(.+)\/.+$/, '$1') | ||
reducers[storeName] = req(key).default | ||
}) | ||
|
||
export default combineReducers(reducers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { fork } from 'redux-saga/effects' | ||
|
||
const req = require.context('.', true, /\.\/.+\/sagas\.js$/) | ||
|
||
const sagas = [] | ||
|
||
req.keys().forEach((key) => { | ||
sagas.push(req(key).default) | ||
}) | ||
|
||
export default function* () { | ||
yield sagas.map(fork) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import upperFirst from 'lodash/upperFirst' | ||
import forIn from 'lodash/forIn' | ||
|
||
const req = require.context('.', true, /\.\/.+\/selectors\.js$/) | ||
|
||
req.keys().forEach((key) => { | ||
const storeName = key.replace(/\.\/(.+)\/.+$/, '$1') | ||
const fromName = `from${upperFirst(storeName)}` | ||
const selectors = req(key) | ||
const getState = (state = {}) => state[storeName] || {} | ||
|
||
module.exports[fromName] = {} | ||
|
||
forIn(selectors, (selector, name) => { | ||
if (typeof selector === 'function') { | ||
module.exports[fromName][name] = (state, ...args) => selector(getState(state), ...args) | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.