Skip to content

New component #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
pushing styling before refactoring components
  • Loading branch information
annapanana committed Mar 22, 2017
commit df12108c212dd6bb1fee098d0ec9eb711741fe37
Binary file added 3-flux/documentation/Untitled.pdf
Binary file not shown.
Binary file added 3-flux/documentation/data-flow.pdf
Binary file not shown.
1 change: 0 additions & 1 deletion 3-flux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"webpack": "^1.12.9",
"webpack-dev-server": "^1.14.1"
},
"devDependencies": {},
"scripts": {
"dev": "webpack-dev-server --content-base src --inline --hot"
},
Expand Down
2 changes: 1 addition & 1 deletion 3-flux/src/assets/icon_trash.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions 3-flux/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<!-- Custom Fonts -->
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
</head>

<body>
Expand Down
16 changes: 16 additions & 0 deletions 3-flux/src/js/components/NewTodo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from "react";

import * as TodoActions from "../actions/TodoActions";

export default class NewTodo extends React.Component {
constructor(props) {
super();
}

render() {

return (

);
}
}
7 changes: 6 additions & 1 deletion 3-flux/src/js/components/layout/Nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ export default class Nav extends React.Component {
const settingsClass = location.pathname.match(/^\/settings/) ? "active" : "";
const navClass = collapsed ? "collapse" : "";

const navStyle = {
backgroundColor: "#3C1053",
backgroundImage: "none"
};

return (
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<nav style={navStyle} class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" onClick={this.toggleCollapse.bind(this)} >
Expand Down
2 changes: 1 addition & 1 deletion 3-flux/src/js/pages/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Nav from "../components/layout/Nav";
export default class Layout extends React.Component {
render() {
const { location } = this.props;

const containerStyle = {
marginTop: "60px"
};
Expand Down
42 changes: 36 additions & 6 deletions 3-flux/src/js/pages/Todos.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from "react";

import Todo from "../components/Todo";
import NewTodo from "../components/Todo";
import * as TodoActions from "../actions/TodoActions";
import TodoStore from "../stores/TodoStore";


export default class Todos extends React.Component {
constructor() {
super();
Expand Down Expand Up @@ -35,6 +35,7 @@ export default class Todos extends React.Component {

// Start Anna Code
addTodo(e) {
console.log("??");
e.preventDefault();
TodoActions.createTodo(this.state.newTodo);
this.setState({newTodo: ""});
Expand All @@ -57,13 +58,42 @@ export default class Todos extends React.Component {
paddingLeft: "0"
};

const headerStyling = {
fontFamily: "Roboto",
color: "#3C1053",
marginBottom: "20px"
};

const inputStyling = {
borderRadius: "10px",
borderStyle: "solid",
borderWidth: "1px",
borderColor: "#B19FBA",
marginRight: "20px",
minWidth: "200px",
backgroundColor: "#D8CFDD",
padding: "3px 15px 3px 15px"
}

const formStyling = {
paddingBottom: "10px"
}

const standardButton = {
borderRadius: "10px",
borderStyle: "none",
padding: "3px 15px 3px 15px",
fontFamily: "Roboto",
backgroundColor: "#765786",
color: "#FFF"
}

return (
<div>
<button onClick={this.reloadTodos.bind(this)}>Reload!</button>
<h1>Todos</h1>
<form>
<input type="text" value={this.state.newTodo} onChange={this.handleChange.bind(this)}/>
<button onClick={this.addTodo.bind(this)}>Add Todo</button>
<h1 style={headerStyling}>A List of things To Do</h1>
<form style={formStyling}>
<input style={inputStyling} type="text" value={this.state.newTodo} onChange={this.handleChange.bind(this)}/>
<button style={standardButton} onClick={this.addTodo.bind(this)}>Add New</button>
</form>
<ul style={customUl}>{TodoComponents}</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion 3-flux/src/js/stores/TodoStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TodoStore extends EventEmitter {
text,
complete: false,
});
// this.emit("change");
this.emit("change");
}

deleteTodo(id) {
Expand Down
3 changes: 2 additions & 1 deletion 3-flux/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module.exports = {
presets: ['react', 'es2015', 'stage-0'],
plugins: ['react-html-attrs', 'transform-class-properties', 'transform-decorators-legacy'],
}
}
},
{ test: /\.css$/, loader: "style-loader!css-loader" }
]
},
output: {
Expand Down