From eaf5b9fd0183a4955d4149eec2a792a4f0d64000 Mon Sep 17 00:00:00 2001 From: oscarj007 Date: Sat, 28 Mar 2026 15:15:16 +0100 Subject: [PATCH 1/2] feat: implement notification preferences toggle table #231 --- src/App.tsx | 2 + .../settings/NotificationPreferencesPage.tsx | 82 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 src/pages/settings/NotificationPreferencesPage.tsx diff --git a/src/App.tsx b/src/App.tsx index 176107f..c40b8a1 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -20,6 +20,7 @@ import ModalPreview from "./pages/ModalPreview"; import StatusPollingDemo from "./pages/StatusPollingDemo"; import CustodyTimelinePage from "./pages/CustodyTimelinePage"; import AdminApprovalQueuePage from "./pages/AdminApprovalQueuePage"; +import NotificationPreferencesPage from './pages/settings/NotificationPreferencesPage'; function App() { @@ -45,6 +46,7 @@ function App() { } /> } /> } /> + } /> {/* Admin Approvals */} } /> diff --git a/src/pages/settings/NotificationPreferencesPage.tsx b/src/pages/settings/NotificationPreferencesPage.tsx new file mode 100644 index 0000000..b8178ea --- /dev/null +++ b/src/pages/settings/NotificationPreferencesPage.tsx @@ -0,0 +1,82 @@ +import React from 'react'; +import { useApiQuery } from '../../hooks/useApiQuery'; + +const SkeletonLoader = () => ( +
+); + +const eventGroups = [ + { name: 'Adoption events', keys: ['pet_listed', 'application_received'] }, + { name: 'Escrow events', keys: ['payment_held', 'payment_released'], isSdk: true }, + { name: 'Dispute events', keys: ['dispute_opened', 'evidence_required'] }, + { name: 'Approval events', keys: ['admin_verified'] }, +]; + +export default function NotificationPreferencesPage() { + // Task: useApiQuery: GET /notifications/preferences + const { data: preferences, isLoading } = useApiQuery('/notifications/preferences'); + + if (isLoading) { + return ( +
+

Notification Preferences

+ + + +
+ ); + } + + return ( +
+

Notification Preferences

+ +
+ + + + + + + + + + {eventGroups.map((group) => ( + + + + + {group.keys.map((key) => ( + + + + + + ))} + + ))} + +
Event TypeEmailIn-app
+ {group.name} + {group.isSdk && ( + + SDK event + + )} +
{key.replace(/_/g, ' ')} + + + +
+
+
+ ); +} \ No newline at end of file From 188413c817957f0e6de25af8d071786198eaa0f1 Mon Sep 17 00:00:00 2001 From: Amina Sheriff <61979798+amina69@users.noreply.github.com> Date: Sat, 28 Mar 2026 20:07:35 +0100 Subject: [PATCH 2/2] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8594609..3be4e92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: cache: 'npm' - name: Install dependencies - run: npm ci + run: npm install - name: Lint check run: npm run lint