forked from BeingBharat/BSBOceanProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDetailScreen.js
More file actions
36 lines (32 loc) · 903 Bytes
/
DetailScreen.js
File metadata and controls
36 lines (32 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// DetailsScreen.js
import React from 'react';
import { View, Text, Button, StyleSheet } from 'react-native';
const DetailsScreen = ({ route, navigation }) => {
// Extract parameters
const { itemId, itemName } = route.params || { itemId: 'No ID', itemName: 'No Name' };
return (
<View style={styles.container} testID="details-screen">
<Text style={styles.title}>Details Screen</Text>
<Text testID="item-id">Item ID: {itemId}</Text>
<Text testID="item-name">Item Name: {itemName}</Text>
<Button
title="Go Back"
onPress={() => navigation.goBack()}
testID="back-button"
/>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#f0f0f0',
},
title: {
fontSize: 24,
marginBottom: 20,
},
});
export default DetailsScreen;