fix(collections): collection properties not shown if there are no children

This commit is contained in:
Elian Doran 2026-02-15 18:03:36 +02:00
parent cc097c5414
commit 70aa115933
No known key found for this signature in database
2 changed files with 15 additions and 8 deletions

View File

@ -5,7 +5,7 @@
align-items: center;
width: 100%;
max-width: unset;
font-size: 0.8em;
font-size: 0.8rem;
.dropdown-menu {
input.form-control {

View File

@ -1,11 +1,14 @@
import "./Book.css";
import { useEffect, useState } from "preact/hooks";
import { t } from "../../services/i18n";
import { ViewTypeOptions } from "../collections/interface";
import CollectionProperties from "../note_bars/CollectionProperties";
import Alert from "../react/Alert";
import { useNoteLabelWithDefault, useTriliumEvent } from "../react/hooks";
import RawHtml from "../react/RawHtml";
import { TypeWidgetProps } from "./type_widget";
import "./Book.css";
import { useEffect, useState } from "preact/hooks";
import { ViewTypeOptions } from "../collections/interface";
const VIEW_TYPES: ViewTypeOptions[] = [ "list", "grid", "presentation" ];
@ -27,10 +30,14 @@ export default function Book({ note }: TypeWidgetProps) {
return (
<>
{shouldDisplayNoChildrenWarning && (
<Alert type="warning" className="note-detail-book-empty-help">
<RawHtml html={t("book.no_children_help")} />
</Alert>
<>
<CollectionProperties note={note} />
<Alert type="warning" className="note-detail-book-empty-help">
<RawHtml html={t("book.no_children_help")} />
</Alert>
</>
)}
</>
)
);
}