delete notes & sync to firebase

This commit is contained in:
2023-05-25 22:29:40 +02:00
parent 5a4bba2dcd
commit f6e5d5ca4f
10 changed files with 64 additions and 66 deletions

View File

@@ -20,8 +20,7 @@ const results = computed<Note[]>(() => {
return query.value ? findNotes(query.value) : notes.value
})
const goToNote = (note: Note, element?: HTMLElement) => {
console.log(element)
const goToNote = (note: Note) => {
setActiveNote(note.id)
active.value = false
if (queryElem.value) queryElem.value.blur()
@@ -75,7 +74,7 @@ const resultsRefs = ref<InstanceType<typeof SearchResult>[]>([])
:key="result.id"
:result="result"
:active-result="activeResult"
@go-to-note="(element) => goToNote(result, element)"
@go-to-note="goToNote(result)"
ref="resultsRefs"
/>
</template>

View File

@@ -28,7 +28,7 @@ const setViewMode = (viewMode: ViewMode) => {
<template>
<div
id="sidebar"
class="fixed bottom-0 top-0 flex max-sm:w-sidebar-mobile sm:w-sidebar flex-col gap-4 overflow-y-auto px-2 py-3 text-[90%] max-sm:text-[120%]"
class="fixed bottom-0 top-0 flex flex-col gap-4 overflow-y-auto px-2 py-3 text-[90%] max-sm:w-sidebar-mobile max-sm:gap-6 max-sm:text-[110%] sm:w-sidebar"
>
<SideBarMenu>
<template #header>Root note</template>

View File

@@ -6,7 +6,7 @@ const props = defineProps<{
</script>
<template>
<a
class="mt-1 block w-full cursor-pointer overflow-x-hidden text-ellipsis whitespace-nowrap rounded hover:bg-gray-200 active:bg-primary active:text-primary-content"
class="max-sm:mt-2 mt-1 block w-full cursor-pointer overflow-x-hidden text-ellipsis whitespace-nowrap rounded hover:bg-gray-200 active:bg-primary active:text-primary-content"
:class="props.active ? 'font-bold text-primary' : 'text-secondary'"
>
<i :class="props.icon" class="mr-2" v-if="props.icon"></i>