Skip to content

Commit 6e5cc5a

Browse files
committed
upate
1 parent 867abf7 commit 6e5cc5a

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

hackathon/spacecraft/src/screens/StarshipDetailsScreen.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React from "react";
21
import {
2+
Alert,
33
Pressable,
44
ScrollView,
55
StyleSheet,
66
TouchableOpacity,
77
View,
88
} from "react-native";
9-
import { Chip, DataTable, FAB, List, Text } from "react-native-paper";
9+
import { Chip, DataTable, FAB, List, Text, useTheme } from "react-native-paper";
1010
import { useSharedValue, withSpring } from "react-native-reanimated";
1111
import { FontAwesome5 } from "@expo/vector-icons";
1212
import { useNavigation } from "@react-navigation/native";
@@ -38,28 +38,30 @@ export const StarshipDetailsScreen = ({
3838
hyperdrive_rating,
3939
max_atmosphering_speed,
4040
model,
41-
// @ts-ignore
41+
//@ts-expect-error the api does not have `image` field
4242
image,
4343
} = route.params;
4444

45-
// const source = useImage(name);
4645
const navigation = useNavigation();
4746

4847
const handleClose = () => {
4948
navigation.goBack();
5049
};
5150

5251
const handleBuy = () => {
53-
// Alert.alert("Give me the money!");
52+
Alert.alert("Give me the money!");
5453
};
5554

5655
const scale = useSharedValue(1);
5756

57+
const theme = useTheme();
58+
5859
return (
59-
<View>
60+
<View style={{ backgroundColor: theme.colors.background }}>
6061
<ScrollView>
6162
<View style={styles.scrollContainer}>
62-
<View style={styles.imageContainer}>
63+
{/* eslint-disable-next-line react-native/no-color-literals -- keep it always black */}
64+
<View style={[styles.imageContainer, { backgroundColor: "black" }]}>
6365
<Image
6466
style={{ width: "100%", height: 350 }}
6567
source={image}
@@ -68,7 +70,8 @@ export const StarshipDetailsScreen = ({
6870
<View style={[styles.closeContainer, styles.left]}>
6971
<TouchableOpacity
7072
onPress={handleClose}
71-
style={styles.closeButton}
73+
// eslint-disable-next-line react-native/no-color-literals -- keep it always white
74+
style={[styles.closeButton, { backgroundColor: "white" }]}
7275
>
7376
<FontAwesome5
7477
name="times"
@@ -163,7 +166,6 @@ const styles = StyleSheet.create({
163166
paddingVertical: 24,
164167
},
165168
closeButton: {
166-
backgroundColor: "white",
167169
borderRadius: 50,
168170
paddingHorizontal: 12,
169171
paddingVertical: 8,
@@ -178,7 +180,6 @@ const styles = StyleSheet.create({
178180
right: 42,
179181
},
180182
imageContainer: {
181-
backgroundColor: "black",
182183
paddingTop: 32,
183184
},
184185
left: {

0 commit comments

Comments
 (0)