This file contains hidden or 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
/** | |
* React Starter Kit (http://www.reactstarterkit.com/) | |
* | |
* Copyright © 2014-2015 Kriasoft, LLC. All rights reserved. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE.txt file in the root directory of this source tree. | |
*/ | |
import path from 'path'; |
This file contains hidden or 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
@import "./variables.import"; | |
.box { | |
background: var(--yellow); | |
} |
This file contains hidden or 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
export function actionTypeBuilder(prefix) { | |
return { | |
type: actionType => `${prefix}/${actionType}`, | |
loading: actionType => `${actionType}/loading`, | |
ready: actionType => `${actionType}/ready`, | |
stopped: actionType => `${actionType}/stopped`, | |
changed: actionType => `${actionType}/changed`, | |
error: actionType => `${actionType}/error`, | |
success: actionType => `${actionType}/success` | |
}; |
This file contains hidden or 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
var webpack = require('webpack'); | |
var ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
var babelSettings = { presets: ['react', 'es2015', 'stage-0'] }; | |
babelSettings.plugins = ['transform-decorators-legacy']; | |
if (process.env.NODE_ENV !== 'production' && !process.env.IS_MIRROR) { | |
babelSettings.plugins.push(['react-transform', { | |
transforms: [{ | |
transform: 'react-transform-hmr', |
This file contains hidden or 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
// server/index.jsx | |
import React from 'react'; | |
/* don't pay attention to the 3 lines below */ | |
import { Provider } from 'react-redux'; | |
import { syncHistoryWithStore } from 'react-router-redux'; | |
import { configureStore } from 'common/client/redux/store/'; | |
import { |
This file contains hidden or 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
import posts from './postData'; | |
export default [ | |
{ | |
name: 'home', | |
path: '/', | |
onActivate: () => | |
Promise.resolve({ | |
posts: posts.map(({ content, ...rest }) => rest) | |
}) |
This file contains hidden or 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
export default [ | |
{ | |
id: '1', | |
image: 'zlatan.jpg', | |
title: 'Zlatan Ibrahimovic', | |
content: `Zlatan Ibrahimović is a Swedish professional footballer who plays as a forward for LA Galaxy. He was also a member of the Sweden national team from 2001 to 2016, serving as captain from 2010 until his retirement. Primarily a striker, he is a prolific goalscorer, who is best known for his technique, creativity, strength, ability in the air, and his powerful and accurate striking ability. He is currently the second-most decorated active footballer in the world, having won 32 trophies in his career.` | |
}, | |
{ | |
id: '2', | |
image: 'messi.jpg', |
This file contains hidden or 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
import transitionPath from 'router5-transition-path'; | |
export default routes => router => (toState, fromState) => { | |
const { toActivate } = transitionPath(toState, fromState); | |
const onActivateHandlers = toActivate | |
.map(segment => | |
routes.find(r => r.name === segment).onActivate(toState.params) | |
) | |
.filter(Boolean); |
This file contains hidden or 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
import createRouter from 'router5'; | |
import browserPlugin from 'router5/plugins/browser'; | |
import loggerPlugin from 'router5/plugins/logger'; | |
export default function configureRouter(routes, options = {}) { | |
const router = createRouter(routes, options) | |
// Plugins | |
.usePlugin(browserPlugin({ useHash: false })); | |
if (process.env.NODE_ENV === 'development') router.usePlugin(loggerPlugin); |
This file contains hidden or 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
import { applyMiddleware, compose, createStore } from 'redux'; | |
import { router5Middleware } from 'redux-router5'; | |
import { createLogger } from 'redux-logger'; | |
import rootReducer from './actions'; | |
const enhancers = []; | |
if (process.env.NODE_ENV === 'development') { | |
const devToolsExtension = window.devToolsExtension; |
OlderNewer