diff options
| author | Jonas Dellinger <jonas@dellinger.dev> | 2023-06-24 12:59:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-24 12:59:39 +0200 |
| commit | ef9afa8cbca29a3dd83454f44264a4682e968c59 (patch) | |
| tree | 5eb5033ba579ab6159d593cb01d8cf9b011f1942 /frontend/src/components/settings/pages/general/NotificationSettings.tsx | |
| parent | 143461d59793665f9e54d05ba00b16c55dfec57f (diff) | |
| download | decky-loader-ef9afa8cbca29a3dd83454f44264a4682e968c59.tar.gz decky-loader-ef9afa8cbca29a3dd83454f44264a4682e968c59.zip | |
Add notification settings, which allows muting decky/plugin toast notifications (#479)
* Add notification settings, which allows muting decky/plugin toast notifications
* Fix typos
Diffstat (limited to 'frontend/src/components/settings/pages/general/NotificationSettings.tsx')
| -rw-r--r-- | frontend/src/components/settings/pages/general/NotificationSettings.tsx | 35 |
1 files changed, 35 insertions, 0 deletions
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 ( + <> + <Field label={t('SettingsGeneralIndex.notifications.decky_updates_label')}> + <Toggle + value={notificationSettings.deckyUpdates} + onChange={(deckyUpdates) => { + notificationService.update({ ...notificationSettings, deckyUpdates }); + }} + /> + </Field> + <Field label={t('SettingsGeneralIndex.notifications.plugin_updates_label')}> + <Toggle + value={notificationSettings.pluginUpdates} + onChange={(pluginUpdates) => { + notificationService.update({ ...notificationSettings, pluginUpdates }); + }} + /> + </Field> + </> + ); +}; + +export default NotificationSettings; |
