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:
@@ -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"
|
||||
|
||||
@@ -208,7 +208,9 @@
|
||||
},
|
||||
"myApps": {
|
||||
"loading": "جارٍ تحميل التطبيقات...",
|
||||
"empty": "لا توجد تطبيقات متاحة."
|
||||
"empty": "لا توجد تطبيقات متاحة.",
|
||||
"hide": "إخفاء {{name}}",
|
||||
"show": "إظهار {{name}}"
|
||||
}
|
||||
},
|
||||
"notifSettings": {
|
||||
|
||||
@@ -214,7 +214,9 @@
|
||||
},
|
||||
"myApps": {
|
||||
"loading": "Loading apps…",
|
||||
"empty": "No apps available."
|
||||
"empty": "No apps available.",
|
||||
"hide": "Hide {{name}}",
|
||||
"show": "Show {{name}}"
|
||||
}
|
||||
},
|
||||
"notifSettings": {
|
||||
|
||||
Reference in New Issue
Block a user