This is a simple React Native application that I developed as part of a task to display a text message with specific styles.
In this project, I made the following modifications to the App.js
file:
- Changed the background color of the
View
component. - Edited the
Text
component to display "My name is Benson Otti". - Increased the font size of the text to 24.
- Made the name "Benson Otti" bold.
Screenshot 2024-05-26 194420.png
My Student ID: 11296671
- Clone this repository:
git clone https://github.com/Rizculla/rn-assignment2-ID-11296671.git
- Navigate to the project directory:
cd rn-assignment2-ID-11296671
- Install the dependencies:
npm install
- Run the project:
npm start
Here is the code for the App.js
file:
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text style={styles.text}>
My name is <Text style={styles.boldText}>Benson Otti</Text>
</Text>
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#f0f8ff', // Changed the background color
alignItems: 'center',
justifyContent: 'center',
},
text: {
fontSize: 24, // Increased the font size
},
boldText: {
fontWeight: 'bold',
},
});