create-expo-stack 2.4.0-next.43d8ac0 → 2.4.0-next.79e55fd

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.
Files changed (50) hide show
  1. package/build/commands/create-expo-stack.js +30 -16
  2. package/build/templates/base/App.tsx.ejs +3 -0
  3. package/build/templates/base/babel.config.js.ejs +10 -11
  4. package/build/templates/base/package.json.ejs +25 -21
  5. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +41 -0
  6. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/index.tsx.ejs +88 -0
  7. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/two.tsx.ejs +88 -0
  8. package/build/templates/packages/expo-router/drawer/app/(drawer)/_layout.tsx.ejs +43 -19
  9. package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +14 -22
  10. package/build/templates/packages/expo-router/drawer/app/[...unmatched].tsx.ejs +5 -5
  11. package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +39 -30
  12. package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +96 -0
  13. package/build/templates/packages/expo-router/drawer/components/edit-screen-info.tsx.ejs +153 -0
  14. package/build/templates/packages/expo-router/metro.config.js.ejs +16 -0
  15. package/build/templates/packages/expo-router/stack/app/[...unmatched].tsx.ejs +1 -1
  16. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +7 -0
  17. package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +35 -28
  18. package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +29 -43
  19. package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +9 -9
  20. package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +14 -23
  21. package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +13 -23
  22. package/build/templates/packages/expo-router/tabs/app/[...unmatched].tsx.ejs +4 -4
  23. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +7 -0
  24. package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +13 -22
  25. package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +28 -28
  26. package/build/templates/packages/firebase/metro.config.js.ejs +9 -10
  27. package/build/templates/packages/nativewind/global.css +3 -0
  28. package/build/templates/packages/nativewind/metro.config.js +7 -0
  29. package/build/templates/packages/nativewind/tailwind.config.js.ejs +1 -0
  30. package/build/templates/packages/react-navigation/App.tsx.ejs +6 -0
  31. package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +6 -6
  32. package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +41 -6
  33. package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +24 -14
  34. package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +30 -23
  35. package/build/templates/packages/react-navigation/screens/details.tsx.ejs +5 -13
  36. package/build/templates/packages/react-navigation/screens/home.tsx.ejs +83 -0
  37. package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +8 -27
  38. package/build/templates/packages/react-navigation/screens/one.tsx.ejs +7 -26
  39. package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +8 -38
  40. package/build/templates/packages/react-navigation/screens/two.tsx.ejs +7 -26
  41. package/build/templates/packages/unistyles/theme.ts.ejs +68 -18
  42. package/build/templates/packages/unistyles/unistyles.ts.ejs +4 -5
  43. package/build/types/types.d.ts +1 -1
  44. package/build/utilities/configureProjectFiles.js +19 -8
  45. package/build/utilities/generateProjectFiles.js +2 -2
  46. package/build/utilities/runCLI.js +2 -2
  47. package/build/utilities/showHelp.js +2 -1
  48. package/package.json +2 -2
  49. package/build/templates/packages/expo-router/drawer/app/(drawer)/news.tsx.ejs +0 -95
  50. package/build/templates/packages/expo-router/metro.config.js +0 -11
@@ -5,17 +5,25 @@
5
5
  <% } else if (props.stylingPackage?.name === "restyle") { %>
6
6
  import { Box, Text } from 'theme';
7
7
  <% } else if (props.stylingPackage?.name === "unistyles") { %>
8
- import { createStyleSheet, useStyles } from 'react-native-unistyles'
9
- import { Text, View } from "react-native";
8
+ import { useStyles } from 'react-native-unistyles'
9
+ import { Text, View } from 'react-native';
10
10
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
11
11
  import { StyleSheet, Text, View } from "react-native";
12
12
  <% } %>
13
13
 
