From c039f06c2b4bc1ef30166142a30a7f2d12447df6 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 15 Aug 2025 00:19:37 +0300 Subject: [PATCH] chore(react/settings): fix a margin between radios --- .../src/widgets/react/FormRadioGroup.tsx | 36 +++++++++++++------ .../src/widgets/type_widgets/options/i18n.tsx | 20 ++++++----- .../widgets/type_widgets/options/i18n/i18n.ts | 29 --------------- 3 files changed, 36 insertions(+), 49 deletions(-) delete mode 100644 apps/client/src/widgets/type_widgets/options/i18n/i18n.ts diff --git a/apps/client/src/widgets/react/FormRadioGroup.tsx b/apps/client/src/widgets/react/FormRadioGroup.tsx index e2264bfe4..ccfd0cf84 100644 --- a/apps/client/src/widgets/react/FormRadioGroup.tsx +++ b/apps/client/src/widgets/react/FormRadioGroup.tsx @@ -11,23 +11,37 @@ interface FormRadioProps { onChange(newValue: string): void; } -export default function FormRadioGroup({ name, values, currentValue, onChange }: FormRadioProps) { +export default function FormRadioGroup({ values, ...restProps }: FormRadioProps) { return ( <> {(values || []).map(({ value, label }) => (
- +
))} ); +} + +export function FormInlineRadioGroup({ values, ...restProps }: FormRadioProps) { + return ( + <> + {values.map(({ value, label }) => ())} + + ) +} + +function FormRadio({ name, value, label, currentValue, onChange, labelClassName }: Omit & { value: string, label: ComponentChildren, labelClassName?: string }) { + return ( + + ) } \ No newline at end of file diff --git a/apps/client/src/widgets/type_widgets/options/i18n.tsx b/apps/client/src/widgets/type_widgets/options/i18n.tsx index bd63c2179..796e3b0f4 100644 --- a/apps/client/src/widgets/type_widgets/options/i18n.tsx +++ b/apps/client/src/widgets/type_widgets/options/i18n.tsx @@ -6,7 +6,7 @@ import OptionsSection from "./components/OptionsSection"; import { useTriliumOption, useTriliumOptionInt } from "../../react/hooks"; import type { Locale } from "@triliumnext/commons"; import { isElectron, restartDesktopApp } from "../../../services/utils"; -import FormRadioGroup from "../../react/FormRadioGroup"; +import FormRadioGroup, { FormInlineRadioGroup } from "../../react/FormRadioGroup"; import FormText from "../../react/FormText"; import RawHtml from "../../react/RawHtml"; import Admonition from "../../react/Admonition"; @@ -63,14 +63,16 @@ function DateSettings() { return ( <> - +
+ +
diff --git a/apps/client/src/widgets/type_widgets/options/i18n/i18n.ts b/apps/client/src/widgets/type_widgets/options/i18n/i18n.ts deleted file mode 100644 index 6c53cf625..000000000 --- a/apps/client/src/widgets/type_widgets/options/i18n/i18n.ts +++ /dev/null @@ -1,29 +0,0 @@ -import OptionsWidget from "../options_widget.js"; -import server from "../../../../services/server.js"; -import utils from "../../../../services/utils.js"; -import { getAvailableLocales, t } from "../../../../services/i18n.js"; - -const TPL = /*html*/` -
- -
-`; - -export default class LocalizationOptions extends OptionsWidget { - - doRender() { - this.$widget = $(TPL); - this.$widget.find(".restart-app-button").on("click", utils.); - } - -}