diff --git a/admin-spa/src/routes/Settings/Notifications/Channels.tsx b/admin-spa/src/routes/Settings/Notifications/Channels.tsx index 321736d..fe19d97 100644 --- a/admin-spa/src/routes/Settings/Notifications/Channels.tsx +++ b/admin-spa/src/routes/Settings/Notifications/Channels.tsx @@ -180,8 +180,8 @@ export default function NotificationChannels() { - {/* Built-in Channels */} - + {/* All Channels */} +
{builtinChannels.map((channel: NotificationChannel) => (
@@ -192,19 +192,11 @@ export default function NotificationChannels() {

{channel.label}

-
-
{__('Built-in')} - - {channel.enabled ? __('Active') : __('Inactive')} -
-

+

{channel.id === 'email' && __('Email notifications powered by WooCommerce. Configure templates and SMTP settings.')} {channel.id === 'push' && @@ -222,6 +214,10 @@ export default function NotificationChannels() { checked={channel.enabled} onCheckedChange={(checked) => { toggleChannelMutation.mutate({ channelId: channel.id, enabled: checked }); + // If enabling push, also subscribe + if (channel.id === 'push' && checked && pushSupported && !pushSubscribed) { + subscribeToPush.mutate(); + } }} disabled={toggleChannelMutation.isPending} /> @@ -239,24 +235,7 @@ export default function NotificationChannels() { {__('Configure')} - {channel.id === 'push' && pushSupported && ( -

- - {pushSubscribed ? __('Subscribed') : __('Not subscribed')} - - { - if (checked) { - subscribeToPush.mutate(); - } else { - unsubscribeFromPush.mutate(); - } - }} - disabled={subscribeToPush.isPending || unsubscribeFromPush.isPending} - /> -
- )} + {channel.id === 'push' && !pushSupported && ( {__('Not Supported')} diff --git a/admin-spa/src/routes/Settings/Notifications/Events.tsx b/admin-spa/src/routes/Settings/Notifications/Events.tsx index 1d4a624..bbb334e 100644 --- a/admin-spa/src/routes/Settings/Notifications/Events.tsx +++ b/admin-spa/src/routes/Settings/Notifications/Events.tsx @@ -130,12 +130,9 @@ export default function NotificationEvents() {
{orderEvents.map((event: NotificationEvent) => (
-
-
-

{event.label}

-

{event.description}

-
- +
+

{event.label}

+

{event.description}

{/* Channel Selection */} @@ -193,12 +190,9 @@ export default function NotificationEvents() {
{productEvents.map((event: NotificationEvent) => (
-
-
-

{event.label}

-

{event.description}

-
- +
+

{event.label}

+

{event.description}

@@ -255,12 +249,9 @@ export default function NotificationEvents() {
{customerEvents.map((event: NotificationEvent) => (
-
-
-

{event.label}

-

{event.description}

-
- +
+

{event.label}

+

{event.description}