Skip to content

Commit 2f252b2

Browse files
committed
init commit
0 parents  commit 2f252b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+5060
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# See https://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
.idea
4+
node_modules/

README.md

Lines changed: 1623 additions & 0 deletions
Large diffs are not rendered by default.

build/asset-manifest.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"main.css": "static/css/main.9a0fe4f1.css",
3+
"main.css.map": "static/css/main.9a0fe4f1.css.map",
4+
"main.js": "static/js/main.b47d4a60.js",
5+
"main.js.map": "static/js/main.b47d4a60.js.map",
6+
"static/media/logo.svg": "static/media/logo.5d5d9eef.svg"
7+
}

build/bootstrap.min.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/favicon.ico

24.3 KB
Binary file not shown.

build/font-awesome.css.map

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/font-awesome.min.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/fonts/FontAwesome.otf

132 KB
Binary file not shown.

build/fonts/fontawesome-webfont.eot

162 KB
Binary file not shown.

build/fonts/fontawesome-webfont.svg

Lines changed: 2671 additions & 0 deletions
Loading

build/fonts/fontawesome-webfont.ttf

162 KB
Binary file not shown.

build/fonts/fontawesome-webfont.woff

95.7 KB
Binary file not shown.

build/fonts/fontawesome-webfont.woff2

75.4 KB
Binary file not shown.

build/index.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width,initial-scale=1">
6+
<link rel="shortcut icon" href="/favicon.ico">
7+
<title>React App</title>
8+
<link href="/static/css/main.9a0fe4f1.css" rel="stylesheet">
9+
<link href="./font-awesome.min.css" rel="stylesheet">
10+
<link href="./bootstrap.min.css" rel="stylesheet">
11+
</head>
12+
<body>
13+
<div id="root"></div>
14+
<script type="text/javascript" src="/static/js/main.b47d4a60.js"></script>
15+
</body>
16+
</html>

build/static/css/main.9a0fe4f1.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/static/css/main.9a0fe4f1.css.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/static/js/main.b47d4a60.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/static/js/main.b47d4a60.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/static/media/logo.5d5d9eef.svg

Lines changed: 7 additions & 0 deletions
Loading

package.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"name": "my-app",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"babel-core": "^6.10.4",
7+
"babel-loader": "^6.2.4",
8+
"babel-polyfill": "^6.9.1",
9+
"babel-preset-es2015": "^6.9.0",
10+
"babel-preset-react": "^6.11.1",
11+
"babel-register": "^6.9.0",
12+
"bootstrap": "^3.3.7",
13+
"cross-env": "^1.0.8",
14+
"css-loader": "^0.23.1",
15+
"expect": "^1.20.1",
16+
"font-awesome": "^4.7.0",
17+
"material-ui": "^0.17.3",
18+
"node-libs-browser": "^1.0.0",
19+
"node-sass": "^3.8.0",
20+
"react": "^15.1.0",
21+
"react-addons-test-utils": "^15.1.0",
22+
"react-dom": "^15.1.0",
23+
"react-intl": "^2.2.3",
24+
"react-redux": "^4.4.5",
25+
"react-tap-event-plugin": "^2.0.1",
26+
"redux": "^3.5.2",
27+
"redux-logger": "^2.6.1",
28+
"redux-promise": "^0.5.3",
29+
"redux-thunk": "^2.1.0",
30+
"sass-loader": "^4.0.0",
31+
"style-loader": "^0.13.1",
32+
"webpack": "^1.13.1",
33+
"webpack-dev-middleware": "^1.6.1",
34+
"webpack-dev-server": "^1.14.1",
35+
"webpack-hot-middleware": "^2.11.0"
36+
},
37+
"devDependencies": {
38+
"react-scripts": "0.9.5"
39+
},
40+
"scripts": {
41+
"start": "react-scripts start",
42+
"build": "react-scripts build",
43+
"test": "react-scripts test --env=jsdom",
44+
"eject": "react-scripts eject"
45+
}
46+
}

public/favicon.ico

24.3 KB
Binary file not shown.

public/index.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
7+
<!--
8+
Notice the use of %PUBLIC_URL% in the tag above.
9+
It will be replaced with the URL of the `public` folder during the build.
10+
Only files inside the `public` folder can be referenced from the HTML.
11+
12+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
13+
work correctly both with client-side routing and a non-root public URL.
14+
Learn how to configure a non-root public URL by running `npm run build`.
15+
-->
16+
<title>React App</title>
17+
</head>
18+
<body>
19+
<div id="root"></div>
20+
<!--
21+
This HTML file is a template.
22+
If you open it directly in the browser, you will see an empty page.
23+
24+
You can add webfonts, meta tags, or analytics to this file.
25+
The build step will place the bundled scripts into the <body> tag.
26+
27+
To begin the development, run `npm start`.
28+
To create a production bundle, use `npm run build`.
29+
-->
30+
</body>
31+
</html>

src/App.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.App {
2+
text-align: center;
3+
}
4+
5+
.App-logo {
6+
animation: App-logo-spin infinite 20s linear;
7+
height: 80px;
8+
}
9+
10+
.App-header {
11+
background-color: #222;
12+
height: 150px;
13+
padding: 20px;
14+
color: white;
15+
}
16+
17+
.App-intro {
18+
font-size: large;
19+
}
20+
21+
@keyframes App-logo-spin {
22+
from { transform: rotate(0deg); }
23+
to { transform: rotate(360deg); }
24+
}

src/App.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React, { Component } from 'react';
2+
import logo from './logo.svg';
3+
import './App.css';
4+
5+
class App extends Component {
6+
render() {
7+
return (
8+
<div className="App">
9+
<div className="App-header">
10+
<img src={logo} className="App-logo" alt="logo" />
11+
<h2>Welcome to React</h2>
12+
</div>
13+
<p className="App-intro">
14+
To get started, edit <code>src/App.js</code> and save to reload.
15+
</p>
16+
</div>
17+
);
18+
}
19+
}
20+
21+
export default App;

