-
Notifications
You must be signed in to change notification settings - Fork 596
Expand file tree
/
Copy pathList.tsx
More file actions
69 lines (65 loc) · 1.7 KB
/
List.tsx
File metadata and controls
69 lines (65 loc) · 1.7 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import * as React from "react";
import { ScrollView, StyleSheet, Text, View, Pressable } from "react-native";
import { useNavigation } from "@react-navigation/native";
import type { NativeStackNavigationProp } from "@react-navigation/native-stack";
import type { Routes } from "./Routes";
export const examples = [
{
screen: "Triangle",
title: "Triangle",
description: "Basic WebGPU Canvas rendering",
},
{
screen: "Wireframes",
title: "Wireframes",
description: "3D wireframe models with offscreen rendering",
},
{
screen: "TexturedCube",
title: "Textured Cube",
description: "Rotating 3D cube with texture mapping",
},
] as const;
const styles = StyleSheet.create({
container: {},
content: {
paddingBottom: 32,
},
thumbnail: {
backgroundColor: "white",
padding: 32,
borderBottomWidth: StyleSheet.hairlineWidth,
},
title: {
color: "black",
fontSize: 16,
fontWeight: "bold",
},
description: {
color: "#666",
fontSize: 14,
marginTop: 4,
},
});
export const List = () => {
const { navigate } =
useNavigation<NativeStackNavigationProp<Routes, "List">>();
return (
<ScrollView style={styles.container} contentContainerStyle={styles.content}>
{examples.map((example) => (
<Pressable
key={example.screen}
onPress={() => {
navigate(example.screen as keyof Routes);
}}
testID={example.screen}
>
<View style={styles.thumbnail}>
<Text style={styles.title}>{example.title}</Text>
<Text style={styles.description}>{example.description}</Text>
</View>
</Pressable>
))}
</ScrollView>
);
};