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
41
42
43
44
45
46
47
|
import React from 'react';
import {
TouchableOpacity,
TouchableOpacityProps,
Text,
StyleSheet,
View,
} from 'react-native';
interface SubmitButtonProps extends TouchableOpacityProps {
text: string;
color: string;
}
/*
* A button component that creates a TouchableOpacity in the style of our onboarding buttons. It takes in props to define the text in the TouchableOpacity as well as the background color.
*/
const SubmitButton: React.FC<SubmitButtonProps> = (
props: SubmitButtonProps,
) => {
return (
<View {...props}>
<TouchableOpacity
{...props}
style={[styles.button, {backgroundColor: props.color}]}>
<Text style={styles.text}>{props.text}</Text>
</TouchableOpacity>
</View>
);
};
const styles = StyleSheet.create({
button: {
width: 144,
height: 36,
justifyContent: 'center',
alignItems: 'center',
borderRadius: 18,
},
text: {
fontSize: 16,
color: '#78a0ef',
fontWeight: 'bold',
},
});
export default SubmitButton;
|