From e1b55e4019beae0936b5c948b423bb9196054461 Mon Sep 17 00:00:00 2001 From: GaetanGrd <40648115+GaetanGrd@users.noreply.github.com> Date: Sat, 14 Jun 2025 14:01:07 +0200 Subject: [PATCH] Feature/language UI update (#797) * split radio items into two columns for better layout * Add SplitColumns prop to SettingRadioArray for flexible layout * Add columnCount prop to SettingRadioArray for flexible layout * REmove useless change * fix dytnamic grid columns after compilation * remove useless span --------- Co-authored-by: Zagrios <40181755+Zagrios@users.noreply.github.com> --- .../settings/setting-radio-array.component.tsx | 11 ++++++----- src/renderer/pages/settings-page.component.tsx | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/settings/setting-radio-array.component.tsx b/src/renderer/components/settings/setting-radio-array.component.tsx index 1a7f2e60..05f1d083 100644 --- a/src/renderer/components/settings/setting-radio-array.component.tsx +++ b/src/renderer/components/settings/setting-radio-array.component.tsx @@ -8,10 +8,11 @@ type Props = { selectedItemId?: number; selectedItemValue?: T; direction?: CSSProperties["flexDirection"], + columnCount?: number; onItemSelected?: (item: RadioItem) => void }; -export function SettingRadioArray({ id, items, selectedItemId, selectedItemValue, onItemSelected, direction = "column" }: Props) { +export function SettingRadioArray({ id, items, selectedItemId, selectedItemValue, onItemSelected, direction = "column",columnCount = 1, }: Props) { const t = useTranslation(); const isSelected = (item: RadioItem) => { @@ -19,17 +20,17 @@ export function SettingRadioArray({ id, items, selectedItemId, selectedItemVa } return ( -
+
{items.map(i => ( -
onItemSelected(i)} key={i.id} className={`py-3 w-full flex cursor-pointer justify-between items-center rounded-md px-2 transition-colors duration-300 ${isSelected(i) ? "bg-light-main-color-3 dark:bg-main-color-3" : "bg-light-main-color-1 dark:bg-main-color-1"} ${i.className}`}> +
onItemSelected(i)} key={i.id} className={`h-12 py-3 w-full flex cursor-pointer justify-between rounded-md px-2 transition-colors duration-300 ${isSelected(i) ? "bg-light-main-color-3 dark:bg-main-color-3" : "bg-light-main-color-1 dark:bg-main-color-1"} ${i.className}`}>
-

{t(i.text)}

+

{t(i.text)}

{i.icon && ( -
+
{i.textIcon && {t(i.textIcon)}} {i.icon}
diff --git a/src/renderer/pages/settings-page.component.tsx b/src/renderer/pages/settings-page.component.tsx index 5a4a6afe..06ffd199 100644 --- a/src/renderer/pages/settings-page.component.tsx +++ b/src/renderer/pages/settings-page.component.tsx @@ -498,7 +498,7 @@ export function SettingsPage() { - +