create-expo-stack 2.3.15 → 2.4.0-next.2c00bdf

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 (53) hide show
  1. package/README.md +8 -1
  2. package/build/commands/create-expo-stack.js +52 -17
  3. package/build/templates/base/App.tsx.ejs +34 -0
  4. package/build/templates/base/babel.config.js.ejs +1 -1
  5. package/build/templates/base/package.json.ejs +11 -1
  6. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +41 -0
  7. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/index.tsx.ejs +88 -0
  8. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/two.tsx.ejs +88 -0
  9. package/build/templates/packages/expo-router/drawer/app/(drawer)/_layout.tsx.ejs +43 -19
  10. package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +24 -2
  11. package/build/templates/packages/expo-router/drawer/app/[...unmatched].tsx.ejs +51 -0
  12. package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +43 -29
  13. package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +96 -0
  14. package/build/templates/packages/expo-router/drawer/components/edit-screen-info.tsx.ejs +153 -0
  15. package/build/templates/packages/expo-router/stack/app/[...unmatched].tsx.ejs +53 -0
  16. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +13 -3
  17. package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +69 -1
  18. package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +87 -2
  19. package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +30 -8
  20. package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +25 -1
  21. package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +24 -1
  22. package/build/templates/packages/expo-router/tabs/app/[...unmatched].tsx.ejs +53 -0
  23. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +12 -0
  24. package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +27 -1
  25. package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +52 -1
  26. package/build/templates/packages/react-navigation/App.tsx.ejs +14 -1
  27. package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +82 -1
  28. package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +41 -6
  29. package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +49 -4
  30. package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +53 -19
  31. package/build/templates/packages/react-navigation/screens/details.tsx.ejs +38 -0
  32. package/build/templates/packages/react-navigation/screens/home.tsx.ejs +83 -0
  33. package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +38 -1
  34. package/build/templates/packages/react-navigation/screens/one.tsx.ejs +34 -0
  35. package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +75 -1
  36. package/build/templates/packages/react-navigation/screens/two.tsx.ejs +34 -0
  37. package/build/templates/packages/restyle/theme/Box.tsx.ejs +6 -0
  38. package/build/templates/packages/restyle/theme/Text.tsx.ejs +6 -0
  39. package/build/templates/packages/restyle/theme/index.ts.ejs +6 -0
  40. package/build/templates/packages/restyle/theme/theme.ts.ejs +67 -0
  41. package/build/templates/packages/unistyles/breakpoints.ts.ejs +9 -0
  42. package/build/templates/packages/unistyles/theme.ts.ejs +76 -0
  43. package/build/templates/packages/unistyles/unistyles.ts.ejs +27 -0
  44. package/build/types/types.d.ts +2 -2
  45. package/build/types/utilities/printOutput.d.ts +2 -2
  46. package/build/types.js +4 -2
  47. package/build/utilities/configureProjectFiles.js +33 -6
  48. package/build/utilities/generateProjectFiles.js +8 -2
  49. package/build/utilities/printOutput.js +14 -2
  50. package/build/utilities/runCLI.js +11 -3
  51. package/build/utilities/showHelp.js +4 -1
  52. package/package.json +66 -66
  53. package/build/templates/packages/expo-router/drawer/app/(drawer)/news.tsx.ejs +0 -62
@@ -2,12 +2,26 @@
2
2
  import { Text, View } from "react-native";
3
3
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
4
4
  import { YStack, H2, Separator, Theme } from "tamagui";
5
- <% } else { %>
5
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
6
+ import { Box, Text } from 'theme';
7
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
8
+ import { useStyles } from 'react-native-unistyles'
9
+ import { Text, View } from 'react-native';
10
+ <% } else if (props.stylingPackage?.name === "stylesheet") { %>
6
11
  import { StyleSheet, Text, View } from "react-native";
7
12
  <% } %>
8
13
 
