@djangocfg/layouts 2.1.100 → 2.1.101

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.100",
3
+ "version": "2.1.101",
4
4
  "description": "Simple, straightforward layout components for Next.js - import and use with props",
5
5
  "keywords": [
6
6
  "layouts",
@@ -92,11 +92,11 @@
92
92
  "check": "tsc --noEmit"
93
93
  },
94
94
  "peerDependencies": {
95
- "@djangocfg/api": "^2.1.100",
96
- "@djangocfg/centrifugo": "^2.1.100",
97
- "@djangocfg/ui-core": "^2.1.100",
98
- "@djangocfg/ui-nextjs": "^2.1.100",
99
- "@djangocfg/ui-tools": "^2.1.100",
95
+ "@djangocfg/api": "^2.1.101",
96
+ "@djangocfg/centrifugo": "^2.1.101",
97
+ "@djangocfg/ui-core": "^2.1.101",
98
+ "@djangocfg/ui-nextjs": "^2.1.101",
99
+ "@djangocfg/ui-tools": "^2.1.101",
100
100
  "@hookform/resolvers": "^5.2.0",
101
101
  "consola": "^3.4.2",
102
102
  "lucide-react": "^0.545.0",
@@ -119,7 +119,7 @@
119
119
  "uuid": "^11.1.0"
120
120
  },
121
121
  "devDependencies": {
122
- "@djangocfg/typescript-config": "^2.1.100",
122
+ "@djangocfg/typescript-config": "^2.1.101",
123
123
  "@types/node": "^24.7.2",
124
124
  "@types/react": "^19.1.0",
125
125
  "@types/react-dom": "^19.1.0",
@@ -4,7 +4,7 @@
4
4
  import React from 'react';
5
5
  import moment from 'moment';
6
6
 
7
- import { AccountsProvider, useAuth } from '@djangocfg/api/auth';
7
+ import { useAuth } from '@djangocfg/api/auth';
8
8
  import {
9
9
  Card, CardContent, CardDescription, CardHeader, CardTitle, Preloader
10
10
  } from '@djangocfg/ui-nextjs/components';
@@ -133,10 +133,6 @@ const ProfileContent = ({
133
133
  };
134
134
 
135
135
  export const ProfileLayout: React.FC<ProfileLayoutProps> = (props) => {
136
- return (
137
- <AccountsProvider>
138
- <ProfileContent {...props} />
139
- </AccountsProvider>
140
- );
136
+ return <ProfileContent {...props} />;
141
137
  };
142
138
 
@@ -4,14 +4,13 @@ import { Check, Upload, X } from 'lucide-react';
4
4
  import React, { useState } from 'react';
5
5
  import { toast } from '@djangocfg/ui-core/hooks';
6
6
 
7
- import { useAccountsContext, useAuth } from '@djangocfg/api/auth';
7
+ import { useAuth } from '@djangocfg/api/auth';
8
8
  import { Avatar, AvatarFallback, Button } from '@djangocfg/ui-nextjs/components';
9
9
 
10
10
  import { profileLogger } from '../../../utils/logger';
11
11
 
12
12
  export const AvatarSection = () => {
13
- const { user } = useAuth();
14
- const accounts = useAccountsContext();
13
+ const { user, uploadAvatar } = useAuth();
15
14
  const [avatarFile, setAvatarFile] = useState<File | null>(null);
16
15
  const [avatarPreview, setAvatarPreview] = useState<string | null>(null);
17
16
  const [isUploading, setIsUploading] = useState(false);
@@ -55,9 +54,7 @@ export const AvatarSection = () => {
55
54
  if (!avatarFile) return;
56
55
  setIsUploading(true);
57
56
  try {
58
- const formData = new FormData();
59
- formData.append('avatar', avatarFile);
60
- await accounts.uploadAvatar(formData as any);
57
+ await uploadAvatar(avatarFile);
61
58
  toast.success('Avatar updated successfully');
62
59
  setAvatarFile(null);
63
60
  setAvatarPreview(null);
@@ -6,8 +6,8 @@ import { useForm } from 'react-hook-form';
6
6
  import { toast } from '@djangocfg/ui-core/hooks';
7
7
 
8
8
  import {
9
- PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema, type
10
- useAccountsContext, useAuth
9
+ PatchedUserProfileUpdateRequest, PatchedUserProfileUpdateRequestSchema,
10
+ useAuth
11
11
  } from '@djangocfg/api/auth';
12
12
  import {
13
13
  Button, Form, FormControl, FormField, FormItem, FormLabel, FormMessage, Input, Label, PhoneInput
@@ -17,8 +17,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
17
17
  import { profileLogger } from '../../../utils/logger';
18
18
 
19
19
  export const ProfileForm = () => {
20
- const { user } = useAuth();
21
- const accounts = useAccountsContext();
20
+ const { user, updateProfile } = useAuth();
22
21
  const [isEditing, setIsEditing] = useState(false);
23
22
  const [isSaving, setIsSaving] = useState(false);
24
23
 
@@ -49,7 +48,7 @@ export const ProfileForm = () => {
49
48
  const handleSubmit = async (data: PatchedUserProfileUpdateRequest) => {
50
49
  setIsSaving(true);
51
50
  try {
52
- await accounts.partialUpdateProfile(data);
51
+ await updateProfile(data);
53
52
  toast.success('Profile updated successfully');
54
53
  setIsEditing(false);
55
54
  } catch (error: any) {