File tree 2 files changed +17
-3
lines changed
packages/strapi-design-system/src/Avatar
2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -70,24 +70,37 @@ const InitialsWrapper = styled(Flex)`
70
70
}
71
71
` ;
72
72
73
- export const Initials = ( { children } ) => {
73
+ export const Initials = ( { children, background , textColor } ) => {
74
74
return (
75
75
< InitialsWrapper
76
+ background = { background }
76
77
borderRadius = "50%"
77
78
width = { `${ avatarSize } px` }
78
79
height = { `${ avatarSize } px` }
79
- background = "primary600"
80
80
justifyContent = "center"
81
81
>
82
- < Typography fontWeight = "bold" textColor = "buttonNeutral0" fontSize = { 0 } textTransform = "uppercase" >
82
+ < Typography fontSize = { 0 } fontWeight = "bold" textColor = { textColor } textTransform = "uppercase" >
83
83
{ children }
84
84
</ Typography >
85
85
</ InitialsWrapper >
86
86
) ;
87
87
} ;
88
88
89
+ Initials . defaultProps = {
90
+ background : 'primary600' ,
91
+ textColor : 'buttonNeutral0' ,
92
+ } ;
93
+
89
94
Initials . propTypes = {
95
+ /**
96
+ * Initials background, default is primary600
97
+ */
98
+ background : PropTypes . string ,
90
99
children : PropTypes . node . isRequired ,
100
+ /**
101
+ * Initials textColor, default is buttonNeutral0
102
+ */
103
+ textColor : PropTypes . string ,
91
104
} ;
92
105
93
106
Avatar . defaultProps = {
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ The avatar has a feature to display a preview of its thumbnail.
58
58
<Story name = " initials" >
59
59
<Box padding = { 11 } >
60
60
<Initials >MF</Initials >
61
+ <Initials background = " secondary100" textColor = " secondary600" >MC</Initials >
61
62
</Box >
62
63
</Story >
63
64
</Canvas >
You can’t perform that action at this time.
0 commit comments