react-native-animated-overlay
Version:
React Native Animated Overlay support IOS & Android.
35 lines (28 loc) • 745 B
JavaScript
// @flow
import React from 'react';
import { Text, StyleSheet, TouchableOpacity, Dimensions } from 'react-native';
const { width: WIDTH, height: HEIGHT } = Dimensions.get('window');
function Button({ text, onPress }) {
return (
<TouchableOpacity style={styles.button} onPress={onPress}>
<Text style={styles.buttonText}>{text}</Text>
</TouchableOpacity>
);
}
const styles = StyleSheet.create({
button: {
width: WIDTH * 0.4,
height: HEIGHT * 0.08,
borderRadius: 50,
borderWidth: 0,
backgroundColor: '#009688',
justifyContent: 'space-around',
},
buttonText: {
alignSelf: 'center',
fontSize: 15,
color: 'rgba(255,255,255,0.9)',
fontWeight: '100',
},
});
export default Button;