diff --git a/frontend/components/Note.vue b/frontend/components/Note.vue index 4a0ae76..60dc718 100644 --- a/frontend/components/Note.vue +++ b/frontend/components/Note.vue @@ -1,40 +1,22 @@ - - - - - - Last updated {{ updatedAt }} - - - {{ title }} - - - - - - - {{ tag }} - - - - + + + {{ title }} + + Last updated {{ prettyDate }} + + + + {{ tag }} + + + diff --git a/frontend/pages/notes.vue b/frontend/pages/notes.vue index b346736..337f8a1 100644 --- a/frontend/pages/notes.vue +++ b/frontend/pages/notes.vue @@ -1,107 +1,40 @@ - - - - - - Notes - - - - New Note - - - - - {{ format(item.updatedAt) }} - - - - - {{ tag }} - - - - - - {{ mdiEye }} - - - {{ mdiPencil }} - - - {{ mdiDelete }} - - - - No notes yet - - - + + + + + + + + - - diff --git a/frontend/store/notes.js b/frontend/store/notes.js index ca1ab97..196d7bc 100644 --- a/frontend/store/notes.js +++ b/frontend/store/notes.js @@ -7,7 +7,7 @@ export const mutations = { state.notes = notes }, add(state, note) { - state.notes.push(note) + state.notes.unshift(note) }, delete(state, uuid) { state.notes = state.notes.filter((e) => e.uuid !== uuid) @@ -16,8 +16,7 @@ export const mutations = { export const actions = { async load({ commit }) { - await new Promise((resolve) => setTimeout(resolve, 2000)) - + await new Promise((resolve) => setTimeout(resolve, 600)) this.$axios.get('/notes').then(({ data }) => commit('set', data)) }, // FIXME: make the api send the new date back