Skip to content

Commit

Permalink
added a searchbar
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Jan 2, 2016
1 parent 879db70 commit 86be9d7
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 0 deletions.
3 changes: 3 additions & 0 deletions weather/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["react", "es2015", "stage-1"]
}
3 changes: 3 additions & 0 deletions weather/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/node_modules
bundle.js
npm-debug.log
12 changes: 12 additions & 0 deletions weather/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style/style.css">
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css">
<script src="https://maps.googleapis.com/maps/api/js"></script>
</head>
<body>
<div class="container"></div>
</body>
<script src="bundle.js"></script>
</html>
28 changes: 28 additions & 0 deletions weather/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "redux-simple-starter",
"version": "1.0.0",
"description": "Simple starter package for Redux with React and Babel support",
"main": "index.js",
"repository": "[email protected]:StephenGrider/ReduxSimpleStarter.git",
"scripts": {
"start": "./node_modules/webpack-dev-server/bin/webpack-dev-server.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.2.1",
"babel-loader": "^6.2.0",
"babel-preset-es2015": "^6.1.18",
"babel-preset-react": "^6.1.18",
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.0"
},
"dependencies": {
"babel-preset-stage-1": "^6.1.18",
"lodash": "^3.10.1",
"react": "^0.14.3",
"react-dom": "^0.14.3",
"react-redux": "^4.0.0",
"redux": "^3.0.4"
}
}
Empty file added weather/src/actions/index.js
Empty file.
14 changes: 14 additions & 0 deletions weather/src/components/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';
import { Component } from 'react';

import SearchBar from '../containers/search_bar';

export default class App extends Component {
render() {
return (
<div>
<SearchBar />
</div>
);
}
}
14 changes: 14 additions & 0 deletions weather/src/containers/search_bar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React, { Component } from 'react';

export default class SearchBar extends Component {
render() {
return (
<form className="input-group">
<input />
<span className="input-group-btn">
<button type="submit" className="btn btn-secondary">Submit</button>
</span>
</form>
);
}
}
15 changes: 15 additions & 0 deletions weather/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';

import App from './components/app';
import reducers from './reducers';

const createStoreWithMiddleware = applyMiddleware()(createStore);

ReactDOM.render(
<Provider store={createStoreWithMiddleware(reducers)}>
<App />
</Provider>
, document.querySelector('.container'));
7 changes: 7 additions & 0 deletions weather/src/reducers/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { combineReducers } from 'redux';

const rootReducer = combineReducers({
state: (state = {}) => state
});

export default rootReducer;
Empty file added weather/style/style.css
Empty file.
22 changes: 22 additions & 0 deletions weather/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
entry: [
'./src/index.js'
],
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
module: {
loaders: [{
exclude: /node_modules/,
loader: 'babel'
}]
},
resolve: {
extensions: ['', '.js', '.jsx']
},
devServer: {
contentBase: './'
}
};

0 comments on commit 86be9d7

Please sign in to comment.