Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions 6-mobx-react/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ['react', 'es2015'],
"plugins": ['transform-decorators-legacy', 'transform-class-properties']
}
2 changes: 2 additions & 0 deletions 6-mobx-react/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.DS_Store
1 change: 1 addition & 0 deletions 6-mobx-react/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v6.3.0
28 changes: 28 additions & 0 deletions 6-mobx-react/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "react-mobx-todos",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --content-base src --inline --hot"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"react": "^15.2.1",
"react-dom": "^15.3.0"
},
"devDependencies": {
"babel-loader": "^6.2.4",
"babel-plugin-transform-class-properties": "^6.10.2",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"css-loader": "^0.23.1",
"react-addons-test-utils": "^15.3.0",
"style-loader": "^0.13.1",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1"
}
}
50 changes: 50 additions & 0 deletions 6-mobx-react/src/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
html,
body {
margin: 0;
padding: 0;
}

body {
font-family: 'Slabo 27px', serif;
background: #f5f5f5;
color: #4d4d4d;
min-width: 230px;
max-width: 550px;
margin: 0 auto;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
font-smoothing: antialiased;
font-weight: 300;
}

input {
border-radius: 5px;
padding: 5px;
border: 1px solid rgba(0,0,0,0.3);
margin-right: 10px
}

input::-webkit-input-placeholder {
font-style: italic;
font-weight: 300;
color: rgba(0,0,0,0.3);
}

input::-moz-placeholder {
font-style: italic;
font-weight: 300;
color: rgba(0,0,0,0.3);
}

input::input-placeholder {
font-style: italic;
font-weight: 300;
color: rgba(0,0,0,0.3);
}

h1 {
font-weight: 100;
font-size: 100px;
padding:0;
margin: 0;
}
9 changes: 9 additions & 0 deletions 6-mobx-react/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Slabo+27px" rel="stylesheet">
</head>
<body>
<div id="app"></div>
<script src="main.min.js"></script>
</body>
</html>
8 changes: 8 additions & 0 deletions 6-mobx-react/src/js/TodoList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from "react"


export default class TodoList extends React.Component {
render() {
return <h1>MobX</h1>
}
}
Empty file.
10 changes: 10 additions & 0 deletions 6-mobx-react/src/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import "../css/main.css"
import React from "react"
import ReactDOM from "react-dom"

import TodoList from "./TodoList"

const app = document.getElementById("app")

ReactDOM.render(<TodoList />, app)

28 changes: 28 additions & 0 deletions 6-mobx-react/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
var path = require('path');

module.exports = {
context: path.join(__dirname, "src"),
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/main.js",
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel-loader',
},
{ test: /\.css$/, loader: "style-loader!css-loader" },
]
},
output: {
path: path.join(__dirname, "src"),
filename: "main.min.js"
},
plugins: debug ? [] : [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }),
],
};