@@ -70,49 +70,54 @@ export type AvatarProps = AvatarPrimitive.AvatarProps &
70
70
const Avatar = React . forwardRef <
71
71
React . ElementRef < typeof AvatarPrimitive . Root > ,
72
72
AvatarProps
73
- > ( ( { className, size, variant, src, fallback, listView, children, ...props } , ref ) => {
74
- const theme = useTheme ( ) ;
75
-
76
- // Process list view styling
77
- const processedCss = {
78
- ...( listView && {
79
- width : "42px" ,
80
- height : "42px" ,
81
- fontSize : "16px" ,
82
- ...( src && {
83
- background : "transparent !important" ,
84
- backgroundColor : "transparent !important" ,
85
- border : "none !important" ,
86
- boxShadow : "none !important" ,
87
- padding : 0 ,
88
- "& img" : {
89
- transform : "scale(1.3)" , // 30% larger icon
90
- }
91
- } )
92
- } )
93
- } ;
94
-
95
- return (
96
- < AvatarPrimitive . Root
97
- ref = { ref }
98
- className = { cn ( avatarVariants ( { size, variant, className } ) ) }
99
- css = { processedCss }
100
- { ...props }
101
- >
102
- < AvatarPrimitive . Image
103
- src = { src }
104
- className = "aspect-square h-full w-full object-contain"
105
- css = { getExternalImageStylesFromUrl ( theme . externalImages , src ) }
106
- />
107
- { fallback && (
108
- < AvatarPrimitive . Fallback className = "flex h-full w-full items-center justify-center" >
109
- { fallback . charAt ( 0 ) . toUpperCase ( ) }
110
- </ AvatarPrimitive . Fallback >
111
- ) }
112
- { children }
113
- </ AvatarPrimitive . Root >
114
- ) ;
115
- } ) ;
73
+ > (
74
+ (
75
+ { className, size, variant, src, fallback, listView, children, ...props } ,
76
+ ref ,
77
+ ) => {
78
+ const theme = useTheme ( ) ;
79
+
80
+ // Process list view styling
81
+ const processedCss = {
82
+ ...( listView && {
83
+ width : "42px" ,
84
+ height : "42px" ,
85
+ fontSize : "16px" ,
86
+ ...( src && {
87
+ background : "transparent !important" ,
88
+ backgroundColor : "transparent !important" ,
89
+ border : "none !important" ,
90
+ boxShadow : "none !important" ,
91
+ padding : 0 ,
92
+ "& img" : {
93
+ transform : "scale(1.3)" , // 30% larger icon
94
+ } ,
95
+ } ) ,
96
+ } ) ,
97
+ } ;
98
+
99
+ return (
100
+ < AvatarPrimitive . Root
101
+ ref = { ref }
102
+ className = { cn ( avatarVariants ( { size, variant, className } ) ) }
103
+ css = { processedCss }
104
+ { ...props }
105
+ >
106
+ < AvatarPrimitive . Image
107
+ src = { src }
108
+ className = "aspect-square h-full w-full object-contain"
109
+ css = { getExternalImageStylesFromUrl ( theme . externalImages , src ) }
110
+ />
111
+ { fallback && (
112
+ < AvatarPrimitive . Fallback className = "flex h-full w-full items-center justify-center" >
113
+ { fallback . charAt ( 0 ) . toUpperCase ( ) }
114
+ </ AvatarPrimitive . Fallback >
115
+ ) }
116
+ { children }
117
+ </ AvatarPrimitive . Root >
118
+ ) ;
119
+ } ,
120
+ ) ;
116
121
Avatar . displayName = AvatarPrimitive . Root . displayName ;
117
122
118
123
export { Avatar } ;
0 commit comments