-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClearButton.js
More file actions
40 lines (38 loc) · 891 Bytes
/
ClearButton.js
File metadata and controls
40 lines (38 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from "react";
import { TouchableOpacity, Text, StyleSheet, View } from "react-native";
import PropTypes from "prop-types";
export const ClearButton = ({ variant, handler }) => {
return (
<View data-test="clear-meals-btn">
<TouchableOpacity
onPress={handler}
style={variant === "blue" ? styles.variantBlue : styles.button}
>
<Text style={variant === "blue" ? styles.btnTextBlue : styles.btnText}>
Clear Meals
</Text>
</TouchableOpacity>
</View>
);
};
ClearButton.propTypes = {
variant: PropTypes.string,
};
const styles = StyleSheet.create({
button: {
alignItems: "center",
backgroundColor: "#DDDDDD",
padding: 10,
},
variantBlue: {
backgroundColor: "blue",
padding: 15,
color: "#fff",
},
btnTextBlue: {
color: "#fff",
},
btnText: {
color: "#000",
},
});