You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							62 lines
						
					
					
						
							1.3 KiB
						
					
					
				
			
		
		
	
	
							62 lines
						
					
					
						
							1.3 KiB
						
					
					
				| import React from "react"; | |
| import { TouchableOpacity, Text, ActivityIndicator } from "react-native"; | |
| import { connect } from "react-redux"; | |
| 
 | |
| //style | |
| import tw from "tailwind-rn"; | |
| import fontSize from "../constants/fontSize"; | |
| 
 | |
| function Pressable1({ | |
|   title, | |
|   backgroundColor, | |
|   color, | |
|   border, | |
|   width, | |
|   onPress, | |
|   loading, | |
|   mobile, | |
|   theme, | |
|   textFontSize, | |
| }) { | |
|   return ( | |
|     <TouchableOpacity | |
|       onPress={() => onPress()} | |
|       style={[ | |
|         tw("rounded-sm py-3 flex flex-row justify-center mb-3"), | |
|         { | |
|           backgroundColor: backgroundColor, | |
|           borderWidth: border.width, | |
|           borderColor: border.color, | |
|           width: width, | |
|         }, | |
|       ]} | |
|     > | |
|       {loading ? ( | |
|         <ActivityIndicator size="small" color={color} /> | |
|       ) : ( | |
|         <Text | |
|           style={{ | |
|             fontSize: mobile | |
|               ? textFontSize | |
|                 ? textFontSize | |
|                 : fontSize.tiny | |
|               : textFontSize | |
|               ? textFontSize | |
|               : fontSize.base, | |
|             color: color, | |
|             fontFamily: "bold", | |
|           }} | |
|         > | |
|           {title} | |
|         </Text> | |
|       )} | |
|     </TouchableOpacity> | |
|   ); | |
| } | |
| 
 | |
| const mapStateToProps = (state) => ({ | |
|   mobile: state.publicApi.mobile, | |
|   theme: state.publicApi.theme, | |
| }); | |
| 
 | |
| export default connect(mapStateToProps)(Pressable1);
 | |
| 
 |