Skip to content

Commit df12108

Browse files
committed
pushing styling before refactoring components
1 parent 0ee2d2e commit df12108

File tree

11 files changed

+64
-12
lines changed

11 files changed

+64
-12
lines changed

3-flux/documentation/Untitled.pdf

636 KB
Binary file not shown.

3-flux/documentation/data-flow.pdf

833 KB
Binary file not shown.

3-flux/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"webpack": "^1.12.9",
2222
"webpack-dev-server": "^1.14.1"
2323
},
24-
"devDependencies": {},
2524
"scripts": {
2625
"dev": "webpack-dev-server --content-base src --inline --hot"
2726
},

3-flux/src/assets/icon_trash.svg

Lines changed: 1 addition & 1 deletion
Loading

3-flux/src/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<!-- Custom Fonts -->
1515
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
1616
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
17+
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
1718
</head>
1819

1920
<body>

3-flux/src/js/components/NewTodo.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React from "react";
2+
3+
import * as TodoActions from "../actions/TodoActions";
4+
5+
export default class NewTodo extends React.Component {
6+
constructor(props) {
7+
super();
8+
}
9+
10+
render() {
11+
12+
return (
13+
14+
);
15+
}
16+
}

3-flux/src/js/components/layout/Nav.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ export default class Nav extends React.Component {
2222
const settingsClass = location.pathname.match(/^\/settings/) ? "active" : "";
2323
const navClass = collapsed ? "collapse" : "";
2424

25+
const navStyle = {
26+
backgroundColor: "#3C1053",
27+
backgroundImage: "none"
28+
};
29+
2530
return (
26-
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
31+
<nav style={navStyle} class="navbar navbar-inverse navbar-fixed-top" role="navigation">
2732
<div class="container">
2833
<div class="navbar-header">
2934
<button type="button" class="navbar-toggle" onClick={this.toggleCollapse.bind(this)} >

3-flux/src/js/pages/Layout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Nav from "../components/layout/Nav";
77
export default class Layout extends React.Component {
88
render() {
99
const { location } = this.props;
10-
10+
1111
const containerStyle = {
1212
marginTop: "60px"
1313
};

3-flux/src/js/pages/Todos.js

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React from "react";
22

33
import Todo from "../components/Todo";
4+
import NewTodo from "../components/Todo";
45
import * as TodoActions from "../actions/TodoActions";
56
import TodoStore from "../stores/TodoStore";
67

7-
88
export default class Todos extends React.Component {
99
constructor() {
1010
super();
@@ -35,6 +35,7 @@ export default class Todos extends React.Component {
3535

3636
// Start Anna Code
3737
addTodo(e) {
38+
console.log("??");
3839
e.preventDefault();
3940
TodoActions.createTodo(this.state.newTodo);
4041
this.setState({newTodo: ""});
@@ -57,13 +58,42 @@ export default class Todos extends React.Component {
5758
paddingLeft: "0"
5859
};
5960

61+
const headerStyling = {
62+
fontFamily: "Roboto",
63+
color: "#3C1053",
64+
marginBottom: "20px"
65+
};
66+
67+
const inputStyling = {
68+
borderRadius: "10px",
69+
borderStyle: "solid",
70+
borderWidth: "1px",
71+
borderColor: "#B19FBA",
72+
marginRight: "20px",
73+
minWidth: "200px",
74+
backgroundColor: "#D8CFDD",
75+
padding: "3px 15px 3px 15px"
76+
}
77+
78+
const formStyling = {
79+
paddingBottom: "10px"
80+
}
81+
82+
const standardButton = {
83+
borderRadius: "10px",
84+
borderStyle: "none",
85+
padding: "3px 15px 3px 15px",
86+
fontFamily: "Roboto",
87+
backgroundColor: "#765786",
88+
color: "#FFF"
89+
}
90+
6091
return (
6192
<div>
62-
<button onClick={this.reloadTodos.bind(this)}>Reload!</button>
63-
<h1>Todos</h1>
64-
<form>
65-
<input type="text" value={this.state.newTodo} onChange={this.handleChange.bind(this)}/>
66-
<button onClick={this.addTodo.bind(this)}>Add Todo</button>
93+
<h1 style={headerStyling}>A List of things To Do</h1>
94+
<form style={formStyling}>
95+
<input style={inputStyling} type="text" value={this.state.newTodo} onChange={this.handleChange.bind(this)}/>
96+
<button style={standardButton} onClick={this.addTodo.bind(this)}>Add New</button>
6797
</form>
6898
<ul style={customUl}>{TodoComponents}</ul>
6999
</div>

3-flux/src/js/stores/TodoStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class TodoStore extends EventEmitter {
2727
text,
2828
complete: false,
2929
});
30-
// this.emit("change");
30+
this.emit("change");
3131
}
3232

3333
deleteTodo(id) {

3-flux/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ module.exports = {
1616
presets: ['react', 'es2015', 'stage-0'],
1717
plugins: ['react-html-attrs', 'transform-class-properties', 'transform-decorators-legacy'],
1818
}
19-
}
19+
},
20+
{ test: /\.css$/, loader: "style-loader!css-loader" }
2021
]
2122
},
2223
output: {

0 commit comments

Comments
 (0)