mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-10 03:53:37 -06:00
chore(react/ribbon): fix 3px height of the ribbon when collapsed
This commit is contained in:
parent
82bdb76d75
commit
3a3fed4314
@ -1,4 +1,3 @@
|
|||||||
import { CSSProperties } from "preact/compat";
|
|
||||||
import { useTriliumOption } from "../react/hooks";
|
import { useTriliumOption } from "../react/hooks";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,17 +9,10 @@ import { useTriliumOption } from "../react/hooks";
|
|||||||
*
|
*
|
||||||
* ! The toolbar is not only used in the ribbon, but also in the quick edit feature.
|
* ! The toolbar is not only used in the ribbon, but also in the quick edit feature.
|
||||||
*/
|
*/
|
||||||
export default function FormattingToolbar({ hidden }: { hidden?: boolean }) {
|
export default function FormattingToolbar() {
|
||||||
const [ textNoteEditorType ] = useTriliumOption("textNoteEditorType");
|
const [ textNoteEditorType ] = useTriliumOption("textNoteEditorType");
|
||||||
|
|
||||||
const style: CSSProperties = {};
|
|
||||||
if (hidden) {
|
|
||||||
style.display = "none";
|
|
||||||
}
|
|
||||||
|
|
||||||
return (textNoteEditorType === "ckeditor-classic" &&
|
return (textNoteEditorType === "ckeditor-classic" &&
|
||||||
<div className="classic-toolbar-widget" style={style}>
|
<div className="classic-toolbar-widget" />
|
||||||
|
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
@ -214,28 +214,30 @@ export default function Ribbon() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="ribbon-body-container">
|
<div className="ribbon-body-container">
|
||||||
<div className="ribbon-body">
|
{filteredTabs.map(tab => {
|
||||||
{filteredTabs.map(tab => {
|
const isActive = tab.index === activeTabIndex;
|
||||||
const isActive = tab.index === activeTabIndex;
|
if (!isActive && !tab.stayInDom) {
|
||||||
if (!isActive && !tab.stayInDom) {
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return tab?.content && tab.content({
|
return (
|
||||||
note,
|
<div className={`ribbon-body ${!isActive ? "hidden-ext" : ""}`}>
|
||||||
hidden: !isActive,
|
{tab?.content && tab.content({
|
||||||
ntxId,
|
note,
|
||||||
hoistedNoteId,
|
hidden: !isActive,
|
||||||
notePath,
|
ntxId,
|
||||||
noteContext,
|
hoistedNoteId,
|
||||||
componentId,
|
notePath,
|
||||||
activate: useCallback(() => {
|
noteContext,
|
||||||
setActiveTabIndex(tab.index)
|
componentId,
|
||||||
}, [setActiveTabIndex])
|
activate: useCallback(() => {
|
||||||
});
|
setActiveTabIndex(tab.index)
|
||||||
})}
|
}, [setActiveTabIndex])
|
||||||
</div>
|
})}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user