Merge branch 'main' of github.com:lite-note/lite-note into main

This commit is contained in:
2021-04-03 23:23:18 +02:00
7 changed files with 35 additions and 15 deletions

View File

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-rotate-clockwise" width="24" height="24" viewBox="0 0 24 24" stroke="#3b7e70" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M4.05 11a8 8 0 1 1 .5 4m-.5 5v-5h5" />
</svg>

After

Width:  |  Height:  |  Size: 343 B

View File

@@ -1,5 +1,5 @@
<template> <template>
<main class="flux-note content note-container" v-if="!isLoading"> <main class="flux-note content note-container">
<div class="note readme"> <div class="note readme">
<header-note class="header" :user="user" :repo="repo" /> <header-note class="header" :user="user" :repo="repo" />
<div class="repo-title-breadcrumb"> <div class="repo-title-breadcrumb">
@@ -18,7 +18,14 @@
</h4> </h4>
</div> </div>
<slot /> <slot />
<div v-if="!hasContent"> <div v-if="isLoading" class="loading">
<img
class="is-loading"
src="@/assets/icons/loading.svg"
alt="loading..."
/>
</div>
<div v-else-if="!hasContent">
No content here 📝 No content here 📝
</div> </div>
<p class="note-display" v-html="renderedContent"></p> <p class="note-display" v-html="renderedContent"></p>
@@ -201,6 +208,17 @@ $header-height: 40px;
max-width: 620px; max-width: 620px;
} }
} }
.loading {
display: flex;
flex: 1;
justify-content: center;
align-items: center;
.is-loading {
animation: spinAround 0.8s infinite linear;
}
}
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {

View File

@@ -10,13 +10,13 @@
class="special-folder" class="special-folder"
:to="{ name: 'DraftNotes', params: { user, repo } }" :to="{ name: 'DraftNotes', params: { user, repo } }"
> >
Draft draft
</router-link> </router-link>
<router-link <router-link
class="special-folder" class="special-folder"
:to="{ name: 'FleetingNotes', params: { user, repo } }" :to="{ name: 'FleetingNotes', params: { user, repo } }"
> >
Fleeting notes inbox
</router-link> </router-link>
</header> </header>
</template> </template>

View File

@@ -10,12 +10,12 @@ export const useFocus = () => {
const { stackedNotes } = useQueryStackedNotes() const { stackedNotes } = useQueryStackedNotes()
const scrollToFocusedNote = (sha?: string, backToTop?: boolean) => { const scrollToFocusedNote = (sha?: string, backToTop?: boolean) => {
if (!sha) { if (backToTop) {
scrollToNote(0)
return return
} }
if (backToTop) { if (!sha) {
scrollToNote(0)
return return
} }

View File

@@ -11,11 +11,11 @@ export const useFolderNotes = (folder: string) => {
) )
const content = computed(() => const content = computed(() =>
fleetingNotes.value?.length fleetingNotes.value?.length > 0
? fleetingNotes.value ? fleetingNotes.value
.map((note) => `- [${note.path}](${note.path})`) .map((note) => `- [${note.path}](${note.path})`)
.join('\n') .join('\n')
: '' : null
) )
return { return {

View File

@@ -27,13 +27,11 @@ const routes: Array<RouteRecordRaw> = [
component: Home component: Home
}, },
{ {
path: '/:user/:repo/fleeting-notes', path: '/:user/:repo/inbox',
name: 'FleetingNotes', name: 'FleetingNotes',
props: true, props: true,
component: () => component: () =>
import( import(/* webpackChunkName: "inbox" */ '@/views/FleetingNotes.vue')
/* webpackChunkName: "fleeting-notes" */ '@/views/FleetingNotes.vue'
)
}, },
{ {
path: '/:user/:repo/draft', path: '/:user/:repo/draft',

View File

@@ -7,7 +7,7 @@
key="fleeting-notes" key="fleeting-notes"
> >
<h3 class="subtitle is-3"> <h3 class="subtitle is-3">
Fleeting notes Inbox
</h3> </h3>
</flux-note> </flux-note>
</div> </div>
@@ -19,7 +19,7 @@ import { defineAsyncComponent, defineComponent } from 'vue'
const FluxNote = defineAsyncComponent(() => import('@/components/FluxNote.vue')) const FluxNote = defineAsyncComponent(() => import('@/components/FluxNote.vue'))
const FLEETING_NOTES_FOLDER = 'fleeting-notes' const FLEETING_NOTES_FOLDER = 'inbox'
export default defineComponent({ export default defineComponent({
name: 'FleetingNotes', name: 'FleetingNotes',