Add 'all bookmarks' link to bookmark folders list

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2024-09-26 09:54:02 +02:00
parent 44a7f8a485
commit a5689464d0
3 changed files with 40 additions and 11 deletions

View file

@ -9,11 +9,12 @@ library.add(
const BookmarkFolderCard = { const BookmarkFolderCard = {
props: [ props: [
'folder' 'folder',
'allBookmarks'
], ],
computed: { computed: {
firstLetter () { firstLetter () {
return this.folder.name[0] return this.folder ? this.folder.name[0] : null
} }
} }
} }

View file

@ -1,5 +1,25 @@
<template> <template>
<div class="bookmark-folder-card"> <div
v-if="allBookmarks"
class="bookmark-folder-card"
>
<router-link
:to="{ name: 'bookmarks' }"
class="bookmark-folder-name"
>
<span class="icon">
<FAIcon
fixed-width
class="fa-scale-110 menu-icon"
icon="bookmark"
/>
</span>{{ $t('nav.all_bookmarks') }}
</router-link>
</div>
<div
v-else
class="bookmark-folder-card"
>
<router-link <router-link
:to="{ name: 'bookmark-folder', params: { id: folder.id } }" :to="{ name: 'bookmark-folder', params: { id: folder.id } }"
class="bookmark-folder-name" class="bookmark-folder-name"
@ -44,27 +64,31 @@
align-items: center; align-items: center;
} }
.bookmark-folder-name { a.bookmark-folder-name {
display: flex;
align-items: center;
flex-grow: 1; flex-grow: 1;
.icon,
.iconLetter, .iconLetter,
.iconEmoji { .iconEmoji {
margin-right: 0.5em; display: inline-block;
}
.iconLetter {
height: 2.5rem; height: 2.5rem;
width: 2.5rem; width: 2.5rem;
margin-right: 0.5rem;
}
.icon,
.iconLetter {
font-size: 1.5rem; font-size: 1.5rem;
line-height: 2.5rem;
text-align: center;
} }
.iconEmoji { .iconEmoji {
display: inline-block;
text-align: center; text-align: center;
object-fit: contain; object-fit: contain;
vertical-align: middle; vertical-align: middle;
height: 2.5em;
width: 2.5em;
> span { > span {
font-size: 1.5rem; font-size: 1.5rem;

View file

@ -12,6 +12,10 @@
</router-link> </router-link>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<BookmarkFolderCard
:all-bookmarks="true"
class="list-item"
/>
<BookmarkFolderCard <BookmarkFolderCard
v-for="folder in bookmarkFolders.slice().reverse()" v-for="folder in bookmarkFolders.slice().reverse()"
:key="folder" :key="folder"