mirror of
https://github.com/zadam/trilium.git
synced 2026-02-17 03:04:24 +01:00
feat(mobile/tab_switcher): display note icon
This commit is contained in:
parent
325b8b886c
commit
bf0fc57493
@ -25,10 +25,15 @@
|
||||
}
|
||||
|
||||
header {
|
||||
padding: 0.5em 1em;
|
||||
padding: 0.4em 0.5em;
|
||||
border-bottom: 1px solid var(--main-border-color);
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
align-items: center;
|
||||
|
||||
>.tn-icon {
|
||||
margin-inline-end: 0.4em;
|
||||
}
|
||||
|
||||
.title {
|
||||
overflow: hidden;
|
||||
|
||||
@ -9,7 +9,8 @@ import NoteContext from "../../components/note_context";
|
||||
import { t } from "../../services/i18n";
|
||||
import { NoteContent } from "../collections/legacy/ListOrGridView";
|
||||
import { LaunchBarActionButton } from "../launch_bar/launch_bar_widgets";
|
||||
import { useActiveNoteContext, useTriliumEvent } from "../react/hooks";
|
||||
import { useActiveNoteContext, useNoteIcon, useTriliumEvent } from "../react/hooks";
|
||||
import Icon from "../react/Icon";
|
||||
import Modal from "../react/Modal";
|
||||
|
||||
export default function TabSwitcher() {
|
||||
@ -75,6 +76,7 @@ function Tab({ noteContext, selectTab, activeNtxId }: {
|
||||
activeNtxId: string | null | undefined;
|
||||
}) {
|
||||
const { note } = noteContext;
|
||||
const iconClass = useNoteIcon(note);
|
||||
|
||||
return (
|
||||
<div
|
||||
@ -84,6 +86,7 @@ function Tab({ noteContext, selectTab, activeNtxId }: {
|
||||
onClick={() => selectTab(noteContext)}
|
||||
>
|
||||
<header>
|
||||
<Icon icon={iconClass} />
|
||||
<span className="title">{noteContext.note?.title ?? t("tab_row.new_tab")}</span>
|
||||
</header>
|
||||
<div className={clsx("tab-preview", `type-${note?.type ?? "empty"}`)}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user