mirror of
https://github.com/zadam/trilium.git
synced 2025-12-16 05:09:54 +01:00
feat(layout/inline-title): support code
This commit is contained in:
@@ -20,6 +20,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.note-split.type-code:not(.mime-text-x-sqlite) .inline-title {
|
||||
background-color: var(--main-background-color);
|
||||
}
|
||||
|
||||
body.prefers-centered-content .inline-title {
|
||||
margin-inline: auto;
|
||||
}
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
import "./InlineTitle.css";
|
||||
|
||||
import { NoteType } from "@triliumnext/commons";
|
||||
import clsx from "clsx";
|
||||
import { ComponentChild } from "preact";
|
||||
import { useEffect, useRef, useState } from "preact/hooks";
|
||||
import { Trans } from "react-i18next";
|
||||
|
||||
import FNote from "../../entities/fnote";
|
||||
import { formatDateTime } from "../../utils/formatters";
|
||||
import NoteIcon from "../note_icon";
|
||||
import NoteTitleWidget from "../note_title";
|
||||
import { useNoteContext, useStaticTooltip } from "../react/hooks";
|
||||
import { ComponentChild } from "preact";
|
||||
import { joinElements } from "../react/react_utils";
|
||||
import { useNoteMetadata } from "../ribbon/NoteInfoTab";
|
||||
import { formatDateTime } from "../../utils/formatters";
|
||||
import { Trans } from "react-i18next";
|
||||
|
||||
const supportedNoteTypes = new Set<NoteType>([
|
||||
"text", "code"
|
||||
]);
|
||||
|
||||
export default function InlineTitle() {
|
||||
const { note, parentComponent } = useNoteContext();
|
||||
@@ -60,7 +65,7 @@ export default function InlineTitle() {
|
||||
|
||||
function shouldShow(note: FNote | null | undefined) {
|
||||
if (!note) return false;
|
||||
return note.type === "text";
|
||||
return supportedNoteTypes.has(note.type);
|
||||
}
|
||||
|
||||
export function NoteTitleDetails() {
|
||||
|
||||
@@ -59,11 +59,6 @@ body.experimental-feature-new-layout {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.note-split.type-code:not(.mime-text-x-sqlite) .title-details {
|
||||
background-color: var(--main-background-color);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
body.experimental-feature-floating-titlebar {
|
||||
|
||||
Reference in New Issue
Block a user