2020-11-09 10:24:17 +01:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';
|
|
|
|
import { Avatar } from 'react-native-elements';
|
|
|
|
|
|
|
|
import loc from '../loc';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
root: {
|
|
|
|
height: 48,
|
|
|
|
borderRadius: 8,
|
|
|
|
backgroundColor: '#3477F6',
|
|
|
|
flexDirection: 'row',
|
|
|
|
},
|
|
|
|
labelContainer: {
|
|
|
|
flex: 1,
|
|
|
|
justifyContent: 'center',
|
|
|
|
paddingLeft: 16,
|
|
|
|
},
|
|
|
|
labelText: {
|
|
|
|
color: 'white',
|
|
|
|
fontWeight: 'bold',
|
|
|
|
},
|
|
|
|
buttonContainer: {
|
|
|
|
width: 48,
|
|
|
|
alignItems: 'center',
|
|
|
|
justifyContent: 'center',
|
|
|
|
},
|
|
|
|
ball: {
|
|
|
|
width: 26,
|
|
|
|
height: 26,
|
|
|
|
borderRadius: 13,
|
|
|
|
backgroundColor: 'rgba(255, 255, 255, 0.32)',
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2021-01-24 02:38:14 +01:00
|
|
|
const CoinsSelected = ({ number, onContainerPress, onClose }) => (
|
2021-06-24 14:50:57 +02:00
|
|
|
<TouchableOpacity accessibilityRole="button" style={styles.root} onPress={onContainerPress}>
|
2020-11-09 10:24:17 +01:00
|
|
|
<View style={styles.labelContainer}>
|
|
|
|
<Text style={styles.labelText}>{loc.formatString(loc.cc.coins_selected, { number })}</Text>
|
|
|
|
</View>
|
2021-06-24 14:50:57 +02:00
|
|
|
<TouchableOpacity accessibilityRole="button" style={styles.buttonContainer} onPress={onClose}>
|
2020-11-09 10:24:17 +01:00
|
|
|
<Avatar rounded containerStyle={[styles.ball]} icon={{ name: 'close', size: 22, type: 'ionicons', color: 'white' }} />
|
|
|
|
</TouchableOpacity>
|
2021-01-24 02:38:14 +01:00
|
|
|
</TouchableOpacity>
|
2020-11-09 10:24:17 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
CoinsSelected.propTypes = {
|
|
|
|
number: PropTypes.number.isRequired,
|
2021-01-24 02:38:14 +01:00
|
|
|
onContainerPress: PropTypes.func.isRequired,
|
2020-11-09 10:24:17 +01:00
|
|
|
onClose: PropTypes.func.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default CoinsSelected;
|