swimtracker-app/components/IconCard.js

36 lines
1010 B
JavaScript
Raw Normal View History

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';
import { Icon } from "native-base";
2019-09-17 20:24:01 +02:00
const IconCard = props => {
return (
<View style={styles.card}>
2020-05-16 12:36:05 +02:00
<View style={{ alignItems: 'center', justifyContent: 'center', paddingLeft: 20 }}>
<Icon style={{ color: 'white', fontSize: 40 }} name={props.iconName} type={props.iconType} />
<Text style={{ color: 'white', marginTop: 5 }}> {props.label}</Text>
2019-09-17 20:24:01 +02:00
</View>
2020-05-16 12:36:05 +02:00
<View style={{ paddingRight: 20 }}>
<Text style={{ color: 'white', fontSize: props.fontSize }}> {props.value}</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',
backgroundColor: 'rgba(0, 0, 0, 0.2)',
margin: 5,
padding: 5,
borderRadius: 3,
justifyContent: 'space-between',
}
});
2020-05-16 12:36:05 +02:00
IconCard.defaultProps = {
fontSize: 85
2019-09-17 20:24:01 +02:00
};
export default IconCard;