mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 09:45:52 +01:00
fix(react/dialogs): formatting toolbar shown in code notes in quick edit
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useTriliumOption } from "../react/hooks";
|
||||
import { useNoteContext, useTriliumOption } from "../react/hooks";
|
||||
|
||||
/**
|
||||
* Handles the editing toolbar when the CKEditor is in decoupled mode.
|
||||
@@ -9,10 +9,16 @@ import { useTriliumOption } from "../react/hooks";
|
||||
*
|
||||
* ! The toolbar is not only used in the ribbon, but also in the quick edit feature.
|
||||
*/
|
||||
export default function FormattingToolbar() {
|
||||
export default function FormattingToolbar({ hidden }: { hidden?: boolean }) {
|
||||
const [ textNoteEditorType ] = useTriliumOption("textNoteEditorType");
|
||||
|
||||
return (textNoteEditorType === "ckeditor-classic" &&
|
||||
<div className="classic-toolbar-widget" />
|
||||
<div className={`classic-toolbar-widget ${hidden ? "hidden-ext" : ""}`} />
|
||||
)
|
||||
};
|
||||
};
|
||||
|
||||
export function PopupEditorFormattingToolbar() {
|
||||
// TODO: Integrate this directly once we migrate away from class components.
|
||||
const { note } = useNoteContext();
|
||||
return <FormattingToolbar hidden={note?.type !== "text"} />;
|
||||
}
|
||||
Reference in New Issue
Block a user