File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
packages/core/src/components Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ type BaseProps = {
3333 delayLongPress ?: number ;
3434 hitSlop ?: number ;
3535 icon ?: string ;
36+ iconSize ?: number ;
37+ iconPosition ?: "left" | "right" ;
3638} & PressableProps &
3739 IconSlot ;
3840
@@ -55,6 +57,8 @@ type Props = {
5557function Base ( {
5658 Icon,
5759 icon,
60+ iconPosition = "left" ,
61+ iconSize = CONSTANTS . icon ,
5862 title,
5963 loading,
6064 disabled,
@@ -117,15 +121,23 @@ function Base({
117121 { loading ? (
118122 < ActivityIndicator size = "small" color = { color } style = { styles . loading } />
119123 ) : null }
120- { icon && ! loading ? (
124+ { iconPosition === "left" && icon && ! loading ? (
121125 < Icon
122126 name = { icon }
123127 color = { color as string }
124128 style = { styles . icon }
125- size = { CONSTANTS . icon }
129+ size = { iconSize }
126130 />
127131 ) : null }
128132 < Text style = { titleStyles } > { title } </ Text >
133+ { iconPosition === "right" && icon && ! loading ? (
134+ < Icon
135+ name = { icon }
136+ color = { color as string }
137+ style = { styles . icon }
138+ size = { iconSize }
139+ />
140+ ) : null }
129141 </ Pressable >
130142 ) ;
131143}
You can’t perform that action at this time.
0 commit comments