Skip to content

Build your personal knowledge base with Trilium Notes

fix(import): right-align the import button in the import dialog

Elian Dorana505ecebaba5
diff --git a/apps/client/src/widgets/dialogs/import/import_dialog.tsx b/apps/client/src/widgets/dialogs/import/import_dialog.tsx
index e51215666e..4825691158 100644
--- a/apps/client/src/widgets/dialogs/import/import_dialog.tsx
+++ b/apps/client/src/widgets/dialogs/import/import_dialog.tsx
@@ -53,7 +53,7 @@ export default function ImportDialog() {
scrollable
title={noteTitle ? t("import.importIntoNoteNamed", { title: noteTitle }) : t("import.importIntoNote")}
footer={footer}
- footerAlignment="between"
+ footerAlignment="right"
onHidden={() => setShown(false)}
show={shown}
>
diff --git a/apps/client/src/widgets/dialogs/import/onenote.css b/apps/client/src/widgets/dialogs/import/onenote.css
new file mode 100644
index 0000000000..9351214497
--- /dev/null
+++ b/apps/client/src/widgets/dialogs/import/onenote.css
@@ -0,0 +1,9 @@
+/* The OneNote import footer keeps the "attach source" checkbox on the left while the import
+ button stays on the right, independent of the dialog's right-aligned footer default. */
+.modal-footer .onenote-footer {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 1em;
+}
diff --git a/apps/client/src/widgets/dialogs/import/onenote.tsx b/apps/client/src/widgets/dialogs/import/onenote.tsx
index 08b0c5c49a..764de4b0f4 100644
--- a/apps/client/src/widgets/dialogs/import/onenote.tsx
+++ b/apps/client/src/widgets/dialogs/import/onenote.tsx
@@ -1,3 +1,5 @@
+import "./onenote.css";
+
import { useCallback, useEffect, useRef, useState } from "preact/hooks";
import { t } from "../../../services/i18n.js";
@@ -151,7 +153,7 @@ function OneNotePanel({ parentNoteId, closeDialog, setFooter }: ImportProviderPa
const importDisabled = selectedIds.size === 0;
useEffect(() => {
setFooter(phase !== "ready" ? null : (
- <>
+ <div className="onenote-footer">
<FormCheckbox
name="onenote-debug"
label={t("onenote_import.attach_source")}
@@ -165,7 +167,7 @@ function OneNotePanel({ parentNoteId, closeDialog, setFooter }: ImportProviderPa
disabled={importDisabled}
onClick={() => void doImportRef.current()}
/>
- </>
+ </div>
));
}, [phase, debug, importDisabled, setFooter]);