Add ability to show and hide applications in settings

Update settings panel and locales to include functionality for hiding and showing applications, adding new aria-labels for improved accessibility.
This commit is contained in:
Riyadh
2026-05-19 11:08:06 +00:00
parent d7d8ab3a2a
commit 876b8b1545
3 changed files with 13 additions and 3 deletions
@@ -47,11 +47,13 @@ function ToggleRow({
active,
onClick,
label,
ariaLabel,
leftIcon,
}: {
active: boolean;
onClick: () => void;
label: string;
ariaLabel?: string;
leftIcon?: React.ReactNode;
}) {
return (
@@ -59,7 +61,7 @@ function ToggleRow({
type="button"
role="switch"
aria-checked={active}
aria-label={label}
aria-label={ariaLabel ?? label}
onClick={onClick}
className="w-full flex items-center justify-between gap-3 px-3 py-2.5 rounded-lg text-start hover:bg-foreground/5 transition-colors"
>
@@ -215,6 +217,9 @@ function MyAppsBody() {
const Icon = resolveAppIcon(app.iconName);
const name = lang === "ar" ? app.nameAr : app.nameEn;
const visible = !app.hidden;
const ariaLabel = visible
? t("settingsPanel.myApps.hide", { name })
: t("settingsPanel.myApps.show", { name });
return (
<ToggleRow
key={app.id}
@@ -223,6 +228,7 @@ function MyAppsBody() {
update.mutate({ appId: app.id, data: { hidden: visible } })
}
label={name}
ariaLabel={ariaLabel}
leftIcon={
<span
className="inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md"
+3 -1
View File
@@ -208,7 +208,9 @@
},
"myApps": {
"loading": "جارٍ تحميل التطبيقات...",
"empty": "لا توجد تطبيقات متاحة."
"empty": "لا توجد تطبيقات متاحة.",
"hide": "إخفاء {{name}}",
"show": "إظهار {{name}}"
}
},
"notifSettings": {
+3 -1
View File
@@ -214,7 +214,9 @@
},
"myApps": {
"loading": "Loading apps…",
"empty": "No apps available."
"empty": "No apps available.",
"hide": "Hide {{name}}",
"show": "Show {{name}}"
}
},
"notifSettings": {