88
99import { RenderPropType } from "../../index" ;
1010import { Box , Text , Touchable } from "../../primitives" ;
11- import { getTextFontFamily , useTheme } from "../../theme" ;
11+ import { getTextFontFamily , useTailwind , useTheme } from "../../theme" ;
1212import {
1313 createComponent ,
1414 cx ,
@@ -113,7 +113,7 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
113113 } ,
114114 ref ,
115115 ) => {
116- const tailwind = useTheme ( ) ;
116+ const { ts , gc } = useTailwind ( ) ;
117117 const buttonTheme = useTheme ( "button" ) ;
118118
119119 const { onHoverIn, onHoverOut, hovered } = useOnHover ( ) ;
@@ -131,12 +131,12 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
131131 prefix ?. type === Icon ? (
132132 createIcon ( {
133133 icon : prefix ,
134- iconFill : tailwind . getColor (
134+ iconFill : gc (
135135 isButtonDisabled
136136 ? buttonTheme . themeColor [ themeColor ] ?. [ variant ] ?. icon ?. disabled
137137 : buttonTheme . themeColor [ themeColor ] ?. [ variant ] ?. icon ?. default ,
138138 ) ,
139- iconStyle : tailwind . style ( cx ( buttonTheme . size [ size ] ?. prefix ) ) ,
139+ iconStyle : ts ( cx ( buttonTheme . size [ size ] ?. prefix ) ) ,
140140 } )
141141 ) : (
142142 < ButtonPrefix size = { size } > { prefix as React . ReactNode } </ ButtonPrefix >
@@ -165,12 +165,12 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
165165 suffix ?. type === Icon ? (
166166 createIcon ( {
167167 icon : suffix ,
168- iconFill : tailwind . getColor (
168+ iconFill : gc (
169169 isButtonDisabled
170170 ? buttonTheme . themeColor [ themeColor ] ?. [ variant ] ?. icon ?. disabled
171171 : buttonTheme . themeColor [ themeColor ] ?. [ variant ] ?. icon ?. default ,
172172 ) ,
173- iconStyle : tailwind . style ( cx ( buttonTheme . size [ size ] ?. suffix ) ) ,
173+ iconStyle : ts ( cx ( buttonTheme . size [ size ] ?. suffix ) ) ,
174174 } )
175175 ) : (
176176 < ButtonSuffix size = { size } > { suffix as React . ReactNode } </ ButtonSuffix >
@@ -194,7 +194,7 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
194194 iconOnly ? (
195195 < Box
196196 style = { [
197- tailwind . style (
197+ ts (
198198 cx (
199199 buttonTheme . size [ size ] ?. icon ,
200200 loading ? buttonTheme . loading . children : "" ,
@@ -205,7 +205,7 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
205205 >
206206 { /* @ts -ignore */ }
207207 { React . cloneElement ( iconOnly , {
208- color : tailwind . getColor (
208+ color : gc (
209209 isButtonDisabled
210210 ? buttonTheme . themeColor [ themeColor ] ?. [ variant ] ?. icon . disabled
211211 : buttonTheme . themeColor [ themeColor ] ?. [ variant ] ?. icon . default ,
@@ -218,7 +218,7 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
218218 allowFontScaling = { false }
219219 selectable = { false }
220220 style = { [
221- tailwind . style (
221+ ts (
222222 cx (
223223 buttonTheme . size [ size ] ?. text ,
224224 buttonTheme . themeColor [ themeColor ] ?. [ variant ] ?. text . default ,
@@ -269,7 +269,7 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
269269 < Touchable
270270 style = { ( touchState : PressableStateCallbackType ) => {
271271 return [
272- tailwind . style (
272+ ts (
273273 cx (
274274 buttonTheme . base ,
275275 buttonTheme . size [ size ] ?. default ,
@@ -296,7 +296,7 @@ const RNButton: React.FC<Partial<ButtonProps>> = forwardRef<
296296 boxShadow : `${ generateBoxShadow (
297297 buttonTheme . themeColor [ themeColor ] ?. [ variant ] ?. container
298298 ?. focus ?. offset ,
299- tailwind . getColor (
299+ gc (
300300 cx (
301301 buttonTheme . themeColor [ themeColor ] ?. [ variant ]
302302 ?. container ?. focus ?. color ,
0 commit comments