ui/buttons: refactor
Some checks are pending
Checks / main (push) Waiting to run

This commit is contained in:
Adorian Doran 2026-02-16 18:23:28 +02:00
parent d64f2c72b7
commit 4912834537
14 changed files with 15 additions and 15 deletions

View File

@ -57,7 +57,7 @@ export default function BulkActionsDialog() {
className="bulk-actions-dialog"
size="xl"
title={t("bulk_actions.bulk_actions")}
footer={<Button text={t("bulk_actions.execute_bulk_actions")} primary />}
footer={<Button text={t("bulk_actions.execute_bulk_actions")} kind="primary" />}
show={shown}
onSubmit={async () => {
await server.post("bulk-action/execute", {

View File

@ -72,7 +72,7 @@ export default function DeleteNotesDialog() {
footer={<>
<Button text={t("delete_notes.cancel")}
onClick={() => setShown(false)} />
<Button text={t("delete_notes.ok")} primary
<Button text={t("delete_notes.ok")} kind="primary"
buttonRef={okButtonRef}
onClick={() => {
opts.callback?.({ proceed: true, deleteAllClones, eraseNotes });

View File

@ -58,7 +58,7 @@ export default function ExportDialog() {
setShown(false);
}}
onHidden={() => setShown(false)}
footer={<Button className="export-button" text={t("export.export")} primary />}
footer={<Button className="export-button" text={t("export.export")} kind="primary" />}
show={shown}
>

View File

@ -55,7 +55,7 @@ export default function ImportDialog() {
setShown(false);
setFiles(null);
}}
footer={<Button text={t("import.import")} primary disabled={!files} />}
footer={<Button text={t("import.import")} kind="primary" disabled={!files} />}
show={shown}
>
<FormGroup name="files" label={t("import.chooseImportFile")} description={

View File

@ -69,7 +69,7 @@ export default function PromptDialog() {
submitValue.current = null;
opts.current = undefined;
}}
footer={<Button text={t("prompt.ok")} keyboardShortcut="Enter" primary />}
footer={<Button text={t("prompt.ok")} keyboardShortcut="Enter" kind="primary" />}
show={shown}
stackable
>

View File

@ -203,7 +203,7 @@ function RevisionPreview({noteContent, revisionItem, showDiff, setShown, onRevis
}} />
&nbsp;
<Button
primary
kind="primary"
icon="bx bx-download"
text={t("revisions.download_button")}
onClick={() => {

View File

@ -35,7 +35,7 @@ export default function UploadAttachmentsDialog() {
className="upload-attachments-dialog"
size="lg"
title={t("upload_attachments.upload_attachments_to_note")}
footer={<Button text={t("upload_attachments.upload")} primary disabled={!files || isUploading} />}
footer={<Button text={t("upload_attachments.upload")} kind="primary" disabled={!files || isUploading} />}
onSubmit={async () => {
if (!files || !parentNoteId) {
return;

View File

@ -43,7 +43,7 @@ export default function FilePropertiesTab({ note, ntxId }: Pick<TabContext, "not
<Button
icon="bx bx-download"
text={t("file_properties.download")}
primary
kind="primary"
disabled={!canAccessProtectedNote}
onClick={() => downloadFileNote(note, parentComponent, ntxId)}
/>

View File

@ -43,7 +43,7 @@ export default function ImagePropertiesTab({ note, ntxId }: TabContext) {
<Button
text={t("image_properties.download")}
icon="bx bx-download"
primary
kind="primary"
onClick={() => downloadFileNote(note, parentComponent, ntxId)}
/>

View File

@ -34,7 +34,7 @@ export default function ProtectedSession() {
<Button
text={t("protected_session.start_session_button")}
primary
kind="primary"
keyboardShortcut="Enter"
/>
</form>

View File

@ -107,7 +107,7 @@ function DisabledRender({ note }: TypeWidgetProps) {
text={t("render.disabled_button_enable")}
icon="bx bx-check-shield"
onClick={() => attributes.toggleDangerousAttribute(note, "relation", "renderNote", true)}
primary
kind="primary"
/>
</SetupForm>
);

View File

@ -74,7 +74,7 @@ function SetupWebView({note}: {note: FNote}) {
<Button
text={t("web_view_setup.create_button")}
primary
kind="primary"
keyboardShortcut="Enter"
/>
</SetupForm>
@ -96,7 +96,7 @@ function DisabledWebView({ note, url }: { note: FNote, url: string }) {
text={t("web_view_setup.disabled_button_enable")}
icon="bx bx-check-shield"
onClick={() => attributes.toggleDangerousAttribute(note, "label", "webViewSrc", true)}
primary
kind="primary"
/>
</SetupForm>
);

View File

@ -95,7 +95,7 @@ function ChangePassword() {
<Button
text={t("password.change_password")}
primary
kind="primary"
/>
</form>
</OptionsSection>

View File

@ -65,7 +65,7 @@ export function SyncConfiguration() {
</FormGroup>
<div style={{ display: "flex", justifyContent: "spaceBetween"}}>
<Button text={t("sync_2.save")} primary />
<Button text={t("sync_2.save")} kind="primary" />
<Button text={t("sync_2.help")} onClick={() => openInAppHelpFromUrl("cbkrhQjrkKrh")} />
</div>
</form>