(historic notes) add history note page

This commit is contained in:
Julien Calixte
2021-08-08 00:19:49 +02:00
parent a3082f25bd
commit 9792e2e56b
4 changed files with 78 additions and 0 deletions

View File

@@ -6,6 +6,12 @@
> >
<img src="@/assets/icons/dark-left-arrow.svg" alt="go back left arrow" /> <img src="@/assets/icons/dark-left-arrow.svg" alt="go back left arrow" />
</router-link> </router-link>
<router-link
class="special-folder"
:to="{ name: 'HistoricNotes', params: { user, repo } }"
>
history
</router-link>
<router-link <router-link
class="special-folder" class="special-folder"
:to="{ name: 'SpacedRepetitionCard', params: { user, repo } }" :to="{ name: 'SpacedRepetitionCard', params: { user, repo } }"

View File

@@ -0,0 +1,16 @@
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
import { computed } from 'vue'
export const useNotes = () => {
const store = useUserRepoStore()
const notes = computed(() => {
console.log(store.files)
return store.files
})
return {
notes
}
}

View File

@@ -41,6 +41,15 @@ const routes: Array<RouteRecordRaw> = [
component: () => component: () =>
import(/* webpackChunkName: "draft-notes" */ '@/views/DraftNotes.vue') import(/* webpackChunkName: "draft-notes" */ '@/views/DraftNotes.vue')
}, },
{
path: '/:user/:repo/history',
name: 'HistoricNotes',
props: true,
component: () =>
import(
/* webpackChunkName: "historic-notes" */ '@/views/HistoricNotes.vue'
)
},
{ {
path: '/:user/:repo/spaced-repetition', path: '/:user/:repo/spaced-repetition',
name: 'SpacedRepetitionCard', name: 'SpacedRepetitionCard',

View File

@@ -0,0 +1,47 @@
<template>
<div class="historic-notes">
<flux-note
key="historic-notes"
:user="user"
:repo="repo"
:with-content="false"
>
<h3 class="subtitle is-3">History</h3>
{{ notes }}
</flux-note>
</div>
</template>
<script lang="ts">
import { useNotes } from '@/modules/note/hooks/useNotes'
import { defineAsyncComponent, defineComponent } from 'vue'
const FluxNote = defineAsyncComponent(() => import('@/components/FluxNote.vue'))
export default defineComponent({
name: 'HistoricNotes',
components: {
FluxNote
},
props: {
user: { type: String, required: true },
repo: { type: String, required: true }
},
setup() {
const notes = useNotes()
return { notes }
}
})
</script>
<style scoped lang="scss">
.historic-notes {
display: flex;
flex: 1;
.subtitle {
text-align: center;
}
}
</style>