button component working, the design is not perfect

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

@ -1,24 +1,14 @@
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, Text, View, Alert } from 'react-native';
import CustomButton from './components/CustomButton';
import { StyleSheet, Text, View} from 'react-native';
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>
);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

@ -1,14 +1,12 @@
import React from 'react';
import { Button, View } from 'react-native';
import {StyleSheet,Pressable, Text, Image} from 'react-native';
export default function CustomButton(props) {
return (
<View style={styles.View}>
<Button
title={props.title}
onPress={props.onPress}
/>
</View>
<Pressable style={styles.button} >
<Text style={styles.text}>{props.title}</Text>
</Pressable>
);
}
@ -20,13 +18,16 @@ const styles = StyleSheet.create({
paddingHorizontal: 32,
borderRadius: 4,
elevation: 3,
backgroundColor: 'black',
backgroundColor: 'rgba(0, 0, 0, 0.7)',
},
text: {
width: '100%', // L'image prend toute la largeur du conteneur
height: '100%',
fontSize: 16,
lineHeight: 21,
fontWeight: 'bold',
letterSpacing: 0.25,
color: 'white',
},
});
});

@ -0,0 +1,4 @@
declare module "*.png";
declare module "*.svg";
declare module "*.jpeg";
declare module "*.jpg";

8744
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,7 @@
{
"dependencies": {
"@eva-design/eva": "^2.2.0",
"@ui-kitten/components": "^5.3.1",
"react-native-svg": "^13.14.0"
}
}
Loading…
Cancel
Save