create-expo-stack 2.0.7 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/commands/create-expo-stack.js +65 -49
- package/build/templates/base/App.tsx.ejs +41 -0
- package/build/templates/base/app.json.ejs +43 -0
- package/build/templates/base/assets/adaptive-icon.png +0 -0
- package/build/templates/base/assets/favicon.png +0 -0
- package/build/templates/base/assets/icon.png +0 -0
- package/build/templates/base/assets/splash.png +0 -0
- package/build/templates/base/babel.config.js.ejs +17 -0
- package/build/templates/base/package.json.ejs +75 -0
- package/build/templates/base/tsconfig.json.ejs +16 -0
- package/build/templates/packages/expo-router/expo-env.d.ts +4 -0
- package/build/templates/packages/expo-router/index.ts +1 -0
- package/build/templates/packages/expo-router/metro.config.js +11 -0
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +56 -0
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +58 -0
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +96 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +57 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +52 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +52 -0
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +15 -0
- package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +55 -0
- package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +84 -0
- package/build/templates/packages/nativewind/app.d.ts +2 -0
- package/build/templates/packages/nativewind/tailwind.config.js.ejs +16 -0
- package/build/templates/packages/react-navigation/App.tsx.ejs +8 -0
- package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +99 -0
- package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +98 -0
- package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +62 -0
- package/build/templates/packages/react-navigation/screens/details.tsx.ejs +61 -0
- package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +57 -0
- package/build/templates/packages/react-navigation/screens/one.tsx.ejs +54 -0
- package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +97 -0
- package/build/templates/packages/react-navigation/screens/two.tsx.ejs +54 -0
- package/package.json +3 -2
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<% if (props.useNativewind) { %>
|
|
2
|
+
import { Text, TouchableOpacity, View } from "react-native";
|
|
3
|
+
<% } else { %>
|
|
4
|
+
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
5
|
+
<% } %>
|
|
6
|
+
import { Link } from "expo-router";
|
|
7
|
+
|
|
8
|
+
export default function Page() {
|
|
9
|
+
<% if (props.useNativewind) { %>
|
|
10
|
+
return (
|
|
11
|
+
<View className={styles.container}>
|
|
12
|
+
<View className={styles.main}>
|
|
13
|
+
<View>
|
|
14
|
+
<Text className={styles.title}>Hello World</Text>
|
|
15
|
+
<Text className={styles.subtitle}>This is the first page of your app.</Text>
|
|
16
|
+
</View>
|
|
17
|
+
<Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
|
|
18
|
+
<TouchableOpacity className={styles.button} >
|
|
19
|
+
<Text className={styles.buttonText}>Show Details</Text>
|
|
20
|
+
</TouchableOpacity>
|
|
21
|
+
</Link>
|
|
22
|
+
</View>
|
|
23
|
+
</View>
|
|
24
|
+
);
|
|
25
|
+
<% } else { %>
|
|
26
|
+
return (
|
|
27
|
+
<View style={styles.container}>
|
|
28
|
+
<View style={styles.main}>
|
|
29
|
+
<View>
|
|
30
|
+
<Text style={styles.title}>Hello World</Text>
|
|
31
|
+
<Text style={styles.subtitle}>This is the first page of your app.</Text>
|
|
32
|
+
</View>
|
|
33
|
+
<Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
|
|
34
|
+
<TouchableOpacity style={styles.button} >
|
|
35
|
+
<Text style={styles.buttonText}>Show Details</Text>
|
|
36
|
+
</TouchableOpacity>
|
|
37
|
+
</Link>
|
|
38
|
+
</View>
|
|
39
|
+
</View>
|
|
40
|
+
);
|
|
41
|
+
<% } %>
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
<% if (props.useNativewind) { %>
|
|
45
|
+
const styles = {
|
|
46
|
+
button: "items-center bg-indigo-500 rounded-[28px] shadow-md p-4",
|
|
47
|
+
buttonText: "text-white text-lg font-semibold text-center",
|
|
48
|
+
container: "flex-1 p-6",
|
|
49
|
+
main: "flex-1 max-w-[960] justify-between",
|
|
50
|
+
title: "text-[64px] font-bold",
|
|
51
|
+
subtitle: "text-4xl text-gray-700",
|
|
52
|
+
};
|
|
53
|
+
<% } else { %>
|
|
54
|
+
const styles = StyleSheet.create({
|
|
55
|
+
button: {
|
|
56
|
+
alignItems: "center",
|
|
57
|
+
backgroundColor: "#6366F1",
|
|
58
|
+
borderRadius: 24,
|
|
59
|
+
elevation: 5,
|
|
60
|
+
flexDirection: "row",
|
|
61
|
+
justifyContent: "center",
|
|
62
|
+
padding: 16,
|
|
63
|
+
shadowColor: "#000",
|
|
64
|
+
shadowOffset: {
|
|
65
|
+
height: 2,
|
|
66
|
+
width: 0
|
|
67
|
+
},
|
|
68
|
+
shadowOpacity: 0.25,
|
|
69
|
+
shadowRadius: 3.84
|
|
70
|
+
},
|
|
71
|
+
buttonText: {
|
|
72
|
+
color: "#FFFFFF",
|
|
73
|
+
fontSize: 16,
|
|
74
|
+
fontWeight: "600",
|
|
75
|
+
textAlign: "center",
|
|
76
|
+
},
|
|
77
|
+
container: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
padding: 24,
|
|
80
|
+
},
|
|
81
|
+
main: {
|
|
82
|
+
flex: 1,
|
|
83
|
+
maxWidth: 960,
|
|
84
|
+
marginHorizontal: "auto",
|
|
85
|
+
justifyContent: "space-between",
|
|
86
|
+
},
|
|
87
|
+
title: {
|
|
88
|
+
fontSize: 64,
|
|
89
|
+
fontWeight: "bold",
|
|
90
|
+
},
|
|
91
|
+
subtitle: {
|
|
92
|
+
color: "#38434D",
|
|
93
|
+
fontSize: 36,
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
<% } %>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import FontAwesome from "@expo/vector-icons/FontAwesome";
|
|
2
|
+
import { Link, Tabs } from "expo-router";
|
|
3
|
+
import { Pressable, StyleSheet } from "react-native";
|
|
4
|
+
|
|
5
|
+
function TabBarIcon(props: {
|
|
6
|
+
name: React.ComponentProps<typeof FontAwesome>["name"];
|
|
7
|
+
color: string;
|
|
8
|
+
}) {
|
|
9
|
+
return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function TabLayout() {
|
|
13
|
+
return (
|
|
14
|
+
<Tabs
|
|
15
|
+
screenOptions={{
|
|
16
|
+
tabBarActiveTintColor: "black",
|
|
17
|
+
}}>
|
|
18
|
+
<Tabs.Screen
|
|
19
|
+
name="index"
|
|
20
|
+
options={{
|
|
21
|
+
title: "Tab One",
|
|
22
|
+
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
|
|
23
|
+
headerRight: () => (
|
|
24
|
+
<Link href="/modal" asChild>
|
|
25
|
+
<Pressable>
|
|
26
|
+
{({ pressed }) => (
|
|
27
|
+
<FontAwesome
|
|
28
|
+
name="info-circle"
|
|
29
|
+
size={25}
|
|
30
|
+
color="gray"
|
|
31
|
+
style={[styles.headerRight, { opacity: pressed ? 0.5 : 1 }]}
|
|
32
|
+
/>
|
|
33
|
+
)}
|
|
34
|
+
</Pressable>
|
|
35
|
+
</Link>
|
|
36
|
+
),
|
|
37
|
+
}}
|
|
38
|
+
/>
|
|
39
|
+
<Tabs.Screen
|
|
40
|
+
name="two"
|
|
41
|
+
options={{
|
|
42
|
+
title: "Tab Two",
|
|
43
|
+
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
|
|
44
|
+
}}
|
|
45
|
+
/>
|
|
46
|
+
</Tabs>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const styles = StyleSheet.create({
|
|
51
|
+
headerRight: {
|
|
52
|
+
marginRight: 15
|
|
53
|
+
},
|
|
54
|
+
tabBarIcon: {
|
|
55
|
+
marginBottom: -3
|
|
56
|
+
}
|
|
57
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<% if (props.useNativewind) { %>
|
|
2
|
+
import { Text, View } from "react-native";
|
|
3
|
+
<% } else { %>
|
|
4
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
5
|
+
<% } %>
|
|
6
|
+
|
|
7
|
+
import EditScreenInfo from "../../components/edit-screen-info";
|
|
8
|
+
|
|
9
|
+
export default function TabOneScreen() {
|
|
10
|
+
<% if (props.useNativewind) { %>
|
|
11
|
+
return (
|
|
12
|
+
<View className={styles.container}>
|
|
13
|
+
<Text className={styles.title}>Tab One</Text>
|
|
14
|
+
<View className={styles.separator} />
|
|
15
|
+
<EditScreenInfo path="app/(tabs)/index.tsx" />
|
|
16
|
+
</View>
|
|
17
|
+
);
|
|
18
|
+
<% } else { %>
|
|
19
|
+
return (
|
|
20
|
+
<View style={styles.container}>
|
|
21
|
+
<Text style={styles.title}>Tab One</Text>
|
|
22
|
+
<View style={styles.separator} />
|
|
23
|
+
<EditScreenInfo path="app/(tabs)/index.tsx" />
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
<% } %>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
<% if (props.useNativewind) { %>
|
|
30
|
+
const styles = {
|
|
31
|
+
container: `items-center flex-1 justify-center`,
|
|
32
|
+
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
33
|
+
title: `text-xl font-bold`
|
|
34
|
+
};
|
|
35
|
+
<% } else { %>
|
|
36
|
+
const styles = StyleSheet.create({
|
|
37
|
+
container: {
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
flex: 1,
|
|
40
|
+
justifyContent: "center",
|
|
41
|
+
},
|
|
42
|
+
separator: {
|
|
43
|
+
height: 1,
|
|
44
|
+
marginVertical: 30,
|
|
45
|
+
width: "80%",
|
|
46
|
+
},
|
|
47
|
+
title: {
|
|
48
|
+
fontSize: 20,
|
|
49
|
+
fontWeight: "bold",
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
<% } %>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<% if (props.useNativewind) { %>
|
|
2
|
+
import { Text, View } from "react-native";
|
|
3
|
+
<% } else { %>
|
|
4
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
5
|
+
<% } %>
|
|
6
|
+
|
|
7
|
+
import EditScreenInfo from "../../components/edit-screen-info";
|
|
8
|
+
|
|
9
|
+
export default function TabTwoScreen() {
|
|
10
|
+
<% if (props.useNativewind) { %>
|
|
11
|
+
return (
|
|
12
|
+
<View className={styles.container}>
|
|
13
|
+
<Text className={styles.title}>Tab Two</Text>
|
|
14
|
+
<View className={styles.separator} />
|
|
15
|
+
<EditScreenInfo path="app/(tabs)/index.tsx" />
|
|
16
|
+
</View>
|
|
17
|
+
);
|
|
18
|
+
<% } else { %>
|
|
19
|
+
return (
|
|
20
|
+
<View style={styles.container}>
|
|
21
|
+
<Text style={styles.title}>Tab Two</Text>
|
|
22
|
+
<View style={styles.separator} />
|
|
23
|
+
<EditScreenInfo path="app/(tabs)/two.tsx" />
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
<% } %>
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
<% if (props.useNativewind) { %>
|
|
30
|
+
const styles = {
|
|
31
|
+
container: `items-center flex-1 justify-center`,
|
|
32
|
+
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
33
|
+
title: `text-xl font-bold`
|
|
34
|
+
};
|
|
35
|
+
<% } else { %>
|
|
36
|
+
const styles = StyleSheet.create({
|
|
37
|
+
container: {
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
flex: 1,
|
|
40
|
+
justifyContent: "center",
|
|
41
|
+
},
|
|
42
|
+
separator: {
|
|
43
|
+
height: 1,
|
|
44
|
+
marginVertical: 30,
|
|
45
|
+
width: "80%",
|
|
46
|
+
},
|
|
47
|
+
title: {
|
|
48
|
+
fontSize: 20,
|
|
49
|
+
fontWeight: "bold",
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
<% } %>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Stack } from "expo-router";
|
|
2
|
+
|
|
3
|
+
export const unstable_settings = {
|
|
4
|
+
// Ensure that reloading on `/modal` keeps a back button present.
|
|
5
|
+
initialRouteName: "(tabs)",
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export default function RootLayout() {
|
|
9
|
+
return (
|
|
10
|
+
<Stack>
|
|
11
|
+
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
12
|
+
<Stack.Screen name="modal" options={{ presentation: "modal" }} />
|
|
13
|
+
</Stack>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<% if (props.useNativewind) { %>
|
|
2
|
+
import { Platform, Text, View } from "react-native";
|
|
3
|
+
<% } else { %>
|
|
4
|
+
import { Platform, StyleSheet, Text, View } from "react-native";
|
|
5
|
+
<% } %>
|
|
6
|
+
import { StatusBar } from "expo-status-bar";
|
|
7
|
+
|
|
8
|
+
import EditScreenInfo from "../components/edit-screen-info";
|
|
9
|
+
|
|
10
|
+
export default function ModalScreen() {
|
|
11
|
+
<% if (props.useNativewind) { %>
|
|
12
|
+
return (
|
|
13
|
+
<View className={styles.container}>
|
|
14
|
+
<StatusBar style={Platform.OS === "ios" ? "light" : "auto"} />
|
|
15
|
+
<Text className={styles.title}>Modal</Text>
|
|
16
|
+
<View className={styles.separator} />
|
|
17
|
+
<EditScreenInfo path="app/modal.tsx" />
|
|
18
|
+
</View>
|
|
19
|
+
);
|
|
20
|
+
<% } else { %>
|
|
21
|
+
return (
|
|
22
|
+
<View style={styles.container}>
|
|
23
|
+
<StatusBar style={Platform.OS === "ios" ? "light" : "auto"} />
|
|
24
|
+
<Text style={styles.title}>Modal</Text>
|
|
25
|
+
<View style={styles.separator} />
|
|
26
|
+
<EditScreenInfo path="app/modal.tsx" />
|
|
27
|
+
</View>
|
|
28
|
+
);
|
|
29
|
+
<% } %>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
<% if (props.useNativewind) { %>
|
|
33
|
+
const styles = {
|
|
34
|
+
container: `items-center flex-1 justify-center`,
|
|
35
|
+
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
36
|
+
title: `text-xl font-bold`
|
|
37
|
+
};
|
|
38
|
+
<% } else { %>
|
|
39
|
+
const styles = StyleSheet.create({
|
|
40
|
+
container: {
|
|
41
|
+
alignItems: "center",
|
|
42
|
+
flex: 1,
|
|
43
|
+
justifyContent: "center"
|
|
44
|
+
},
|
|
45
|
+
separator: {
|
|
46
|
+
height: 1,
|
|
47
|
+
marginVertical: 30,
|
|
48
|
+
width: "80%"
|
|
49
|
+
},
|
|
50
|
+
title: {
|
|
51
|
+
fontSize: 20,
|
|
52
|
+
fontWeight: "bold"
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
<% } %>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
<% if (props.useNativewind) { %>
|
|
3
|
+
import { Text, View } from "react-native";
|
|
4
|
+
<% } else { %>
|
|
5
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
6
|
+
<% } %>
|
|
7
|
+
|
|
8
|
+
export default function EditScreenInfo({ path }: { path: string }) {
|
|
9
|
+
<% if (props.useNativewind) { %>
|
|
10
|
+
return (
|
|
11
|
+
<View>
|
|
12
|
+
<View className={styles.getStartedContainer}>
|
|
13
|
+
<Text className={styles.getStartedText}>
|
|
14
|
+
Open up the code for this screen:
|
|
15
|
+
</Text>
|
|
16
|
+
<View className={styles.codeHighlightContainer + styles.homeScreenFilename}>
|
|
17
|
+
<Text>{path}</Text>
|
|
18
|
+
</View>
|
|
19
|
+
<Text className={styles.getStartedText}>
|
|
20
|
+
Change any of the text, save the file, and your app will automatically update.
|
|
21
|
+
</Text>
|
|
22
|
+
</View>
|
|
23
|
+
</View>
|
|
24
|
+
);
|
|
25
|
+
<% } else { %>
|
|
26
|
+
return (
|
|
27
|
+
<View>
|
|
28
|
+
<View style={styles.getStartedContainer}>
|
|
29
|
+
<Text style={styles.getStartedText}>
|
|
30
|
+
Open up the code for this screen:
|
|
31
|
+
</Text>
|
|
32
|
+
<View style={[styles.codeHighlightContainer, styles.homeScreenFilename]}>
|
|
33
|
+
<Text>{path}</Text>
|
|
34
|
+
</View>
|
|
35
|
+
<Text style={styles.getStartedText}>
|
|
36
|
+
Change any of the text, save the file, and your app will automatically update.
|
|
37
|
+
</Text>
|
|
38
|
+
</View>
|
|
39
|
+
</View>
|
|
40
|
+
);
|
|
41
|
+
<% } %>
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
<% if (props.useNativewind) { %>
|
|
45
|
+
const styles = {
|
|
46
|
+
codeHighlightContainer: `rounded-md px-1`,
|
|
47
|
+
getStartedContainer: `items-center mx-12`,
|
|
48
|
+
getStartedText: `text-lg leading-6 text-center`,
|
|
49
|
+
helpContainer: `items-center mx-5 mt-4`,
|
|
50
|
+
helpLink: `py-4`,
|
|
51
|
+
helpLinkText: `text-center`,
|
|
52
|
+
homeScreenFilename: `my-2`,
|
|
53
|
+
};
|
|
54
|
+
<% } else { %>
|
|
55
|
+
const styles = StyleSheet.create({
|
|
56
|
+
codeHighlightContainer: {
|
|
57
|
+
borderRadius: 3,
|
|
58
|
+
paddingHorizontal: 4
|
|
59
|
+
},
|
|
60
|
+
getStartedContainer: {
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
marginHorizontal: 50
|
|
63
|
+
},
|
|
64
|
+
getStartedText: {
|
|
65
|
+
fontSize: 17,
|
|
66
|
+
lineHeight: 24,
|
|
67
|
+
textAlign: "center"
|
|
68
|
+
},
|
|
69
|
+
helpContainer: {
|
|
70
|
+
alignItems: "center",
|
|
71
|
+
marginHorizontal: 20,
|
|
72
|
+
marginTop: 15
|
|
73
|
+
},
|
|
74
|
+
helpLink: {
|
|
75
|
+
paddingVertical: 15
|
|
76
|
+
},
|
|
77
|
+
helpLinkText: {
|
|
78
|
+
textAlign: "center"
|
|
79
|
+
},
|
|
80
|
+
homeScreenFilename: {
|
|
81
|
+
marginVertical: 7
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
<% } %>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
<% if (props.navigationPackage?.name === "react-navigation") { %>
|
|
4
|
+
content: ["./App.{js,ts,tsx}", "./src/**/*.{js,ts,tsx}"],
|
|
5
|
+
<% } else if (props.navigationPackage?.name === "expo-router" && props.navigationPackage?.options === 'tabs') { %>
|
|
6
|
+
content: ["./index.{js,ts,tsx}", "./app/**/*.{js,ts,tsx}", "./components/**/*.{js,ts,tsx}"],
|
|
7
|
+
<% } else if (props.navigationPackage?.name === "expo-router") { %>
|
|
8
|
+
content: ["./index.{js,ts,tsx}", "./app/**/*.{js,ts,tsx}"],
|
|
9
|
+
<% } else { %>
|
|
10
|
+
content: ["./App.{js,ts,tsx}"],
|
|
11
|
+
<% } %>
|
|
12
|
+
theme: {
|
|
13
|
+
extend: {},
|
|
14
|
+
},
|
|
15
|
+
plugins: [],
|
|
16
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
<% if (props.useNativewind) { %>
|
|
3
|
+
import { Text, View } from "react-native";
|
|
4
|
+
<% } else { %>
|
|
5
|
+
import { StyleSheet, Text, View } from "react-native";
|
|
6
|
+
<% } %>
|
|
7
|
+
|
|
8
|
+
<% if (props.useNativewind) { %>
|
|
9
|
+
export default function EditScreenInfo({ path }: { path: string }) {
|
|
10
|
+
return (
|
|
11
|
+
<View>
|
|
12
|
+
<View className={styles.getStartedContainer}>
|
|
13
|
+
<Text
|
|
14
|
+
className={styles.getStartedText}>
|
|
15
|
+
Open up the code for this screen:
|
|
16
|
+
</Text>
|
|
17
|
+
|
|
18
|
+
<View
|
|
19
|
+
className={styles.codeHighlightContainer}
|
|
20
|
+
>
|
|
21
|
+
<Text>{path}</Text>
|
|
22
|
+
</View>
|
|
23
|
+
|
|
24
|
+
<Text
|
|
25
|
+
className={styles.getStartedText}
|
|
26
|
+
>
|
|
27
|
+
Change any of the text, save the file, and your app will automatically update.
|
|
28
|
+
</Text>
|
|
29
|
+
</View>
|
|
30
|
+
</View>
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
<% } else { %>
|
|
34
|
+
export default function EditScreenInfo({ path }: { path: string }) {
|
|
35
|
+
return (
|
|
36
|
+
<View>
|
|
37
|
+
<View style={styles.getStartedContainer}>
|
|
38
|
+
<Text
|
|
39
|
+
style={styles.getStartedText}>
|
|
40
|
+
Open up the code for this screen:
|
|
41
|
+
</Text>
|
|
42
|
+
|
|
43
|
+
<View
|
|
44
|
+
style={[styles.codeHighlightContainer, styles.homeScreenFilename]}
|
|
45
|
+
>
|
|
46
|
+
<Text>{path}</Text>
|
|
47
|
+
</View>
|
|
48
|
+
|
|
49
|
+
<Text
|
|
50
|
+
style={styles.getStartedText}
|
|
51
|
+
>
|
|
52
|
+
Change any of the text, save the file, and your app will automatically update.
|
|
53
|
+
</Text>
|
|
54
|
+
</View>
|
|
55
|
+
</View>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
<% } %>
|
|
59
|
+
|
|
60
|
+
<% if (props.useNativewind) { %>
|
|
61
|
+
const styles = {
|
|
62
|
+
codeHighlightContainer: "rounded-md px-1 my-2",
|
|
63
|
+
getStartedContainer: "items-center mx-12",
|
|
64
|
+
getStartedText: "text-lg leading-6 text-center",
|
|
65
|
+
helpContainer: "items-center mx-5 mt-4",
|
|
66
|
+
helpLink: "py-4",
|
|
67
|
+
helpLinkText: "text-center"
|
|
68
|
+
};
|
|
69
|
+
<% } else { %>
|
|
70
|
+
const styles = StyleSheet.create({
|
|
71
|
+
codeHighlightContainer: {
|
|
72
|
+
borderRadius: 3,
|
|
73
|
+
paddingHorizontal: 4
|
|
74
|
+
},
|
|
75
|
+
getStartedContainer: {
|
|
76
|
+
alignItems: "center",
|
|
77
|
+
marginHorizontal: 50
|
|
78
|
+
},
|
|
79
|
+
getStartedText: {
|
|
80
|
+
fontSize: 17,
|
|
81
|
+
lineHeight: 24,
|
|
82
|
+
textAlign: "center"
|
|
83
|
+
},
|
|
84
|
+
helpContainer: {
|
|
85
|
+
alignItems: "center",
|
|
86
|
+
marginHorizontal: 20,
|
|
87
|
+
marginTop: 15
|
|
88
|
+
},
|
|
89
|
+
helpLink: {
|
|
90
|
+
paddingVertical: 15
|
|
91
|
+
},
|
|
92
|
+
helpLinkText: {
|
|
93
|
+
textAlign: "center"
|
|
94
|
+
},
|
|
95
|
+
homeScreenFilename: {
|
|
96
|
+
marginVertical: 7
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
<% } %>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
<% if (props.navigationPackage?.options === 'stack') { %>
|
|
2
|
+
import { Feather } from "@expo/vector-icons";
|
|
3
|
+
import { NavigationContainer } from "@react-navigation/native";
|
|
4
|
+
import { createStackNavigator } from "@react-navigation/stack";
|
|
5
|
+
<% if (props.useNativewind) { %>
|
|
6
|
+
import { Text, View } from "react-native";
|
|
7
|
+
<% } else { %>
|
|
8
|
+
import { Text, View, StyleSheet } from "react-native";
|
|
9
|
+
<% } %>
|
|
10
|
+
|
|
11
|
+
import Overview from "../screens/overview";
|
|
12
|
+
import Details from "../screens/details";
|
|
13
|
+
|
|
14
|
+
export type RootStackParamList = {
|
|
15
|
+
Overview: undefined;
|
|
16
|
+
Details: { name: string };
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const Stack = createStackNavigator<RootStackParamList>();
|
|
20
|
+
|
|
21
|
+
export default function RootStack() {
|
|
22
|
+
return (
|
|
23
|
+
<NavigationContainer>
|
|
24
|
+
<Stack.Navigator initialRouteName="Overview">
|
|
25
|
+
<Stack.Screen name="Overview" component={Overview} />
|
|
26
|
+
<Stack.Screen
|
|
27
|
+
name="Details"
|
|
28
|
+
component={Details}
|
|
29
|
+
<% if (props.useNativewind) { %>
|
|
30
|
+
options={({ navigation }) => ({
|
|
31
|
+
headerLeft: () => (
|
|
32
|
+
<View className={styles.backButton}>
|
|
33
|
+
<Feather name="chevron-left" size={16} color="#007AFF" />
|
|
34
|
+
<Text className={styles.backButtonText} onPress={navigation.goBack}>Back</Text>
|
|
35
|
+
</View>
|
|
36
|
+
)
|
|
37
|
+
})}
|
|
38
|
+
<% } else { %>
|
|
39
|
+
options={({ navigation }) => ({
|
|
40
|
+
headerLeft: () => (
|
|
41
|
+
<View style={styles.backButton}>
|
|
42
|
+
<Feather name="chevron-left" size={16} color="#007AFF" />
|
|
43
|
+
<Text style={styles.backButtonText} onPress={navigation.goBack}>Back</Text>
|
|
44
|
+
</View>
|
|
45
|
+
)
|
|
46
|
+
})}
|
|
47
|
+
<% } %>
|
|
48
|
+
/>
|
|
49
|
+
</Stack.Navigator>
|
|
50
|
+
</NavigationContainer>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
<% if (props.useNativewind) { %>
|
|
54
|
+
const styles = {
|
|
55
|
+
backButton: "flex-row",
|
|
56
|
+
backButtonText: "text-blue-500 ml-1"
|
|
57
|
+
};
|
|
58
|
+
<% } else { %>
|
|
59
|
+
const styles = StyleSheet.create({
|
|
60
|
+
backButton: {
|
|
61
|
+
flexDirection: "row"
|
|
62
|
+
},
|
|
63
|
+
backButtonText: {
|
|
64
|
+
color: "#007AFF",
|
|
65
|
+
marginLeft: 4
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
<% } %>
|
|
69
|
+
|
|
70
|
+
<% } else { %>
|
|
71
|
+
import { NavigationContainer } from "@react-navigation/native";
|
|
72
|
+
import { createStackNavigator } from "@react-navigation/stack";
|
|
73
|
+
|
|
74
|
+
import Modal from "../screens/modal";
|
|
75
|
+
import TabNavigator from "./tab-navigator";
|
|
76
|
+
|
|
77
|
+
export type RootStackParamList = {
|
|
78
|
+
TabNavigator: undefined;
|
|
79
|
+
Modal: undefined;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const Stack = createStackNavigator<RootStackParamList>();
|
|
83
|
+
|
|
84
|
+
export default function RootStack() {
|
|
85
|
+
return (
|
|
86
|
+
<NavigationContainer>
|
|
87
|
+
<Stack.Navigator initialRouteName="TabNavigator">
|
|
88
|
+
<Stack.Screen
|
|
89
|
+
name="TabNavigator"
|
|
90
|
+
component={TabNavigator}
|
|
91
|
+
options={{ headerShown: false }}
|
|
92
|
+
/>
|
|
93
|
+
<Stack.Screen name="Modal" component={Modal} options={{ presentation: "modal", headerLeft: null }} />
|
|
94
|
+
</Stack.Navigator>
|
|
95
|
+
</NavigationContainer>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
<% } %>
|