Compare commits

..

1 Commits

Author SHA1 Message Date
stephengrider 44438c9c14 break store into separate file 2017-05-02 15:34:44 -07:00
13 changed files with 53 additions and 3885 deletions

View File

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/style/style.css">
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/48938155eb24b4ccdde09426066869504c6dab3c/dist/css/bootstrap.min.css">
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAq06l5RUVfib62IYRQacLc-KAy0XIWAVs"></script>
<script src="https://maps.googleapis.com/maps/api/js"></script>
</head>
<body>
<div class="container"></div>

3835
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -16,16 +16,22 @@
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"chai": "^3.5.0",
"chai-jquery": "^2.0.0",
"jquery": "^2.2.1",
"jsdom": "^8.1.0",
"mocha": "^2.4.5",
"react-addons-test-utils": "^0.14.7",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
},
"dependencies": {
"babel-preset-stage-1": "^6.1.18",
"lodash": "^3.10.1",
"react": "16.3.2",
"react-dom": "16.3.2",
"react-redux": "5.0.7",
"redux": "4.0.0",
"youtube-api-search": "0.0.5"
"react": "^0.14.3",
"react-dom": "^0.14.3",
"react-redux": "4.3.0",
"react-router": "^2.0.1",
"redux": "^3.0.4"
}
}

9
src/components/app.js Normal file
View File

@ -0,0 +1,9 @@
import React, { Component } from 'react';
export default class App extends Component {
render() {
return (
<div>React simple starter</div>
);
}
}

View File

@ -1,10 +0,0 @@
import React, { Component } from 'react';
class SearchBar extends Component {
render() {
return <input />;
}
}
// Export file (import in another file)
export default SearchBar;

View File

@ -1,22 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom';
import SearchBar from './components/search_bar';
import { Provider } from 'react-redux';
import App from './components/app';
import store from './store';
// Variable to hold the API key
const API_KEY = 'AIzaSyCV3vu9eXY75w23VFYZOAp1V5Rqk4gTD5E';
// Create a new component. This component should produce
// some HTML
const App = () => {
return (
<div>
<SearchBar />
</div>
);
}
// App = function() similar to App = () =>
// Take this component's generated HTML and
// put it on the page (in the DOM)
ReactDOM.render(<App />, document.querySelector('.container'));
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>
, document.querySelector('.container'));

7
src/reducers/index.js Normal file
View File

@ -0,0 +1,7 @@
import { combineReducers } from 'redux';
const rootReducer = combineReducers({
state: (state = {}) => state
});
export default rootReducer;

6
src/store.js Normal file
View File

@ -0,0 +1,6 @@
import { createStore, applyMiddleware } from 'redux';
import reducers from './reducers';
const createStoreWithMiddleware = applyMiddleware()(createStore);
export default createStoreWithMiddleware(reducers);

View File

@ -1,7 +1,7 @@
import _$ from 'jquery';
import React from 'react';
import ReactDOM from 'react-dom';
import TestUtils from 'react-dom/test-utils';
import TestUtils from 'react-addons-test-utils';
import jsdom from 'jsdom';
import chai, { expect } from 'chai';
import chaiJquery from 'chai-jquery';

View File

@ -1,30 +1,26 @@
module.exports = {
entry: ['./src/index.js'],
entry: [
'./src/index.js'
],
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [
{
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-1']
}
loaders: [{
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-1']
}
]
}]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
historyApiFallback: true,
contentBase: './',
watchOptions: {
aggregateTimeout: 300,
poll: 1000
}
contentBase: './'
}
};