2019-09-17 20:24:01 +02:00
|
|
|
import React from 'react';
|
2020-05-16 12:36:05 +02:00
|
|
|
import { View, StyleSheet, Text } from 'react-native';
|
2021-05-24 13:19:04 +02:00
|
|
|
import EntypoIcon from "react-native-vector-icons/Entypo";
|
|
|
|
import AntDesignIcon from "react-native-vector-icons/AntDesign";
|
|
|
|
import Fa5Icon from "react-native-vector-icons/FontAwesome5";
|
2019-09-17 20:24:01 +02:00
|
|
|
|
|
|
|
const IconCard = props => {
|
2021-07-22 18:39:02 +02:00
|
|
|
let IconClass;
|
2021-05-24 13:19:04 +02:00
|
|
|
if (props.iconType === "AntDesign") {
|
2021-07-22 18:39:02 +02:00
|
|
|
IconClass = AntDesignIcon;
|
2021-05-24 13:19:04 +02:00
|
|
|
}
|
|
|
|
else if (props.iconType === "FontAwesome5") {
|
2021-07-22 18:39:02 +02:00
|
|
|
IconClass = Fa5Icon;
|
2021-05-24 13:19:04 +02:00
|
|
|
} else if (props.iconType === "Entypo") {
|
2021-07-22 18:39:02 +02:00
|
|
|
IconClass = EntypoIcon;
|
2021-05-24 13:19:04 +02:00
|
|
|
}
|
2019-09-17 20:24:01 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<View style={styles.card}>
|
2020-06-02 17:19:09 +02:00
|
|
|
|
|
|
|
<View style={{ paddingLeft: 20 }}>
|
|
|
|
<Text style={{ color: 'white', fontSize: props.fontSize, textAlign: "center" }}> {props.value}</Text>
|
|
|
|
</View>
|
2021-05-24 13:19:04 +02:00
|
|
|
<View style={{ alignItems: 'center', justifyContent: 'center', paddingLeft: 20 }}>
|
2023-10-28 14:07:27 +02:00
|
|
|
<IconClass style={{ color: 'white', fontSize: 30 }} name={props.iconName} />
|
2020-05-16 12:36:05 +02:00
|
|
|
<Text style={{ color: 'white', marginTop: 5 }}> {props.label}</Text>
|
2019-09-17 20:24:01 +02:00
|
|
|
</View>
|
|
|
|
</View>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
2020-05-16 12:36:05 +02:00
|
|
|
card: {
|
2019-09-17 20:24:01 +02:00
|
|
|
flexDirection: 'row',
|
2020-07-15 15:53:16 +02:00
|
|
|
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
2019-09-17 20:24:01 +02:00
|
|
|
margin: 5,
|
|
|
|
padding: 5,
|
2020-07-15 15:53:16 +02:00
|
|
|
borderRadius: 6,
|
2019-09-17 20:24:01 +02:00
|
|
|
justifyContent: 'space-between',
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2020-05-16 12:36:05 +02:00
|
|
|
IconCard.defaultProps = {
|
2020-06-30 18:06:37 +02:00
|
|
|
fontSize: 65,
|
2020-06-02 17:19:09 +02:00
|
|
|
flex: 1
|
2019-09-17 20:24:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default IconCard;
|