@djangocfg/layouts 2.1.466 → 2.1.469

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/layouts",
3
- "version": "2.1.466",
3
+ "version": "2.1.469",
4
4
  "description": "Simple, straightforward layout components for Next.js - import and use with props",
5
5
  "keywords": [
6
6
  "layouts",
@@ -89,11 +89,11 @@
89
89
  "check": "tsc --noEmit"
90
90
  },
91
91
  "peerDependencies": {
92
- "@djangocfg/api": "^2.1.466",
93
- "@djangocfg/centrifugo": "^2.1.466",
94
- "@djangocfg/devtools": "^2.1.466",
95
- "@djangocfg/i18n": "^2.1.466",
96
- "@djangocfg/ui-core": "^2.1.466",
92
+ "@djangocfg/api": "^2.1.469",
93
+ "@djangocfg/centrifugo": "^2.1.469",
94
+ "@djangocfg/devtools": "^2.1.469",
95
+ "@djangocfg/i18n": "^2.1.469",
96
+ "@djangocfg/ui-core": "^2.1.469",
97
97
  "@hookform/resolvers": "^5.2.2",
98
98
  "consola": "^3.4.2",
99
99
  "lucide-react": "^0.545.0",
@@ -124,13 +124,13 @@
124
124
  "uuid": "^11.1.1"
125
125
  },
126
126
  "devDependencies": {
127
- "@djangocfg/api": "^2.1.466",
128
- "@djangocfg/centrifugo": "^2.1.466",
129
- "@djangocfg/devtools": "^2.1.466",
130
- "@djangocfg/i18n": "^2.1.466",
131
- "@djangocfg/typescript-config": "^2.1.466",
132
- "@djangocfg/ui-core": "^2.1.466",
133
- "@djangocfg/ui-tools": "^2.1.466",
127
+ "@djangocfg/api": "^2.1.469",
128
+ "@djangocfg/centrifugo": "^2.1.469",
129
+ "@djangocfg/devtools": "^2.1.469",
130
+ "@djangocfg/i18n": "^2.1.469",
131
+ "@djangocfg/typescript-config": "^2.1.469",
132
+ "@djangocfg/ui-core": "^2.1.469",
133
+ "@djangocfg/ui-tools": "^2.1.469",
134
134
  "@types/node": "^25.9.5",
135
135
  "@types/react": "19.2.15",
136
136
  "@types/react-dom": "19.2.3",
@@ -23,6 +23,8 @@ export interface ProfileLabels {
23
23
  personalInfo: string;
24
24
  work: string;
25
25
  preferences: string;
26
+ actions: string;
27
+ signOut: string;
26
28
  firstName: string;
27
29
  lastName: string;
28
30
  phone: string;
@@ -58,6 +60,8 @@ export function useProfileSave(title?: string): UseProfileSaveReturn {
58
60
  personalInfo: t('layouts.profilePage.personalInfo'),
59
61
  work: t('layouts.profilePage.work'),
60
62
  preferences: 'Preferences',
63
+ actions: t('layouts.profilePage.actions'),
64
+ signOut: t('layouts.profilePage.signOut'),
61
65
  firstName: t('layouts.profilePage.firstName'),
62
66
  lastName: t('layouts.profilePage.lastName'),
63
67
  phone: t('layouts.profilePage.phone'),
@@ -1,9 +1,10 @@
1
1
  'use client';
2
2
 
3
3
  import React from 'react';
4
+ import { LogOut } from 'lucide-react';
4
5
 
5
6
  import { useAuth } from '@djangocfg/api/auth';
6
- import { SettingRow, SettingsBlock } from '@djangocfg/ui-core/components';
7
+ import { Button, SettingRow, SettingsBlock } from '@djangocfg/ui-core/components';
7
8
 
8
9
  import { AvatarSection } from '../components/AvatarSection';
9
10
  import { useProfileSave } from '../hooks/useProfileSave';
@@ -26,7 +27,7 @@ interface AccountSectionProps {
26
27
  export const AccountSection: React.FC<AccountSectionProps> = ({
27
28
  enableDeleteAccount = true,
28
29
  }) => {
29
- const { labels, save: onFieldSave } = useProfileSave();
30
+ const { labels, save: onFieldSave, logout } = useProfileSave();
30
31
  const { user } = useAuth();
31
32
 
32
33
  if (!user) return null;
@@ -83,6 +84,23 @@ export const AccountSection: React.FC<AccountSectionProps> = ({
83
84
  <PreferencesRows />
84
85
  </SettingsBlock>
85
86
 
87
+ <SettingsBlock title={labels.actions}>
88
+ <SettingRow
89
+ label={labels.signOut}
90
+ action={
91
+ <Button
92
+ variant="outline"
93
+ size="sm"
94
+ onClick={logout}
95
+ className="shrink-0 border-destructive/40 text-destructive hover:bg-destructive/10 hover:text-destructive"
96
+ >
97
+ <LogOut className="size-4" />
98
+ {labels.signOut}
99
+ </Button>
100
+ }
101
+ />
102
+ </SettingsBlock>
103
+
86
104
  {enableDeleteAccount && (
87
105
  // The whole Danger zone is collapsible (closed by default) so
88
106
  // destructive actions stay tucked away until deliberately revealed.
@@ -3,7 +3,7 @@
3
3
  import React from 'react';
4
4
  import { Loader2, Trash2 } from 'lucide-react';
5
5
 
6
- import { useAuth, useDeleteAccount } from '@djangocfg/api/auth';
6
+ import { useDeleteAccount } from '@djangocfg/api/auth';
7
7
  import { useAppT } from '@djangocfg/i18n';
8
8
  import { Button, SettingRow } from '@djangocfg/ui-core/components';
9
9
 
@@ -14,7 +14,6 @@ import { Button, SettingRow } from '@djangocfg/ui-core/components';
14
14
  * final safety gate.
15
15
  */
16
16
  export const DeleteAccountRow: React.FC = () => {
17
- const { logout } = useAuth();
18
17
  const { deleteAccount, isLoading } = useDeleteAccount();
19
18
  const t = useAppT();
20
19
 
@@ -32,8 +31,7 @@ export const DeleteAccountRow: React.FC = () => {
32
31
 
33
32
  if (value?.toUpperCase() !== confirmationWord.toUpperCase()) return;
34
33
 
35
- const result = await deleteAccount();
36
- if (result.success) logout();
34
+ await deleteAccount();
37
35
  };
38
36
 
39
37
  return (