48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
import { StyleSheet, View, Pressable, Text } from 'react-native';
|
|
import FontAwesome from "@expo/vector-icons/FontAwesome";
|
|
|
|
export default function Button({ label, override, onPress }) {
|
|
if (override) {
|
|
return (
|
|
<View style={styles.buttonContainer}>
|
|
<Pressable style={styles.button} onPress={onPress}>
|
|
<FontAwesome
|
|
name="picture-o"
|
|
size={18}
|
|
color="#25292e"
|
|
style={styles.buttonIcon}
|
|
/>
|
|
<Text style={styles.primaryButtonLabel}>{label}</Text>
|
|
</Pressable>
|
|
</View>
|
|
);
|
|
} else {
|
|
return (
|
|
<View style={styles.buttonContainer}>
|
|
<Pressable style={styles.button} onPress={onPress}>
|
|
<Text style={styles.buttonLabel}>{label}</Text>
|
|
</Pressable>
|
|
</View>
|
|
);
|
|
}
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
buttonContainer: {
|
|
display: 'flex',
|
|
flexDirection: 'row',
|
|
alignItems: 'center',
|
|
width: 320,
|
|
height: 68,
|
|
marginHorizontal: 20,
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
padding: 3,
|
|
backgroundColor: '#E3F988',
|
|
borderRadius: 80
|
|
},
|
|
buttonIcon: {
|
|
position: 'absolute',
|
|
marginLeft: -30
|
|
}
|
|
}); |