You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
import Note from './Note.js';
|
|
|
|
function App(){
|
|
return {
|
|
view: function(vnode){
|
|
// 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', {key: 'app'}, [
|
|
m('.top', {key: 'top'}, [
|
|
m('.top-left', {key: 'top-left'}, [
|
|
m('button', {key: 'button'}, 'New Note...'),
|
|
m('input.search', {key: 'search', value: ''}),
|
|
m('select.sorting', {key: 'sorting'}, [
|
|
m('option', {key: 'new-old'}, 'Newest -> Oldest'),
|
|
m('option', {key: 'old-new'}, 'Oldest -> Newest')
|
|
])
|
|
]),
|
|
m('.top-right', {key: 'top-right'}, [
|
|
m('.bin-id', {key: 'bin-id'}, bin.id),
|
|
m('button', {key: 'new-bin-button'}, 'New Bin...')
|
|
])
|
|
]),
|
|
m('.main', {key: 'main'}, [
|
|
m('.notes', notes.map(note =>
|
|
m(Note, {note, key: note.id})
|
|
))
|
|
])
|
|
]);
|
|
}
|
|
};
|
|
}
|
|
|
|
export default App; |