9
14
  const Page = () => {
10
- <% if (props.stylingPackage?.name === "nativewind") { %>
15
+ <% if (props.stylingPackage?.name === "unistyles") { %>
16
+ const { theme } = useStyles()
17
+
18
+ return (
19
+ <View style={theme.components.container}>
20
+ <Text style={theme.components.title}>Home</Text>
21
+ <View style={theme.components.separator} />
22
+ </View>
23
+ );
24
+ <% } else if (props.stylingPackage?.name === "nativewind") { %>
11
25
  return (
12
26
  <View className={styles.container}>
13
27
  <Text className={styles.title}>Home</Text>
@@ -24,6 +38,13 @@ const Page = () => {
24
38
  </YStack>
25
39
  </Theme>
26
40
  );
41
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
42
+ return (
43
+ <Box flex={1} alignItems="center" justifyContent="center">
44
+ <Text variant="title">Home</Text>
45
+ <Box height={1} marginVertical="l_32" width="80%" />
46
+ </Box>
47
+ );
27
48
  <% } else { %>
28
49
  return (
29
50
  <View style={styles.container}>
@@ -50,6 +71,7 @@ export default Page;
50
71
  justifyContent: "center",
51
72
  },
52
73
  separator: {
74
+ backgroundColor: '#d1d5db',
53
75
  height: 1,
54
76
  marginVertical: 30,
55
77
  width: "80%",
@@ -1,14 +1,25 @@
1
1
  import { Link, Stack } from 'expo-router';
2
2
  <% if (props.stylingPackage?.name === "nativewind") {%>
3
3
  import { Text, View } from 'react-native';
4
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
5
+ import { createStyleSheet, useStyles } from 'react-native-unistyles'
6
+ import { Text, View } from 'react-native';
4
7
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
5
8
  import { StyleSheet, Text, View } from 'react-native';
6
9
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
7
10
  import { YStack } from "tamagui";
8
11
  import { Container, Main, Subtitle, Title } from "../tamagui.config";
12
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
13
+ import { Box, Text, makeStyles } from 'theme';
9
14
  <% } %>
10
15
 
11
16
  export default function NotFoundScreen() {
17
+ <% if (props.stylingPackage?.name === "restyle") { %>
18
+ const styles = useStyles();
19
+ <% } else if (props.stylingPackage?.name === "unistyles") {%>
20
+ const { styles } = useStyles(stylesheet);
21
+ <% } %>
22
+
12
23
  return (
13
24
  <% if (props.stylingPackage?.name === "nativewind") {%>
14
25
  <>
@@ -32,6 +43,18 @@ export default function NotFoundScreen() {
32
43
  </YStack>
33
44
  </Main>
34
45
  </Container>
46
+ <% } else if (props.stylingPackage?.name === "restyle") {%>
47
+ <>
48
+ <Stack.Screen options={{ title: 'Oops!' }} />
49
+ <Box flex={1} justifyContent="center" alignItems="center" padding="ml_24">
50
+ <Text variant="title">This screen doesn't exist.</Text>
51
+ <Link href="/" style={styles.link}>
52
+ <Text variant="body" color="blue">
53
+ Go to home screen!
54
+ </Text>
55
+ </Link>
56
+ </Box>
57
+ </>
35
58
  <% } else { %>
36
59
  <>
37
60
  <Stack.Screen options={{ title: "Oops!" }} />
@@ -53,6 +76,27 @@ export default function NotFoundScreen() {
53
76
  link: `mt-4 pt-4`,
54
77
  linkText: `text-base text-[#2e78b7]`,
55
78
  };
79
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
80
+ const stylesheet = createStyleSheet((theme) => ({
81
+ container: {
82
+ flex: 1,
83
+ alignItems: 'center',
84
+ justifyContent: 'center',
85
+ padding: 20,
86
+ },
87
+ title: {
88
+ fontSize: 20,
89
+ fontWeight: 'bold',
90
+ },
91
+ link: {
92
+ marginTop: 16,
93
+ paddingVertical: 16,
94
+ },
95
+ linkText: {
96
+ fontSize: 14,
97
+ color: theme.colors.astral,
98
+ },
99
+ }));
56
100
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
57
101
  const styles = StyleSheet.create({
58
102
  container: {
@@ -74,4 +118,11 @@ export default function NotFoundScreen() {
74
118
  color: '#2e78b7',
75
119
  },
76
120
  });
121
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
122
+ const useStyles = makeStyles((theme) => ({
123
+ link: {
124
+ marginTop: theme.spacing.m_16,
125
+ paddingVertical: theme.spacing.m_16,
126
+ },
127
+ }));
77
128
  <% } %>
@@ -1,47 +1,61 @@
1
+ <% if (props.stylingPackage?.name === "unistyles") { %>
2
+ import '../unistyles';
3
+ <% } %>
4
+
1
5
  import 'react-native-gesture-handler';
2
6
  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";
7
+ import { Stack } from 'expo-router';
9
8
 
10
- import config from '../tamagui.config'
9
+ <% if (props.stylingPackage?.name==="tamagui" ) { %>
10
+ import React, { useEffect } from "react";
11
+ import { TamaguiProvider } from 'tamagui'
12
+ import { SplashScreen } from "expo-router";
13
+ import { useFonts } from "expo-font";
11
14
 
12
15
  SplashScreen.preventAutoHideAsync();
13
- <% } %>
16
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
17
+ import { ThemeProvider } from '@shopify/restyle';
18
+
19
+ import { theme } from '../theme';
20
+ <% } %>
14
21
 
15
22
  export const unstable_settings = {
16
- // Ensure that reloading on `/modal` keeps a back button present.
17
- initialRouteName: "(drawer)",
23
+ // Ensure that reloading on `/modal` keeps a back button present.
24
+ initialRouteName: "(drawer)",
18
25
  };
19
26
 
20
27
  export default function RootLayout() {
21
- <% if (props.stylingPackage?.name === "tamagui") { %>
22
- const [loaded] = useFonts({
23
- Inter: require("@tamagui/font-inter/otf/Inter-Medium.otf"),
24
- InterBold: require("@tamagui/font-inter/otf/Inter-Bold.otf")
25
- });
28
+ <% if (props.stylingPackage?.name==="tamagui" ) { %>
29
+ const [loaded] = useFonts({
30
+ Inter: require("@tamagui/font-inter/otf/Inter-Medium.otf"),
31
+ InterBold: require("@tamagui/font-inter/otf/Inter-Bold.otf")
32
+ });
26
33
 
27
- useEffect(() => {
28
- if (loaded) {
29
- SplashScreen.hideAsync();
30
- }
31
- }, [loaded]);
34
+ useEffect(() => {
35
+ if (loaded) {
36
+ SplashScreen.hideAsync();
37
+ }
38
+ }, [loaded]);
32
39
 
33
- if (!loaded) return null;
34
- <% } %>
40
+ if (!loaded) return null;
41
+ <% } %>
35
42
 
36
43
  return (
37
44
  <% if (props.stylingPackage?.name === "tamagui") { %>
38
45
  <TamaguiProvider config={config}>
46
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
47
+ <ThemeProvider theme={theme}>
39
48
  <% } %>
40
- <GestureHandlerRootView style={{ flex: 1 }}>
41
- <Slot />
42
- </GestureHandlerRootView>
43
- <% if (props.stylingPackage?.name === "tamagui") { %>
44
- </TamaguiProvider>
45
- <% } %>
46
- );
49
+ <GestureHandlerRootView style={{ flex: 1 }}>
50
+ <Stack>
51
+ <Stack.Screen name="(drawer)" options={{ headerShown: false }} />
52
+ <Stack.Screen name="modal" options={{ title: 'Modal', presentation: 'modal' }} />
53
+ </Stack>
54
+ </GestureHandlerRootView>
55
+ <% if (props.stylingPackage?.name === "tamagui") { %>
56
+ </TamaguiProvider>
57
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
58
+ </ThemeProvider>
59
+ <% } %>
60
+ );
47
61
  }
@@ -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
+ <% } %>
@@ -1,14 +1,27 @@
1
1
  import { Link, Stack } from 'expo-router';
2
2
  <% if (props.stylingPackage?.name === "nativewind") {%>
3
3
  import { Text, View } from 'react-native';
4
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
5
+ import { createStyleSheet, useStyles } from 'react-native-unistyles'
6
+ import { Text, View } from 'react-native';
4
7
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
5
8
  import { StyleSheet, Text, View } from 'react-native';
6
9
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
7
10
  import { YStack } from "tamagui";
8
11
  import { Container, Main, Subtitle, Title } from "../tamagui.config";
12
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
13
+ import { Box, Text, makeStyles } from 'theme';
9
14
  <% } %>
10
15
 
11
16
  export default function NotFoundScreen() {
17
+ <% if (props.stylingPackage?.name === "restyle") { %>
18
+ const styles = useStyles();
19
+ <% } %>
20
+
21
+ <% if (props.stylingPackage?.name === "unistyles") {%>
22
+ const { styles } = useStyles(stylesheet)
23
+ <% } %>
24
+
12
25
  return (
13
26
  <% if (props.stylingPackage?.name === "nativewind") {%>
14
27
  <>
@@ -32,6 +45,18 @@ export default function NotFoundScreen() {
32
45
  </YStack>
33
46
  </Main>
34
47
  </Container>
48
+ <% } else if (props.stylingPackage?.name === "restyle") {%>
49
+ <>
50
+ <Stack.Screen options={{ title: 'Oops!' }} />
51
+ <Box flex={1} justifyContent="center" alignItems="center" padding="ml_24">
52
+ <Text variant="title">This screen doesn't exist.</Text>
53
+ <Link href="/" style={styles.link}>
54
+ <Text variant="body" color="blue">
55
+ Go to home screen!
56
+ </Text>
57
+ </Link>
58
+ </Box>
59
+ </>
35
60
  <% } else { %>
36
61
  <>
37
62
  <Stack.Screen options={{ title: "Oops!" }} />
@@ -53,6 +78,27 @@ export default function NotFoundScreen() {
53
78
  link: `mt-4 pt-4`,
54
79
  linkText: `text-base text-[#2e78b7]`,
55
80
  };
81
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
82
+ const stylesheet = createStyleSheet({
83
+ container: {
84
+ flex: 1,
85
+ alignItems: 'center',
86
+ justifyContent: 'center',
87
+ padding: 20,
88
+ },
89
+ title: {
90
+ fontSize: 20,
91
+ fontWeight: 'bold',
92
+ },
93
+ link: {
94
+ marginTop: 16,
95
+ paddingVertical: 16,
96
+ },
97
+ linkText: {
98
+ fontSize: 14,
99
+ color: '#2e78b7',
100
+ },
101
+ });
56
102
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
57
103
  const styles = StyleSheet.create({
58
104
  container: {
@@ -74,4 +120,11 @@ export default function NotFoundScreen() {
74
120
  color: '#2e78b7',
75
121
  },
76
122
  });
123
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
124
+ const useStyles = makeStyles((theme) => ({
125
+ link: {
126
+ marginTop: theme.spacing.m_16,
127
+ paddingVertical: theme.spacing.m_16,
128
+ },
129
+ }));
77
130
  <% } %>
@@ -1,3 +1,7 @@
1
+ <% if (props.stylingPackage?.name === "unistyles") { %>
2
+ import '../unistyles';
3
+ <% } %>
4
+
1
5
  <% if (props.stylingPackage?.name === "tamagui") { %>
2
6
  import { useFonts } from 'expo-font';
3
7
  import { SplashScreen, Stack } from 'expo-router';
@@ -5,9 +9,11 @@
5
9
  import { TamaguiProvider } from 'tamagui';
6
10
 
7
11
  import config from '../tamagui.config';
8
- <% } else { %>
9
- import { Stack } from "expo-router";
12
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
13
+ import { ThemeProvider } from '@shopify/restyle';
14
+ import { theme } from 'theme';
10
15
  <% } %>
16
+ import { Stack } from "expo-router";
11
17
 
12
18
  export default function Layout() {
13
19
 
@@ -29,10 +35,14 @@ export default function Layout() {
29
35
  return (
30
36
  <% if (props.stylingPackage?.name === "tamagui") { %>
31
37
  <TamaguiProvider config={config}>
38
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
39
+ <ThemeProvider theme={theme}>
32
40
  <% } %>
33
- <Stack />
41
+ <Stack />
34
42
  <% if (props.stylingPackage?.name === "tamagui") { %>
35
43
  </TamaguiProvider>
44
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
45
+ </ThemeProvider >
36
46
  <% } %>
37
47
  );
38
48
  }