From e359b1c0a4c46e32cb664357f6fd2b46a61f90e4 Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sun, 23 Feb 2025 19:42:04 -0500 Subject: [PATCH] Fix #140 and add notification type as webhook only --- src/views/Settings/NotificationSetting.jsx | 55 +++++++++------------- src/views/Settings/Settings.jsx | 37 ++++++++------- 2 files changed, 40 insertions(+), 52 deletions(-) diff --git a/src/views/Settings/NotificationSetting.jsx b/src/views/Settings/NotificationSetting.jsx index 3bf3adb..ae8633b 100644 --- a/src/views/Settings/NotificationSetting.jsx +++ b/src/views/Settings/NotificationSetting.jsx @@ -150,18 +150,7 @@ const NotificationSetting = () => { Manage your Device Notificaiton - -
- Device Notification - - {Capacitor.isNativePlatform() - ? 'Receive notification on your device when a task is due' - : 'This feature is only available on mobile devices'}{' '} - -
+ { }} color={deviceNotification ? 'success' : 'neutral'} variant={deviceNotification ? 'solid' : 'outlined'} - endDecorator={deviceNotification ? 'On' : 'Off'} - slotProps={{ - endDecorator: { - sx: { - minWidth: 24, - }, - }, - }} + sx={{ mr: 1 }} /> +
+ Device Notification + + {Capacitor.isNativePlatform() + ? 'Receive notification on your device when a task is due' + : 'This feature is only available on mobile devices'}{' '} + +
{deviceNotification && ( @@ -329,17 +319,9 @@ const NotificationSetting = () => { Notificaiton through other platform like Telegram or Pushover - -
- Custom Notification - - Receive notification on other platform - -
+ { event.preventDefault() @@ -360,15 +342,19 @@ const NotificationSetting = () => { }} color={chatID !== 0 ? 'success' : 'neutral'} variant={chatID !== 0 ? 'solid' : 'outlined'} - endDecorator={chatID !== 0 ? 'On' : 'Off'} + // endDecorator={chatID !== 0 ? 'On' : 'Off'} slotProps={{ endDecorator: { - sx: { - minWidth: 24, - }, + sx: {}, }, }} /> +
+ Custom Notification + + Receive notification on other platform + +
{chatID !== 0 && ( { + {notificationTarget === '1' && ( <> diff --git a/src/views/Settings/Settings.jsx b/src/views/Settings/Settings.jsx index 40afc01..1cc14e3 100644 --- a/src/views/Settings/Settings.jsx +++ b/src/views/Settings/Settings.jsx @@ -357,22 +357,23 @@ const Settings = () => { )} - <> - {webhookURL !== null && ( - - Webhook URL - setWebhookURL(e.target.value)} - size='lg' - sx={{ - width: '220px', - mb: 1, - }} - /> - - {webhookError} - +
+ + {webhookURL !== null && ( + + Webhook URL + setWebhookURL(e.target.value)} + size='lg' + sx={{ + width: '220px', + mb: 1, + }} + /> + {webhookError && ( + + {webhookError} )} - -
+ + )} )}