diff --git a/components/settings/SettingsModalWrapper.tsx b/components/settings/SettingsModalWrapper.tsx index 5b37916..dfa8323 100644 --- a/components/settings/SettingsModalWrapper.tsx +++ b/components/settings/SettingsModalWrapper.tsx @@ -3,7 +3,8 @@ import { useState, useEffect } from 'react' import Link from 'next/link' import { SettingsModal, type SettingsSection } from '@ciphera-net/ui' -import { UserIcon, LockIcon, ChevronRightIcon } from '@ciphera-net/ui' +import { UserIcon, LockIcon, BellIcon, ChevronRightIcon } from '@ciphera-net/ui' +import { NotificationToggleList, type NotificationOption } from '@ciphera-net/ui' import ProfileSettings from '@/components/settings/ProfileSettings' import TrustedDevicesCard from '@/components/settings/TrustedDevicesCard' import SecurityActivityCard from '@/components/settings/SecurityActivityCard' @@ -11,19 +12,9 @@ import { useSettingsModal } from '@/lib/settings-modal-context' import { useAuth } from '@/lib/auth/context' import { updateUserPreferences } from '@/lib/api/user' -// Inline SVG icons not available in ciphera-ui -function BellIcon({ className }: { className?: string }) { - return ( - - - - - ) -} - // --- Security Alerts --- -const SECURITY_ALERT_OPTIONS = [ +const SECURITY_ALERT_OPTIONS: NotificationOption[] = [ { key: 'login_alerts', label: 'Login Activity', description: 'New device sign-ins and suspicious login attempts.' }, { key: 'password_alerts', label: 'Password Changes', description: 'Password changes and session revocations.' }, { key: 'two_factor_alerts', label: 'Two-Factor Authentication', description: '2FA enabled/disabled and recovery code changes.' }, @@ -64,55 +55,14 @@ function SecurityAlertsCard() { } return ( -
-
-
- -
-
-

Security Alerts

-

Choose which security events trigger email alerts

-
-
- -
- {SECURITY_ALERT_OPTIONS.map((item) => ( -
-
- - {item.label} - - - {item.description} - -
- -
- ))} -
-
+ } + options={SECURITY_ALERT_OPTIONS} + values={emailNotifications} + onToggle={handleToggle} + /> ) } @@ -120,21 +70,14 @@ function SecurityAlertsCard() { function NotificationCenterPlaceholder() { return ( -
-
- -

Notification Center

-

- View and manage all your notifications in one place. -

- - Open Notification Center - - -
+
+ +

Notification Center

+

View and manage all your notifications in one place.

+ + Open Notification Center + +
) } @@ -157,6 +100,16 @@ export default function SettingsModalWrapper() { { id: 'preferences', label: 'Preferences', content: }, ], }, + { + id: 'security-section', + label: 'Security', + description: 'Devices and activity', + icon: LockIcon, + items: [ + { id: 'devices', label: 'Trusted Devices', content: }, + { id: 'activity', label: 'Security Activity', content: }, + ], + }, { id: 'notifications', label: 'Notifications', @@ -167,19 +120,6 @@ export default function SettingsModalWrapper() { { id: 'center', label: 'Notification Center', content: }, ], }, - { - id: 'account', - label: 'Ciphera Account', - description: 'Security, 2FA, and sessions', - icon: LockIcon, - items: [ - { id: 'auth-profile', label: 'Profile & Personal Info', href: 'https://auth.ciphera.net/settings', external: true }, - { id: 'auth-security', label: 'Security & 2FA', href: 'https://auth.ciphera.net/settings?tab=security', external: true }, - { id: 'auth-sessions', label: 'Active Sessions', href: 'https://auth.ciphera.net/settings?tab=sessions', external: true }, - { id: 'devices', label: 'Trusted Devices', content: }, - { id: 'activity', label: 'Security Activity', content: }, - ], - }, ] return diff --git a/package-lock.json b/package-lock.json index 346f3fd..28f0f2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "pulse-frontend", "version": "0.13.0-alpha", "dependencies": { - "@ciphera-net/ui": "^0.0.88", + "@ciphera-net/ui": "^0.0.89", "@ducanh2912/next-pwa": "^10.2.9", "@radix-ui/react-icons": "^1.3.0", "@simplewebauthn/browser": "^13.2.2", @@ -1665,9 +1665,9 @@ } }, "node_modules/@ciphera-net/ui": { - "version": "0.0.88", - "resolved": "https://npm.pkg.github.com/download/@ciphera-net/ui/0.0.88/70285ac19f9349fd13b4cbedf59612bc9c6ecc7e", - "integrity": "sha512-YMfrK8NVfFyS/KqvlnFSm3EmeCnIc5Wb4gO//qqyIt7d1lFGgsQJfQ0xOHoo0oQq0STywdnXPOwaTUWJeUIdMA==", + "version": "0.0.89", + "resolved": "https://npm.pkg.github.com/download/@ciphera-net/ui/0.0.89/2c528b440d3984e20a524be8a1d458df0aa8597e", + "integrity": "sha512-Ax4EMJCbWeEaCkoQqFCbl28QE5TnS0OY2nPNQiLVdLcG3xyiAgGL7MPpewo1RAUOrYm1/cr3F4Z3iiX7VAeSMA==", "dependencies": { "@radix-ui/react-icons": "^1.3.0", "clsx": "^2.1.0", diff --git a/package.json b/package.json index a2ecb1d..07c507b 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "test:watch": "vitest" }, "dependencies": { - "@ciphera-net/ui": "^0.0.88", + "@ciphera-net/ui": "^0.0.89", "@ducanh2912/next-pwa": "^10.2.9", "@radix-ui/react-icons": "^1.3.0", "@simplewebauthn/browser": "^13.2.2",