vpt-sebraeds 0.0.8 → 0.0.9
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.
|
@@ -8,6 +8,12 @@ const Avatar = ({
|
|
|
8
8
|
name = '',
|
|
9
9
|
}) => {
|
|
10
10
|
const sizeOptions = {
|
|
11
|
+
Xlarge: {
|
|
12
|
+
container: styles.containerXlarge, // Novo estilo
|
|
13
|
+
image: { width: 109, height: 109, borderRadius: 54 },
|
|
14
|
+
initials: { width: 109, height: 109, borderRadius: 54, alignItems: 'center', justifyContent: 'center', backgroundColor: '#E3E9FF' },
|
|
15
|
+
text: { fontSize: 20, color: '#2A4FDA', fontWeight: '700' },
|
|
16
|
+
},
|
|
11
17
|
large: {
|
|
12
18
|
container: styles.containerLarge,
|
|
13
19
|
image: { width: 64, height: 64, borderRadius: 32 },
|
|
@@ -55,8 +61,8 @@ const Avatar = ({
|
|
|
55
61
|
{imageUrl ? (
|
|
56
62
|
<Image source={{ uri: imageUrl }} style={getImageStyle()} />
|
|
57
63
|
) : (
|
|
58
|
-
<View style={sizeOptions[size].initials}>
|
|
59
|
-
<Text style={sizeOptions[size].text}>
|
|
64
|
+
<View style={sizeOptions[size]?.initials || sizeOptions.medium.initials}>
|
|
65
|
+
<Text style={sizeOptions[size]?.text || sizeOptions.medium.text}>
|
|
60
66
|
{getInitials(name)}
|
|
61
67
|
</Text>
|
|
62
68
|
</View>
|
|
@@ -66,6 +72,12 @@ const Avatar = ({
|
|
|
66
72
|
};
|
|
67
73
|
|
|
68
74
|
const styles = StyleSheet.create({
|
|
75
|
+
containerXlarge: {
|
|
76
|
+
height: 109,
|
|
77
|
+
width: 109,
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
justifyContent: 'center',
|
|
80
|
+
},
|
|
69
81
|
containerLarge: {
|
|
70
82
|
height: 64,
|
|
71
83
|
width: 64,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Avatar/index.jsx"],"names":[],"mappings":";AAGA;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Avatar/index.jsx"],"names":[],"mappings":";AAGA;;;;;sBAoEC;kBAvEiB,OAAO"}
|
|
@@ -2,6 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { TouchableOpacity, Image, StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
const Avatar = ({ size = 'medium', onPress, imageUrl, name = '', }) => {
|
|
4
4
|
const sizeOptions = {
|
|
5
|
+
Xlarge: {
|
|
6
|
+
container: styles.containerXlarge, // Novo estilo
|
|
7
|
+
image: { width: 109, height: 109, borderRadius: 54 },
|
|
8
|
+
initials: { width: 109, height: 109, borderRadius: 54, alignItems: 'center', justifyContent: 'center', backgroundColor: '#E3E9FF' },
|
|
9
|
+
text: { fontSize: 20, color: '#2A4FDA', fontWeight: '700' },
|
|
10
|
+
},
|
|
5
11
|
large: {
|
|
6
12
|
container: styles.containerLarge,
|
|
7
13
|
image: { width: 64, height: 64, borderRadius: 32 },
|
|
@@ -39,14 +45,20 @@ const Avatar = ({ size = 'medium', onPress, imageUrl, name = '', }) => {
|
|
|
39
45
|
return sizeOptions[size] ? sizeOptions[size].image : sizeOptions.medium.image;
|
|
40
46
|
};
|
|
41
47
|
return (<TouchableOpacity onPress={onPress} style={getContentStyle()}>
|
|
42
|
-
{imageUrl ? (<Image source={{ uri: imageUrl }} style={getImageStyle()}/>) : (<View style={sizeOptions[size].initials}>
|
|
43
|
-
<Text style={sizeOptions[size].text}>
|
|
48
|
+
{imageUrl ? (<Image source={{ uri: imageUrl }} style={getImageStyle()}/>) : (<View style={sizeOptions[size]?.initials || sizeOptions.medium.initials}>
|
|
49
|
+
<Text style={sizeOptions[size]?.text || sizeOptions.medium.text}>
|
|
44
50
|
{getInitials(name)}
|
|
45
51
|
</Text>
|
|
46
52
|
</View>)}
|
|
47
53
|
</TouchableOpacity>);
|
|
48
54
|
};
|
|
49
55
|
const styles = StyleSheet.create({
|
|
56
|
+
containerXlarge: {
|
|
57
|
+
height: 109,
|
|
58
|
+
width: 109,
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
justifyContent: 'center',
|
|
61
|
+
},
|
|
50
62
|
containerLarge: {
|
|
51
63
|
height: 64,
|
|
52
64
|
width: 64,
|