Skip to content

Commit

Permalink
bblp help me debug zomg
Browse files Browse the repository at this point in the history
  • Loading branch information
Chow Hui Ling committed Jan 4, 2016
1 parent 8dd9f72 commit 4d8cc4f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions app/components/Notes.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
import React from 'react';
import Editable from './Editable.jsx';

export default class Notes extends React.Component {
render() {
const notes = this.props.notes;

// export default class Notes extends React.Component {
export default ({notes, onValueClick, onEdit, onDelete}) => {

// render() {
// const notes = this.props.notes;
// console.log(notes);
return (
<ul className="notes">{notes.map((note) => {
return (
<li className="note" key={note.id}>
<Editable value={note.task}
editing={note.editing}
onValueClick={this.props.onValueClick.bind(null, note.id)}
onEdit={this.props.onEdit.bind(null, note.id)}
onDelete={this.props.onDelete.bind(null, note.id)}/>
onValueClick={onValueClick.bind(null, note.id)}
onEdit={onEdit.bind(null, note.id)}
onDelete={onDelete.bind(null, note.id)}/>
</li>
);
})}
</ul>
);
}
// }
}
2 changes: 1 addition & 1 deletion app/stores/LaneStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class LaneStore {
detachFromLane({laneId, noteId}) {
const lanes = this.lanes.map((lane) => {
if (lane.id === laneId) {
lane.notes = lane.notes.filter((note) => note.id !== noteId);
lane.notes = lane.notes.filter((nid) => nid !== noteId);
}
return lane;
});
Expand Down
2 changes: 1 addition & 1 deletion app/stores/NoteStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class NoteStore {
constructor() {
//use bindActions to map each action in NoteActions to a method by name.
this.bindActions(NoteActions);
this.notes = [{id: uuid.v4(), task:'test'}];
this.notes = [];

//Alt uses this to access the public interface of the store.
this.exportPublicMethods({
Expand Down

0 comments on commit 4d8cc4f

Please sign in to comment.