mirror of
https://github.com/zadam/trilium.git
synced 2025-12-23 16:49:58 +01:00
feat(layout): add a margin for custom note action buttons
This commit is contained in:
@@ -6,20 +6,33 @@ import ActionButton from "../react/ActionButton";
|
|||||||
import { FormFileUploadActionButton } from "../react/FormFileUpload";
|
import { FormFileUploadActionButton } from "../react/FormFileUpload";
|
||||||
import { buildUploadNewFileRevisionListener } from "./FilePropertiesTab";
|
import { buildUploadNewFileRevisionListener } from "./FilePropertiesTab";
|
||||||
|
|
||||||
|
interface NoteActionsCustomProps {
|
||||||
|
note: FNote;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part of {@link NoteActions} on the new layout, but are rendered with a slight spacing
|
* Part of {@link NoteActions} on the new layout, but are rendered with a slight spacing
|
||||||
* from the rest of the note items and the buttons differ based on the note type.
|
* from the rest of the note items and the buttons differ based on the note type.
|
||||||
*/
|
*/
|
||||||
export default function NoteActionsCustom({ note }: { note: FNote }) {
|
export default function NoteActionsCustom({ note }: NoteActionsCustomProps) {
|
||||||
return (
|
return (
|
||||||
<FileActions note={note} />
|
<div className="note-actions-custom">
|
||||||
|
<NoteActionsCustomInner note={note} />
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function FileActions({ note }: { note: FNote }) {
|
function NoteActionsCustomInner(props: NoteActionsCustomProps) {
|
||||||
|
switch (props.note.type) {
|
||||||
|
case "file":
|
||||||
|
return <FileActions {...props} />;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function FileActions({ note }: NoteActionsCustomProps) {
|
||||||
const canAccessProtectedNote = !note?.isProtected || protected_session_holder.isProtectedSessionAvailable();
|
const canAccessProtectedNote = !note?.isProtected || protected_session_holder.isProtectedSessionAvailable();
|
||||||
|
|
||||||
return (note.type === "file" &&
|
return (
|
||||||
<>
|
<>
|
||||||
<FormFileUploadActionButton
|
<FormFileUploadActionButton
|
||||||
icon="bx bx-folder-open"
|
icon="bx bx-folder-open"
|
||||||
|
|||||||
@@ -448,8 +448,19 @@ body.experimental-feature-new-layout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.ribbon-button-container {
|
.ribbon-button-container {
|
||||||
|
--button-gap: 5px;
|
||||||
|
|
||||||
border-bottom: 0 !important;
|
border-bottom: 0 !important;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
gap: var(--button-gap);
|
||||||
|
|
||||||
|
.note-actions-custom {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 36px;
|
||||||
|
gap: var(--button-gap);
|
||||||
|
margin-right: 1em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* #endregion */
|
/* #endregion */
|
||||||
|
|||||||
Reference in New Issue
Block a user