@umituz/react-native-auth 2.6.1 → 2.6.2

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": "@umituz/react-native-auth",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "description": "Authentication service for React Native apps - Secure, type-safe, and production-ready. Provider-agnostic design with dependency injection, configurable validation, and comprehensive error handling.",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -35,6 +35,7 @@
35
35
  "@umituz/react-native-design-system-theme": "latest",
36
36
  "@umituz/react-native-firebase-auth": "latest",
37
37
  "@umituz/react-native-localization": "latest",
38
+ "@umituz/react-native-avatar": "latest",
38
39
  "@umituz/react-native-storage": "latest",
39
40
  "@umituz/react-native-validation": "latest",
40
41
  "expo-linear-gradient": ">=13.0.0",
@@ -7,6 +7,7 @@
7
7
  import React from "react";
8
8
  import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
9
9
  import { useAppDesignTokens } from "@umituz/react-native-design-system-theme";
10
+ import { Avatar } from "@umituz/react-native-avatar";
10
11
 
11
12
  export interface ProfileSectionConfig {
12
13
  displayName: string;
@@ -42,14 +43,7 @@ export const ProfileSection: React.FC<ProfileSectionProps> = ({
42
43
  }
43
44
  };
44
45
 
45
- const getInitials = (name: string): string => {
46
- return name
47
- .split(" ")
48
- .map((n) => n[0])
49
- .join("")
50
- .toUpperCase()
51
- .slice(0, 2);
52
- };
46
+
53
47
 
54
48
  return (
55
49
  <TouchableOpacity
@@ -60,23 +54,13 @@ export const ProfileSection: React.FC<ProfileSectionProps> = ({
60
54
  >
61
55
  <View style={styles.content}>
62
56
  {/* Avatar */}
63
- <View
64
- style={[
65
- styles.avatar,
66
- { backgroundColor: profile.isAnonymous ? tokens.colors.warning : tokens.colors.primary },
67
- ]}
68
- >
69
- {profile.avatarUrl ? (
70
- <Text style={styles.avatarText}>
71
- {getInitials(profile.displayName)}
72
- </Text>
73
- ) : (
74
- <Text
75
- style={[styles.avatarText, { color: tokens.colors.onPrimary }]}
76
- >
77
- {getInitials(profile.displayName)}
78
- </Text>
79
- )}
57
+ <View style={styles.avatarContainer}>
58
+ <Avatar
59
+ uri={profile.avatarUrl}
60
+ name={profile.displayName || (profile.isAnonymous ? anonymousText : signInText)}
61
+ size="md"
62
+ shape="circle"
63
+ />
80
64
  </View>
81
65
 
82
66
  {/* User Info */}
@@ -161,18 +145,9 @@ const styles = StyleSheet.create({
161
145
  flexDirection: "row",
162
146
  alignItems: "center",
163
147
  },
164
- avatar: {
165
- width: 56,
166
- height: 56,
167
- borderRadius: 28,
168
- justifyContent: "center",
169
- alignItems: "center",
148
+ avatarContainer: {
170
149
  marginRight: 12,
171
150
  },
172
- avatarText: {
173
- fontSize: 20,
174
- fontWeight: "600",
175
- },
176
151
  info: {
177
152
  flex: 1,
178
153
  },