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.
 
 
 
 
 

49 lines
1.1 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
}) {
return (
<TouchableOpacity
onPress={() => onPress()}
style={[
tw("rounded-md 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 ? fontSize.lg : fontSize.xl, color: color, fontFamily: "bold" }}
>
{title}
</Text>
)}
</TouchableOpacity>
);
}
const mapStateToProps = (state) => ({
mobile : state.publicApi.mobile
})
export default connect(mapStateToProps)(Pressable1);