12345678910111213141516171819202122232425262728293031323334353637 |
- const React = require('react');
- const { Component } = require('react');
- const {
- StyleSheet,
- View,
- TouchableOpacity,
- Text,
- Alert
- } = require('react-native');
-
- class CustomTopBar extends Component {
- render() {
- return (
- <View style={styles.container}>
- <TouchableOpacity onPress={() => Alert.alert(this.props.title, 'Thanks for that :)')}>
- <Text style={styles.text}>{this.props.text}</Text>
- </TouchableOpacity>
- </View>
- );
- }
- }
-
- module.exports = CustomTopBar;
-
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- flexDirection: 'column',
- justifyContent: 'center',
- alignSelf: 'center'
- },
- text: {
- alignSelf: 'center',
- color: 'black',
- }
- });
|