add custom button

pull/3/head
Rayhân HASSOU 1 year ago
parent 7b3e20bf31
commit 836f4f2f13

@ -1,12 +1,24 @@
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { StyleSheet, Text, View, Alert } from 'react-native';
import CustomButton from './components/CustomButton';
export default function App() {
const handleButtonPress = () => {
console.log("test 1");
};
const handleButtonPress2 = () => {
console.log("test 2");
};
return (
<View style={styles.container}>
<Text>Ceci va etre la page qui charge le splashScreen</Text>
<StatusBar style="auto" />
<CustomButton title="Appuyez-moi" onPress={handleButtonPress} />
<CustomButton title="Autre test" onPress={handleButtonPress2} />
</View>
);
}

@ -0,0 +1,32 @@
import React from 'react';
import { Button, View } from 'react-native';
export default function CustomButton(props) {
return (
<View style={styles.View}>
<Button
title={props.title}
onPress={props.onPress}
/>
</View>
);
}
const styles = StyleSheet.create({
button: {
alignItems: 'center',
justifyContent: 'center',
paddingVertical: 12,
paddingHorizontal: 32,
borderRadius: 4,
elevation: 3,
backgroundColor: 'black',
},
text: {
fontSize: 16,
lineHeight: 21,
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
});
Loading…
Cancel
Save