diff --git a/apps/client/src/widgets/react/Admonition.tsx b/apps/client/src/widgets/react/Admonition.tsx new file mode 100644 index 000000000..6c4814bbc --- /dev/null +++ b/apps/client/src/widgets/react/Admonition.tsx @@ -0,0 +1,14 @@ +import { ComponentChildren } from "preact"; + +interface AdmonitionProps { + type: "warning"; + children: ComponentChildren; +} + +export default function Admonition({ type, children }: AdmonitionProps) { + return ( +
+ {children} +
+ ) +} \ No newline at end of file diff --git a/apps/client/src/widgets/type_widgets/options/components/OptionsRow.css b/apps/client/src/widgets/type_widgets/options/components/OptionsRow.css new file mode 100644 index 000000000..98778b96e --- /dev/null +++ b/apps/client/src/widgets/type_widgets/options/components/OptionsRow.css @@ -0,0 +1,23 @@ +.option-row { + border-bottom: 1px solid var(--main-border-color); + display: flex; + align-items: center; + padding: 0.5em 0; +} + +.option-row > label { + width: 40%; + margin-bottom: 0 !important; +} + +.option-row > select { + width: 60%; +} + +.option-row:last-of-type { + border-bottom: unset; +} + +.option-row.centered { + justify-content: center; +} \ No newline at end of file diff --git a/apps/client/src/widgets/type_widgets/options/components/OptionsRow.tsx b/apps/client/src/widgets/type_widgets/options/components/OptionsRow.tsx index 8bad83556..316104ae3 100644 --- a/apps/client/src/widgets/type_widgets/options/components/OptionsRow.tsx +++ b/apps/client/src/widgets/type_widgets/options/components/OptionsRow.tsx @@ -1,14 +1,16 @@ import { ComponentChildren } from "preact"; +import "./OptionsRow.css"; interface OptionsRowProps { - label: string; + label?: string; children: ComponentChildren; + centered?: boolean; } -export default function OptionsRow({ label, children }: OptionsRowProps) { +export default function OptionsRow({ label, children, centered }: OptionsRowProps) { return ( -
- +
+ {label && } {children}
); diff --git a/apps/client/src/widgets/type_widgets/options/i18n.tsx b/apps/client/src/widgets/type_widgets/options/i18n.tsx index 598415e6c..bd63c2179 100644 --- a/apps/client/src/widgets/type_widgets/options/i18n.tsx +++ b/apps/client/src/widgets/type_widgets/options/i18n.tsx @@ -5,8 +5,12 @@ import OptionsRow from "./components/OptionsRow"; import OptionsSection from "./components/OptionsSection"; import { useTriliumOption, useTriliumOptionInt } from "../../react/hooks"; import type { Locale } from "@triliumnext/commons"; -import { isElectron } from "../../../services/utils"; +import { isElectron, restartDesktopApp } from "../../../services/utils"; import FormRadioGroup from "../../react/FormRadioGroup"; +import FormText from "../../react/FormText"; +import RawHtml from "../../react/RawHtml"; +import Admonition from "../../react/Admonition"; +import Button from "../../react/Button"; export default function InternationalizationOptions() { return ( @@ -70,15 +74,17 @@ function DateSettings() { - +
+ +
{firstWeekOfYear === "2" && @@ -89,6 +95,22 @@ function DateSettings() { { length: 7 }, (_, i) => ({ days: String(i + 1) }))} /> } + + + + + + + {t("i18n.first-week-warning")} + + + + -
- -