From ef9afa8cbca29a3dd83454f44264a4682e968c59 Mon Sep 17 00:00:00 2001 From: Jonas Dellinger Date: Sat, 24 Jun 2023 12:59:39 +0200 Subject: Add notification settings, which allows muting decky/plugin toast notifications (#479) * Add notification settings, which allows muting decky/plugin toast notifications * Fix typos --- .../pages/general/NotificationSettings.tsx | 35 ++++++++++++++++++++++ .../components/settings/pages/general/index.tsx | 5 ++++ 2 files changed, 40 insertions(+) create mode 100644 frontend/src/components/settings/pages/general/NotificationSettings.tsx (limited to 'frontend/src/components/settings') diff --git a/frontend/src/components/settings/pages/general/NotificationSettings.tsx b/frontend/src/components/settings/pages/general/NotificationSettings.tsx new file mode 100644 index 00000000..21c2fd82 --- /dev/null +++ b/frontend/src/components/settings/pages/general/NotificationSettings.tsx @@ -0,0 +1,35 @@ +import { Field, Toggle } from 'decky-frontend-lib'; +import { FC } from 'react'; +import { useTranslation } from 'react-i18next'; + +import { useDeckyState } from '../../../DeckyState'; + +const NotificationSettings: FC = () => { + const { notificationSettings } = useDeckyState(); + const notificationService = window.DeckyPluginLoader.notificationService; + + const { t } = useTranslation(); + + return ( + <> + + { + notificationService.update({ ...notificationSettings, deckyUpdates }); + }} + /> + + + { + notificationService.update({ ...notificationSettings, pluginUpdates }); + }} + /> + + + ); +}; + +export default NotificationSettings; diff --git a/frontend/src/components/settings/pages/general/index.tsx b/frontend/src/components/settings/pages/general/index.tsx index 96ae6782..6fc62a46 100644 --- a/frontend/src/components/settings/pages/general/index.tsx +++ b/frontend/src/components/settings/pages/general/index.tsx @@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next'; import { useDeckyState } from '../../../DeckyState'; import BranchSelect from './BranchSelect'; +import NotificationSettings from './NotificationSettings'; import StoreSelect from './StoreSelect'; import UpdaterSettings from './Updater'; @@ -27,6 +28,10 @@ export default function GeneralSettings({ + + {t('SettingsGeneralIndex.notifications.header')} + + {t('SettingsGeneralIndex.other.header')} -- cgit v1.2.3