src/App.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import React from 'react';
2+
import ReactDOM from 'react-dom';
3+
import App from './App';
4+
5+
it('renders without crashing', () => {
6+
const div = document.createElement('div');
7+
ReactDOM.render(<App />, div);
8+
});

src/actions/index.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Created by dinhceo on 08/04/2017.
3+
*/
4+
import {ADD_TODO, TOGGLE_TODO, RESET_TODO} from './todoActionType';
5+
import {VisibilityFilters, SET_VISIBILITY_FILTER} from './searchTodoType';
6+
7+
8+
export function addTodo(text) {
9+
return {
10+
type : ADD_TODO,
11+
text
12+
}
13+
}
14+
15+
export function resetTodo() {
16+
return {
17+
type : RESET_TODO
18+
}
19+
}
20+
21+
export function toggleTodo(index) {
22+
return {
23+
type : TOGGLE_TODO,
24+
index
25+
}
26+
}
27+
28+
export function setVisibilityFilter(filter) {
29+
return {
30+
type : SET_VISIBILITY_FILTER,
31+
filter
32+
}
33+
}

src/actions/searchTodoType.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Created by dinhceo on 08/04/2017.
3+
*/
4+
export const SET_VISIBILITY_FILTER = 'SET_VISIBILITY_FILTER';
5+
export const VisibilityFilters = {
6+
SHOW_ALL : 'SHOW_ALL',
7+
SHOW_COMPLETED : 'SHOW_COMPLETED',
8+
SHOW_ACTIVE : 'SHOW_ACTIVE'
9+
};

src/actions/todoActionType.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Created by dinhceo on 08/04/2017.
3+
*/
4+
export const ADD_TODO = 'ADD_TODO';
5+
export const TOGGLE_TODO = 'TOGGLE_TODO';
6+
export const RESET_TODO = 'RESET_TODO';
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import React from 'react';
2+
import LinearProgress from 'material-ui/LinearProgress';
3+
4+
class LinearProgressExampleDeterminate extends React.Component {
5+
6+
constructor(props) {
7+
super(props);
8+
9+
this.state = {
10+
completed : 0,
11+
};
12+
}
13+
14+
componentDidMount() {
15+
this.timer = setTimeout(() => this.progress(60), 500);
16+
}
17+
18+
componentWillUnmount() {
19+
clearTimeout(this.timer);
20+
}
21+
22+
progress(completed) {
23+
if (completed > 100) {
24+
this.setState({completed : 100});
25+
} else {
26+
this.setState({completed});
27+
const diff = Math.random() * 10;
28+
this.timer = setTimeout(() => this.progress(completed + diff), 500);
29+
}
30+
}
31+
32+
render() {
33+
return (
34+
<LinearProgress mode="determinate" value={this.state.completed}/>
35+
);
36+
}
37+
}
38+
export default LinearProgressExampleDeterminate;
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React from 'react';
2+
import {connect} from 'react-redux'
3+
import {addTodo} from '../../actions/index'
4+
import TextField from 'material-ui/TextField'
5+
import RaisedButton from 'material-ui/RaisedButton';
6+
import './addTodoStyle.css'
7+
8+
9+
class AddTodo extends React.Component {
10+
constructor(props) {
11+
super(props);
12+
this.state = {
13+
value : ''
14+
};
15+
this.handleInput = this.handleInput.bind(this);
16+
this.onSubmit = this.onSubmit.bind(this);
17+
}
18+
19+
handleInput(e) {
20+
this.setState({value : e.target.value});
21+
}
22+
23+
onSubmit(e) {
24+
let {dispatch} = this.props;
25+
e.preventDefault();
26+
if (!this.state.value) {
27+
return;
28+
}
29+
dispatch(addTodo(this.state.value));
30+
this.setState({value : ''});
31+
}
32+
33+
render() {
34+
return (
35+
<div>
36+
<form onSubmit={this.onSubmit} className="form-group">
37+
<TextField floatingLabelText="Enter your item todo!" fullWidth={true} type="text" value={this.state.value} onChange={this.handleInput}
38+
hintText="Enter your item todo!"/>
39+
<br/>
40+
<RaisedButton className="btn-add-todo" type="submit" label="Add todo" primary={true}/>
41+
</form>
42+
</div>
43+
);
44+
}
45+
}
46+
47+
export default connect()(AddTodo);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.btn-add-todo {
2+
text-transform: none;
3+
margin-left: 73px;
4+
}

src/components/appComponent.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Created by dinhceo on 11/04/2017.
3+
*/
4+
import React from 'react'
5+
import Header from './header/headerComponent'
6+
import AddTodo from './addTodo/addTodoComponent'
7+
import ListTodo from './todos/listTodoComponent'
8+
import FilterTodo from './filterTodo/filterTodoComponent'
9+
import Footer from './footer/footerComponent'
10+
import LinearProgress from './LinearProgressComponent/index';
11+
12+
const style = {
13+
marginTop : 100
14+
};
15+
16+
17+
const App = () => (
18+
<div className="container-fluid">
19+
<Header />
20+
<div className="row">
21+
<div className="col-md-4"/>
22+
<div className="col-md-6">
23+
<br/>
24+
<AddTodo />
25+
<ListTodo />
26+
<FilterTodo />
27+
</div>
28+
<div className="col-md-2"/>
29+
</div>
30+
<div className="row" style={style}>
31+
<Footer />
32+
</div>
33+
</div>
34+
);
35+
36+
export default App

0 commit comments

Comments
 (0)