14
+ import EditScreenInfo from "../../components/edit-screen-info";
15
+
14
16
  const Page = () => {
15
17
  <% if (props.stylingPackage?.name === "unistyles") { %>
16
- const {styles} = useStyles(stylesheet)
17
- <% } %>
18
- <% if (props.stylingPackage?.name === "nativewind") { %>
18
+ const { theme } = useStyles()
19
+
20
+ return (
21
+ <View style={theme.components.container}>
22
+ <Text style={theme.components.title}>Home</Text>
23
+ <View style={theme.components.separator} />
24
+ </View>
25
+ );
26
+ <% } else if (props.stylingPackage?.name === "nativewind") { %>
19
27
  return (
20
28
  <View className={styles.container}>
21
29
  <Text className={styles.title}>Home</Text>
@@ -57,23 +65,6 @@ export default Page;
57
65
  separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
58
66
  title: `text-xl font-bold`
59
67
  };
60
- <% } else if (props.stylingPackage?.name === "unistyles") { %>
61
- const stylesheet = createStyleSheet({
62
- container: {
63
- alignItems: "center",
64
- flex: 1,
65
- justifyContent: "center",
66
- },
67
- separator: {
68
- height: 1,
69
- marginVertical: 30,
70
- width: "80%",
71
- },
72
- title: {
73
- fontSize: 20,
74
- fontWeight: "bold",
75
- }
76
- });
77
68
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
78
69
  const styles = StyleSheet.create({
79
70
  container: {
@@ -82,6 +73,7 @@ export default Page;
82
73
  justifyContent: "center",
83
74
  },
84
75
  separator: {
76
+ backgroundColor: '#d1d5db',
85
77
  height: 1,
86
78
  marginVertical: 30,
87
79
  width: "80%",
@@ -3,7 +3,7 @@ import { Link, Stack } from 'expo-router';
3
3
  import { Text, View } from 'react-native';
4
4
  <% } else if (props.stylingPackage?.name === "unistyles") { %>
5
5
  import { createStyleSheet, useStyles } from 'react-native-unistyles'
6
- import { Text, View } from "react-native";
6
+ import { Text, View } from 'react-native';
7
7
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
8
8
  import { StyleSheet, Text, View } from 'react-native';
9
9
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
@@ -17,7 +17,7 @@ export default function NotFoundScreen() {
17
17
  <% if (props.stylingPackage?.name === "restyle") { %>
18
18
  const styles = useStyles();
19
19
  <% } else if (props.stylingPackage?.name === "unistyles") {%>
20
- const {styles} = useStyles(stylesheet);
20
+ const { styles } = useStyles(stylesheet);
21
21
  <% } %>
22
22
 
23
23
  return (
@@ -77,7 +77,7 @@ export default function NotFoundScreen() {
77
77
  linkText: `text-base text-[#2e78b7]`,
78
78
  };
79
79
  <% } else if (props.stylingPackage?.name === "unistyles") { %>
80
- const stylesheet = createStyleSheet({
80
+ const stylesheet = createStyleSheet((theme) => ({
81
81
  container: {
82
82
  flex: 1,
83
83
  alignItems: 'center',
@@ -94,9 +94,9 @@ export default function NotFoundScreen() {
94
94
  },
95
95
  linkText: {
96
96
  fontSize: 14,
97
- color: '#2e78b7',
97
+ color: theme.colors.astral,
98
98
  },
99
- });
99
+ }));
100
100
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
101
101
  const styles = StyleSheet.create({
102
102
  container: {
@@ -1,13 +1,19 @@
1
+ <% if (props.stylingPackage?.name === "nativewind") { %>
2
+ import '../global.css';
3
+ <% } %>
4
+ <% if (props.stylingPackage?.name === "unistyles") { %>
5
+ import '../unistyles';
6
+ <% } %>
7
+
1
8
  import 'react-native-gesture-handler';
2
9
  import { GestureHandlerRootView } from 'react-native-gesture-handler';
3
- import { Slot } from 'expo-router';
4
- <% if (props.stylingPackage?.name === "tamagui") { %>
5
- import React, { useEffect } from "react";
6
- import { TamaguiProvider } from 'tamagui'
7
- import { SplashScreen } from "expo-router";
8
- import { useFonts } from "expo-font";
10
+ import { Stack } from 'expo-router';
9
11
 
10
- import config from '../tamagui.config'
12
+ <% if (props.stylingPackage?.name==="tamagui" ) { %>
13
+ import React, { useEffect } from "react";
14
+ import { TamaguiProvider } from 'tamagui'
15
+ import { SplashScreen } from "expo-router";
16
+ import { useFonts } from "expo-font";
11
17
 
12
18
  SplashScreen.preventAutoHideAsync();
13
19
  <% } else if (props.stylingPackage?.name === "restyle") { %>
@@ -17,25 +23,25 @@ import { Slot } from 'expo-router';
17
23
  <% } %>
18
24
 
19
25
  export const unstable_settings = {
20
- // Ensure that reloading on `/modal` keeps a back button present.
21
- initialRouteName: "(drawer)",
26
+ // Ensure that reloading on `/modal` keeps a back button present.
27
+ initialRouteName: "(drawer)",
22
28
  };
23
29
 
24
30
  export default function RootLayout() {
25
- <% if (props.stylingPackage?.name === "tamagui") { %>
26
- const [loaded] = useFonts({
27
- Inter: require("@tamagui/font-inter/otf/Inter-Medium.otf"),
28
- InterBold: require("@tamagui/font-inter/otf/Inter-Bold.otf")
29
- });
31
+ <% if (props.stylingPackage?.name==="tamagui" ) { %>
32
+ const [loaded] = useFonts({
33
+ Inter: require("@tamagui/font-inter/otf/Inter-Medium.otf"),
34
+ InterBold: require("@tamagui/font-inter/otf/Inter-Bold.otf")
35
+ });
30
36
 
31
- useEffect(() => {
32
- if (loaded) {
33
- SplashScreen.hideAsync();
34
- }
35
- }, [loaded]);
37
+ useEffect(() => {
38
+ if (loaded) {
39
+ SplashScreen.hideAsync();
40
+ }
41
+ }, [loaded]);
36
42
 
37
- if (!loaded) return null;
38
- <% } %>
43
+ if (!loaded) return null;
44
+ <% } %>
39
45
 
40
46
  return (
41
47
  <% if (props.stylingPackage?.name === "tamagui") { %>
@@ -43,13 +49,16 @@ export default function RootLayout() {
43
49
  <% } else if (props.stylingPackage?.name === "restyle") { %>
44
50
  <ThemeProvider theme={theme}>
45
51
  <% } %>
46
- <GestureHandlerRootView style={{ flex: 1 }}>
47
- <Slot />
48
- </GestureHandlerRootView>
49
- <% if (props.stylingPackage?.name === "tamagui") { %>
50
- </TamaguiProvider>
51
- <% } else if (props.stylingPackage?.name === "restyle") { %>
52
- </ThemeProvider>
53
- <% } %>
54
- );
52
+ <GestureHandlerRootView style={{ flex: 1 }}>
53
+ <Stack>
54
+ <Stack.Screen name="(drawer)" options={{ headerShown: false }} />
55
+ <Stack.Screen name="modal" options={{ title: 'Modal', presentation: 'modal' }} />
56
+ </Stack>
57
+ </GestureHandlerRootView>
58
+ <% if (props.stylingPackage?.name === "tamagui") { %>
59
+ </TamaguiProvider>
60
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
61
+ </ThemeProvider>
62
+ <% } %>
63
+ );
55
64
  }
@@ -0,0 +1,96 @@
1
+ <% if (props.stylingPackage?.name === 'nativewind') { %>
2
+ import { Platform, Text, View } from 'react-native';
3
+ <% } else if (props.stylingPackage?.name === 'tamagui') { %>
4
+ import { YStack, Paragraph, Separator, Theme } from 'tamagui';
5
+ import { Platform } from 'react-native'
6
+ <% } else if (props.stylingPackage?.name === 'restyle') { %>
7
+ import { Platform } from 'react-native';
8
+ import { Box, Text } from 'theme';
9
+ <% } else if (props.stylingPackage?.name === 'unistyles') { %>
10
+ import { useStyles } from 'react-native-unistyles'
11
+ import { Platform, Text, View } from 'react-native';
12
+ <% } else { %>
13
+ import { Platform, StyleSheet, Text, View } from 'react-native';
14
+ <% } %>
15
+ import { StatusBar } from 'expo-status-bar';
16
+
17
+ import EditScreenInfo from '../components/edit-screen-info';
18
+
19
+ export default function ModalScreen() {
20
+ <% if (props.stylingPackage?.name === 'unistyles') { %>
21
+ const { theme } = useStyles()
22
+
23
+ return (
24
+ <View style={theme.components.container}>
25
+ <StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
26
+ <Text style={theme.components.title}>Modal</Text>
27
+ <View style={theme.components.separator} />
28
+ <EditScreenInfo path='app/modal.tsx' />
29
+ </View>
30
+ );
31
+ <% } else if (props.stylingPackage?.name === 'nativewind') { %>
32
+ return (
33
+ <View className={styles.container}>
34
+ <StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
35
+ <Text className={styles.title}>Modal</Text>
36
+ <View className={styles.separator} />
37
+ <EditScreenInfo path='app/modal.tsx' />
38
+ </View>
39
+ );
40
+ <% } else if (props.stylingPackage?.name === 'tamagui') { %>
41
+ return (
42
+ <Theme name='light'>
43
+ <YStack flex={1} alignItems='center' justifyContent='center'>
44
+ <StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
45
+ <Paragraph>Modal</Paragraph>
46
+ <Separator />
47
+ <EditScreenInfo path='app/modal.tsx' />
48
+ </YStack>
49
+ </Theme>
50
+ );
51
+ <% } else if (props.stylingPackage?.name === 'restyle') { %>
52
+ return (
53
+ <Box flex={1} alignItems='center' justifyContent='center'>
54
+ <StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
55
+ <Text variant='title'>Modal</Text>
56
+ <Box height={1} marginVertical='l_32' width='80%' />
57
+ <EditScreenInfo path='app/modal.tsx' />
58
+ </Box>
59
+ );
60
+ <% } else { %>
61
+ return (
62
+ <View style={styles.container}>
63
+ <StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
64
+ <Text style={styles.title}>Modal</Text>
65
+ <View style={styles.separator} />
66
+ <EditScreenInfo path='app/modal.tsx' />
67
+ </View>
68
+ );
69
+ <% } %>
70
+ }
71
+
72
+ <% if (props.stylingPackage?.name === 'nativewind') { %>
73
+ const styles = {
74
+ container: `items-center flex-1 justify-center`,
75
+ separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
76
+ title: `text-xl font-bold`
77
+ };
78
+ <% } else if (props.stylingPackage?.name === 'stylesheet') { %>
79
+ const styles = StyleSheet.create({
80
+ container: {
81
+ alignItems: 'center',
82
+ flex: 1,
83
+ justifyContent: 'center'
84
+ },
85
+ separator: {
86
+ backgroundColor: '#d1d5db',
87
+ height: 1,
88
+ marginVertical: 30,
89
+ width: '80%'
90
+ },
91
+ title: {
92
+ fontSize: 20,
93
+ fontWeight: 'bold'
94
+ }
95
+ });
96
+ <% } %>
@@ -0,0 +1,153 @@
1
+ <% if (props.stylingPackage?.name === 'nativewind') { %>
2
+ import { Text, View } from 'react-native';
3
+ <% } else if (props.stylingPackage?.name === 'tamagui') { %>
4
+ import { YStack, H4, Paragraph } from 'tamagui'
5
+ <% } else if (props.stylingPackage?.name === 'restyle') { %>
6
+ import { Box, Text } from 'theme';
7
+ <% } else if (props.stylingPackage?.name === 'unistyles') { %>
8
+ import { createStyleSheet, useStyles } from 'react-native-unistyles'
9
+ import { Text, View } from 'react-native';
10
+ <% } else { %>
11
+ import { StyleSheet, Text, View } from 'react-native';
12
+ <% } %>
13
+
14
+ export default function EditScreenInfo({ path }: { path: string }) {
15
+ <% if (props.stylingPackage?.name === 'unistyles') { %>
16
+ const { styles } = useStyles(stylesheet);
17
+ <% } %>
18
+ <% if (props.stylingPackage?.name === 'nativewind') { %>
19
+ return (
20
+ <View>
21
+ <View className={styles.getStartedContainer}>
22
+ <Text className={styles.getStartedText}>
23
+ Open up the code for this screen:
24
+ </Text>
25
+ <View className={styles.codeHighlightContainer + styles.homeScreenFilename}>
26
+ <Text>{path}</Text>
27
+ </View>
28
+ <Text className={styles.getStartedText}>
29
+ Change any of the text, save the file, and your app will automatically update.
30
+ </Text>
31
+ </View>
32
+ </View>
33
+ );
34
+ <% } else if (props.stylingPackage?.name === 'tamagui') { %>
35
+ return (
36
+ <YStack>
37
+ <YStack alignItems='center' marginHorizontal='$6'>
38
+ <H4>
39
+ Open up the code for this screen:
40
+ </H4>
41
+ <YStack borderRadius='$3' marginVertical='$1'>
42
+ <Paragraph>{path}</Paragraph>
43
+ </YStack>
44
+ <Paragraph>
45
+ Change any of the text, save the file, and your app will automatically update.
46
+ </Paragraph>
47
+ </YStack>
48
+ </YStack>
49
+ );
50
+ <% } else if (props.stylingPackage?.name === 'restyle') { %>
51
+ return (
52
+ <Box alignItems='center' marginHorizontal='xl_64'>
53
+ <Text variant='body' lineHeight={24} textAlign='center'>
54
+ Open up the code for this screen:
55
+ </Text>
56
+ <Box borderRadius='s_3' paddingHorizontal='xs_4' marginVertical='s_8'>
57
+ <Text>{path}</Text>
58
+ </Box>
59
+ <Text variant='body' lineHeight={24} textAlign='center'>
60
+ Change any of the text, save the file, and your app will automatically update.
61
+ </Text>
62
+ </Box>
63
+ );
64
+ <% } else { %>
65
+ return (
66
+ <View>
67
+ <View style={styles.getStartedContainer}>
68
+ <Text style={styles.getStartedText}>
69
+ Open up the code for this screen:
70
+ </Text>
71
+ <View style={[styles.codeHighlightContainer, styles.homeScreenFilename]}>
72
+ <Text>{path}</Text>
73
+ </View>
74
+ <Text style={styles.getStartedText}>
75
+ Change any of the text, save the file, and your app will automatically update.
76
+ </Text>
77
+ </View>
78
+ </View>
79
+ );
80
+ <% } %>
81
+ }
82
+
83
+ <% if (props.stylingPackage?.name === 'nativewind') { %>
84
+ const styles = {
85
+ codeHighlightContainer: `rounded-md px-1`,
86
+ getStartedContainer: `items-center mx-12`,
87
+ getStartedText: `text-lg leading-6 text-center`,
88
+ helpContainer: `items-center mx-5 mt-4`,
89
+ helpLink: `py-4`,
90
+ helpLinkText: `text-center`,
91
+ homeScreenFilename: `my-2`,
92
+ };
93
+ <% } else if (props.stylingPackage?.name === 'unistyles') { %>
94
+ const stylesheet = createStyleSheet({
95
+ codeHighlightContainer: {
96
+ borderRadius: 3,
97
+ paddingHorizontal: 4
98
+ },
99
+ getStartedContainer: {
100
+ alignItems: 'center',
101
+ marginHorizontal: 50
102
+ },
103
+ getStartedText: {
104
+ fontSize: 17,
105
+ lineHeight: 24,
106
+ textAlign: 'center'
107
+ },
108
+ helpContainer: {
109
+ alignItems: 'center',
110
+ marginHorizontal: 20,
111
+ marginTop: 15
112
+ },
113
+ helpLink: {
114
+ paddingVertical: 15
115
+ },
116
+ helpLinkText: {
117
+ textAlign: 'center'
118
+ },
119
+ homeScreenFilename: {
120
+ marginVertical: 7
121
+ }
122
+ });
123
+ <% } else if (props.stylingPackage?.name === 'stylesheet') { %>
124
+ const styles = StyleSheet.create({
125
+ codeHighlightContainer: {
126
+ borderRadius: 3,
127
+ paddingHorizontal: 4
128
+ },
129
+ getStartedContainer: {
130
+ alignItems: 'center',
131
+ marginHorizontal: 50
132
+ },
133
+ getStartedText: {
134
+ fontSize: 17,
135
+ lineHeight: 24,
136
+ textAlign: 'center'
137
+ },
138
+ helpContainer: {
139
+ alignItems: 'center',
140
+ marginHorizontal: 20,
141
+ marginTop: 15
142
+ },
143
+ helpLink: {
144
+ paddingVertical: 15
145
+ },
146
+ helpLinkText: {
147
+ textAlign: 'center'
148
+ },
149
+ homeScreenFilename: {
150
+ marginVertical: 7
151
+ }
152
+ });
153
+ <% } %>
@@ -0,0 +1,16 @@
1
+ // Learn more https://docs.expo.io/guides/customizing-metro
2
+ const { getDefaultConfig } = require('expo/metro-config');
3
+ <% if (props.stylingPackage?.name === "nativewind") { %>
4
+ const { withNativeWind } = require("nativewind/metro");
5
+ <% } %>
6
+
7
+ /** @type {import('expo/metro-config').MetroConfig} */
8
+ // eslint-disable-next-line no-undef
9
+ const config = getDefaultConfig(__dirname);
10
+
11
+ <% if (props.stylingPackage?.name === "nativewind") { %>
12
+ module.exports = withNativeWind(config, { input: "./global.css" });
13
+ <% } else { %>
14
+ module.exports = config;
15
+ <% } %>
16
+
@@ -19,7 +19,7 @@ export default function NotFoundScreen() {
19
19
  <% } %>
20
20
 
21
21
  <% if (props.stylingPackage?.name === "unistyles") {%>
22
- const {styles} = useStyles(stylesheet)
22
+ const { styles } = useStyles(stylesheet)
23
23
  <% } %>
24
24
 
25
25
  return (
@@ -1,3 +1,10 @@
1
+ <% if (props.stylingPackage?.name === "nativewind") { %>
2
+ import '../global.css';
3
+ <% } %>
4
+ <% if (props.stylingPackage?.name === "unistyles") { %>
5
+ import '../unistyles';
6
+ <% } %>
7
+
1
8
  <% if (props.stylingPackage?.name === "tamagui") { %>
2
9
  import { useFonts } from 'expo-font';
3
10
  import { SplashScreen, Stack } from 'expo-router';
@@ -22,10 +22,17 @@ export default function Details() {
22
22
  const router = useRouter();
23
23
 
24
24
  <% if (props.stylingPackage?.name === "unistyles") { %>
25
- const {styles} = useStyles(stylesheet);
26
- <% } %>
25
+ const { styles, theme } = useStyles(stylesheet);
27
26
 
28
- <% if (props.stylingPackage?.name === "nativewind") { %>
27
+ const BackButton = () => (
28
+ <TouchableOpacity onPress={router.back}>
29
+ <View style={styles.backButton}>
30
+ <Feather name='chevron-left' size={16} color={theme.colors.azureRadiance} />
31
+ <Text style={styles.backButtonText}>Back</Text>
32
+ </View>
33
+ </TouchableOpacity>
34
+ );
35
+ <% } else if (props.stylingPackage?.name === "nativewind") { %>
29
36
  const BackButton = () => (
30
37
  <TouchableOpacity onPress={router.back}>
31
38
  <View className={styles.backButton}>
@@ -92,6 +99,14 @@ export default function Details() {
92
99
  </Box>
93
100
  </Box>
94
101
  </>
102
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
103
+ <View style={styles.container}>
104
+ <Stack.Screen options={{ title: "Details", headerLeft: () => <BackButton /> }} />
105
+ <View style={styles.main}>
106
+ <Text style={theme.components.title}>Details</Text>
107
+ <Text style={theme.components.subtitle}>Showing details for user {name}.</Text>
108
+ </View>
109
+ </View>
95
110
  <% } else { %>
96
111
  <View style={styles.container}>
97
112
  <Stack.Screen options={{ title: "Details", headerLeft: () => <BackButton /> }} />
@@ -114,32 +129,24 @@ export default function Details() {
114
129
  subtitle: "text-4xl text-gray-700",
115
130
  };
116
131
  <% } else if (props.stylingPackage?.name === "unistyles") { %>
117
- const stylesheet = createStyleSheet({
132
+ const stylesheet = createStyleSheet((theme) => ({
118
133
  backButton: {
119
- flexDirection: "row",
120
- },
121
- backButtonText: {
122
- color: "#007AFF",
123
- marginLeft: 4,
124
- },
125
- container: {
126
- flex: 1,
127
- padding: 24,
128
- },
129
- main: {
130
- flex: 1,
131
- maxWidth: 960,
132
- marginHorizontal: "auto",
133
- },
134
- title: {
135
- fontSize: 64,
136
- fontWeight: "bold",
137
- },
138
- subtitle: {
139
- fontSize: 36,
140
- color: "#38434D",
141
- },
142
- });
134
+ flexDirection: 'row',
135
+ },
136
+ backButtonText: {
137
+ color: theme.colors.azureRadiance,
138
+ marginLeft: 4,
139
+ },
140
+ container: {
141
+ flex: 1,
142
+ padding: 24,
143
+ },
144
+ main: {
145
+ flex: 1,
146
+ maxWidth: 960,
147
+ marginHorizontal: 'auto',
148
+ },
149
+ }));
143
150
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
144
151
  const styles = StyleSheet.create({
145
152
  backButton: {
@@ -8,7 +8,7 @@
8
8
  import { Box, Text, makeStyles } from 'theme';
9
9
  <% } else if (props.stylingPackage?.name === "unistyles") { %>
10
10
  import { createStyleSheet, useStyles } from 'react-native-unistyles';
11
- import { Text, TouchableOpacity, View } from "react-native";
11
+ import { Text, TouchableOpacity, View } from 'react-native';
12
12
  <% } else { %>
13
13
  import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
14
14
  <% } %>
@@ -22,7 +22,7 @@ export default function Page() {
22
22
  <% } %>
23
23
 
24
24
  <% if (props.stylingPackage?.name === "unistyles") { %>
25
- const {styles} = useStyles(stylesheet);
25
+ const { styles, theme } = useStyles(stylesheet);
26
26
  <% } %>
27
27
 
28
28
  return (
@@ -77,6 +77,21 @@ export default function Page() {
77
77
  </Box>
78
78
  </Box>
79
79
  </>
80
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
81
+ <View style={styles.container}>
82
+ <View style={styles.main}>
83
+ <Stack.Screen options={{ title: 'Overview' }} />
84
+ <View>
85
+ <Text style={theme.components.title}>Hello World</Text>
86
+ <Text style={theme.components.subtitle}>This is the first page of your app.</Text>
87
+ </View>
88
+ <Link href={{ pathname: '/details', params: { name: 'Dan' } }} asChild>
89
+ <TouchableOpacity style={theme.components.button} >
90
+ <Text style={theme.components.buttonText}>Show Details</Text>
91
+ </TouchableOpacity>
92
+ </Link>
93
+ </View>
94
+ </View>
80
95
  <% } else { %>
81
96
  <View style={styles.container}>
82
97
  <View style={styles.main}>
@@ -126,47 +141,18 @@ export default function Page() {
126
141
  }));
127
142
  <% } else if (props.stylingPackage?.name === "unistyles") { %>
128
143
  const stylesheet = createStyleSheet({
129
- button: {
130
- alignItems: "center",
131
- backgroundColor: "#6366F1",
132
- borderRadius: 24,
133
- elevation: 5,
134
- flexDirection: "row",
135
- justifyContent: "center",
136
- padding: 16,
137
- shadowColor: "#000",
138
- shadowOffset: {
139
- height: 2,
140
- width: 0
141
- },
142
- shadowOpacity: 0.25,
143
- shadowRadius: 3.84
144
- },
145
- buttonText: {
146
- color: "#FFFFFF",
147
- fontSize: 16,
148
- fontWeight: "600",
149
- textAlign: "center",
150
- },
151
- container: {
152
- flex: 1,
153
- padding: 24,
154
- },
155
- main: {
156
- flex: 1,
157
- maxWidth: 960,
158
- marginHorizontal: "auto",
159
- justifyContent: "space-between",
160
- },
161
- title: {
162
- fontSize: 64,
163
- fontWeight: "bold",
164
- },
165
- subtitle: {
166
- color: "#38434D",
167
- fontSize: 36,
168
- }
169
- });
144
+ container: {
145
+ flex: 1,
146
+ padding: 24,
147
+ },
148
+ main: {
149
+ flex: 1,
150
+ maxWidth: 960,
151
+ marginHorizontal: 'auto',
152
+ justifyContent: 'space-between',
153
+ },
154
+ });
155
+
170
156
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
171
157
  const styles = StyleSheet.create({
172
158
  button: {