@djangocfg/layouts 2.1.110 → 2.1.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +14 -12
- package/src/components/errors/ErrorBoundary.tsx +12 -6
- package/src/components/errors/ErrorLayout.tsx +19 -9
- package/src/components/errors/errorConfig.ts +28 -22
- package/src/layouts/ProfileLayout/ProfileLayout.tsx +128 -56
- package/src/layouts/PublicLayout/components/PublicMobileDrawer.tsx +12 -4
- package/src/layouts/PublicLayout/components/PublicNavigation.tsx +6 -2
- package/src/layouts/_components/UserMenu.tsx +14 -6
- package/src/snippets/AuthDialog/AuthDialog.tsx +15 -6
- package/src/snippets/Breadcrumbs.tsx +19 -8
- package/src/snippets/McpChat/components/ChatPanel.tsx +16 -6
- package/src/snippets/McpChat/components/ChatSidebar.tsx +20 -8
- package/src/snippets/PWAInstall/components/A2HSHint.tsx +23 -10
- package/src/snippets/PWAInstall/components/DesktopGuide.tsx +44 -32
- package/src/snippets/PWAInstall/components/IOSGuideDrawer.tsx +34 -25
- package/src/snippets/PWAInstall/components/IOSGuideModal.tsx +34 -25
- package/src/snippets/PushNotifications/components/PushPrompt.tsx +16 -6
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { Bell, X } from 'lucide-react';
|
|
11
|
-
import React, { useEffect, useState } from 'react';
|
|
11
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
12
12
|
|
|
13
13
|
import { useAuth } from '@djangocfg/api/auth';
|
|
14
|
+
import { useTypedT, type I18nTranslations } from '@djangocfg/i18n';
|
|
14
15
|
import { Button } from '@djangocfg/ui-core';
|
|
15
16
|
|
|
16
17
|
import { usePushNotifications } from '../hooks/usePushNotifications';
|
|
@@ -66,10 +67,19 @@ export function PushPrompt({
|
|
|
66
67
|
vapidPublicKey,
|
|
67
68
|
subscribeEndpoint,
|
|
68
69
|
});
|
|
70
|
+
const t = useTypedT<I18nTranslations>();
|
|
69
71
|
|
|
70
72
|
const [show, setShow] = useState(false);
|
|
71
73
|
const [enabling, setEnabling] = useState(false);
|
|
72
74
|
|
|
75
|
+
const labels = useMemo(() => ({
|
|
76
|
+
enableNotifications: t('layouts.push.enableNotifications'),
|
|
77
|
+
stayUpdated: t('layouts.push.stayUpdated'),
|
|
78
|
+
enable: t('layouts.push.enable'),
|
|
79
|
+
notNow: t('layouts.push.notNow'),
|
|
80
|
+
dismiss: t('layouts.push.dismiss'),
|
|
81
|
+
}), [t]);
|
|
82
|
+
|
|
73
83
|
// Check if should show
|
|
74
84
|
useEffect(() => {
|
|
75
85
|
// Wait for auth to complete, don't show for unauthenticated users
|
|
@@ -132,9 +142,9 @@ export function PushPrompt({
|
|
|
132
142
|
|
|
133
143
|
{/* Content */}
|
|
134
144
|
<div className="flex-1 min-w-0">
|
|
135
|
-
<p className="text-sm font-medium text-white mb-1">
|
|
145
|
+
<p className="text-sm font-medium text-white mb-1">{labels.enableNotifications}</p>
|
|
136
146
|
<p className="text-xs text-zinc-400 mb-3">
|
|
137
|
-
|
|
147
|
+
{labels.stayUpdated}
|
|
138
148
|
</p>
|
|
139
149
|
|
|
140
150
|
{/* Actions */}
|
|
@@ -145,14 +155,14 @@ export function PushPrompt({
|
|
|
145
155
|
size="sm"
|
|
146
156
|
variant="default"
|
|
147
157
|
>
|
|
148
|
-
|
|
158
|
+
{labels.enable}
|
|
149
159
|
</Button>
|
|
150
160
|
<Button
|
|
151
161
|
onClick={handleDismiss}
|
|
152
162
|
size="sm"
|
|
153
163
|
variant="ghost"
|
|
154
164
|
>
|
|
155
|
-
|
|
165
|
+
{labels.notNow}
|
|
156
166
|
</Button>
|
|
157
167
|
</div>
|
|
158
168
|
</div>
|
|
@@ -163,7 +173,7 @@ export function PushPrompt({
|
|
|
163
173
|
size="sm"
|
|
164
174
|
variant="ghost"
|
|
165
175
|
className="flex-shrink-0 p-1"
|
|
166
|
-
aria-label=
|
|
176
|
+
aria-label={labels.dismiss}
|
|
167
177
|
>
|
|
168
178
|
<X className="w-4 h-4" />
|
|
169
179
|
</Button>
|