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 = {
33
33
delayLongPress ?: number ;
34
34
hitSlop ?: number ;
35
35
icon ?: string ;
36
+ iconSize ?: number ;
37
+ iconPosition ?: "left" | "right" ;
36
38
} & PressableProps &
37
39
IconSlot ;
38
40
@@ -55,6 +57,8 @@ type Props = {
55
57
function Base ( {
56
58
Icon,
57
59
icon,
60
+ iconPosition = "left" ,
61
+ iconSize = CONSTANTS . icon ,
58
62
title,
59
63
loading,
60
64
disabled,
@@ -117,15 +121,23 @@ function Base({
117
121
{ loading ? (
118
122
< ActivityIndicator size = "small" color = { color } style = { styles . loading } />
119
123
) : null }
120
- { icon && ! loading ? (
124
+ { iconPosition === "left" && icon && ! loading ? (
121
125
< Icon
122
126
name = { icon }
123
127
color = { color as string }
124
128
style = { styles . icon }
125
- size = { CONSTANTS . icon }
129
+ size = { iconSize }
126
130
/>
127
131
) : null }
128
132
< 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 }
129
141
</ Pressable >
130
142
) ;
131
143
}
You can’t perform that action at this time.
0 commit comments