mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 19:31:58 +00:00
Add notification settings, which allows muting decky/plugin toast notifications (#479)
* Add notification settings, which allows muting decky/plugin toast notifications * Fix typos
This commit is contained in:
@@ -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;
|
||||
@@ -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({
|
||||
<BranchSelect />
|
||||
<StoreSelect />
|
||||
</DialogControlsSection>
|
||||
<DialogControlsSection>
|
||||
<DialogControlsSectionHeader>{t('SettingsGeneralIndex.notifications.header')}</DialogControlsSectionHeader>
|
||||
<NotificationSettings />
|
||||
</DialogControlsSection>
|
||||
<DialogControlsSection>
|
||||
<DialogControlsSectionHeader>{t('SettingsGeneralIndex.other.header')}</DialogControlsSectionHeader>
|
||||
<Field label={t('SettingsGeneralIndex.developer_mode.label')}>
|
||||
|
||||
Reference in New Issue
Block a user