File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
docs/src/content/docs/guides Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,18 @@ import { useState } from "react";
2626
2727export function RuntimeExample({ color }) {
2828 const [isActive, setIsActive] = useState (false );
29-
29+ const bgColor = tw ` bg-${color }-500 active:bg-${color }-700 ` ;
30+ const textColor = tw ` text-${color }-500 ` ;
3031 return (
3132 <View className = " flex-1 p-4 bg-gray-100" >
3233 <Pressable
3334 onPress = { () => setIsActive (! isActive )}
35+ style = { bgColor .style }
3436 className = { ` p-4 rounded-lg ${isActive ? " bg-green-500" : " bg-red-500" } ` }
3537 >
36- <Text style = { tw ` text-${color }-500 font-bold text-center ` } >{ isActive ? " Active" : " Inactive" } </Text >
38+ <Text style = { textColor .style } className = " font-bold text-center" >
39+ { isActive ? " Active" : " Inactive" }
40+ </Text >
3741 </Pressable >
3842 </View >
3943 );
You can’t perform that action at this time.
0 commit comments