diff --git a/App.js b/App.js index 136886f..15b753c 100644 --- a/App.js +++ b/App.js @@ -3,12 +3,23 @@ import Note from './Note.js'; function App(){ return { view: function(vnode){ -const {bin} = vnode.attrs; +// const {bin, notes} = vnode.attrs; +const bin = {id: 'egf35'}; +const notes = [ + {id: 'aaa', text: 'Note one'}, + {id: 'bbb', text: 'Note two'}, + {id: 'ccc', text: 'Note three'}, + {id: 'ddd', text: 'Note four'}, + {id: 'eee', text: 'Note five'}, + {id: 'fff', text: 'Note six'}, + {id: 'ggg', text: 'Note seven'}, + {id: 'hhh', text: 'Note eight'} + ]; return m('.app', [ m('.top', [ m('.top-left', [ m('button', {key: 'button'}, 'New Note...'), - m('input.search', {key: 'search'}, {value: ''}), + m('input.search', {key: 'search', value: ''}), m('select.sorting', {key: 'sorting'}, [ m('option', 'Newest -> Oldest'), m('option', 'Oldest -> Newest') diff --git a/Note.js b/Note.js new file mode 100644 index 0000000..8b4f3ad --- /dev/null +++ b/Note.js @@ -0,0 +1,13 @@ +function Note(){ +return { +view: function(vnode){ +const {note} = vnode.attrs; +return m('.note', [ + m('.text', note.text), + m('button', 'Edit') + ]); +} +}; +} + +export default Note; \ No newline at end of file