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
@@ -5,6 +5,12 @@
5
5
  import { Stack, useRouter } from "expo-router";
6
6
  import { Button, Text, YStack } from "tamagui";
7
7
  import { Container, Main, Subtitle, Title } from "../tamagui.config";
8
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
9
+ import { Box, Text } from 'theme';
10
+ import { TouchableOpacity } from 'react-native';
11
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
12
+ import { createStyleSheet, useStyles } from 'react-native-unistyles';
13
+ import { Text, TouchableOpacity, View } from "react-native";
8
14
  <% } else { %>
9
15
  import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
10
16
  <% } %>
@@ -14,7 +20,19 @@ import { Stack, useLocalSearchParams, useRouter } from "expo-router";
14
20
  export default function Details() {
15
21
  const { name } = useLocalSearchParams();
16
22
  const router = useRouter();
17
- <% if (props.stylingPackage?.name === "nativewind") { %>
23
+
24
+ <% if (props.stylingPackage?.name === "unistyles") { %>
25
+ const { styles, theme } = useStyles(stylesheet);
26
+
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") { %>
18
36
  const BackButton = () => (
19
37
  <TouchableOpacity onPress={router.back}>
20
38
  <View className={styles.backButton}>
@@ -28,6 +46,17 @@ export default function Details() {
28
46
  const BackButton = () => (
29
47
  <Button unstyled flexDirection="row" backgroundColor="transparent" paddingLeft={0} pressStyle={{ opacity: 0.5 }} onPress={router.back} icon={<Feather name="chevron-left" size={16} color="#007AFF" />}><Text color="#007AFF">Back</Text></Button>
30
48
  )
49
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
50
+ const BackButton = () => (
51
+ <TouchableOpacity onPress={router.back}>
52
+ <Box flexDirection="row">
53
+ <Feather name="chevron-left" size={16} color="#007AFF" />
54
+ <Text color="blue" marginLeft="xs_4">
55
+ Back
56
+ </Text>
57
+ </Box>
58
+ </TouchableOpacity>
59
+ );
31
60
  <% } else { %>
32
61
  const BackButton = () => (
33
62
  <TouchableOpacity onPress={router.back}>
@@ -58,6 +87,26 @@ export default function Details() {
58
87
  </YStack>
59
88
  </Main>
60
89
  </Container>
90
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
91
+ <>
92
+ <Stack.Screen options={{ title: 'Details', headerLeft: () => <BackButton /> }} />
93
+ <Box flex={1} padding="ml_24">
94
+ <Box flex={1} maxWidth={960}>
95
+ <Text variant="extra_large">Details</Text>
96
+ <Text variant="large" color="darkGray">
97
+ Showing details for user {name}.
98
+ </Text>
99
+ </Box>
100
+ </Box>
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>
61
110
  <% } else { %>
62
111
  <View style={styles.container}>
63
112
  <Stack.Screen options={{ title: "Details", headerLeft: () => <BackButton /> }} />
@@ -79,6 +128,25 @@ export default function Details() {
79
128
  title: "text-[64px] font-bold",
80
129
  subtitle: "text-4xl text-gray-700",
81
130
  };
131
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
132
+ const stylesheet = createStyleSheet((theme) => ({
133
+ backButton: {
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
+ }));
82
150
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
83
151
  const styles = StyleSheet.create({
84
152
  backButton: {
@@ -3,6 +3,12 @@
3
3
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
4
4
  import { YStack } from "tamagui";
5
5
  import { Container, Main, Title, Subtitle, Button, ButtonText } from '../tamagui.config';
6
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
7
+ import { TouchableOpacity } from 'react-native';
8
+ import { Box, Text, makeStyles } from 'theme';
9
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
10
+ import { createStyleSheet, useStyles } from 'react-native-unistyles';
11
+ import { Text, TouchableOpacity, View } from 'react-native';
6
12
  <% } else { %>
7
13
  import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
8
14
  <% } %>
@@ -11,6 +17,14 @@ import { Stack } from "expo-router";
11
17
  import { Link } from "expo-router";
12
18
 
13
19
  export default function Page() {
20
+ <% if (props.stylingPackage?.name === "restyle") { %>
21
+ const styles = useStyles();
22
+ <% } %>
23
+
24
+ <% if (props.stylingPackage?.name === "unistyles") { %>
25
+ const { styles, theme } = useStyles(stylesheet);
26
+ <% } %>
27
+
14
28
  return (
15
29
  <% if (props.stylingPackage?.name === "nativewind") { %>
16
30
  <View className={styles.container}>
@@ -27,7 +41,7 @@ export default function Page() {
27
41
  </Link>
28
42
  </View>
29
43
  </View>
30
- <% } else if (props.stylingPackage?.name === "tamagui") { %>
44
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
31
45
  <Container>
32
46
  <Main>
33
47
  <Stack.Screen options={{ title: "Overview" }} />
@@ -40,7 +54,45 @@ export default function Page() {
40
54
  </Link>
41
55
  </Main>
42
56
  </Container>
43
- <% } else { %>
57
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
58
+ <>
59
+ <Stack.Screen options={{ title: "Overview" }} />
60
+ <Box flex={1} padding="ml_24">
61
+ <Box flex={1} maxWidth={960} justifyContent="space-between">
62
+ <Box>
63
+ <Text variant="extra_large">Hello World</Text>
64
+ <Text variant="large" color="darkGray">
65
+ This is the first page of your app.
66
+ </Text>
67
+ </Box>
68
+ <Link href={{ pathname: '/details', params: { name: 'Dan' } }} asChild>
69
+ <TouchableOpacity
70
+ style={styles.button}
71
+ >
72
+ <Text variant="body" textAlign="center" color="white" fontWeight="600">
73
+ Show Details
74
+ </Text>
75
+ </TouchableOpacity>
76
+ </Link>
77
+ </Box>
78
+ </Box>
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>
95
+ <% } else { %>
44
96
  <View style={styles.container}>
45
97
  <View style={styles.main}>
46
98
  <Stack.Screen options={{ title: "Overview" }} />
@@ -68,6 +120,39 @@ export default function Page() {
68
120
  title: "text-[64px] font-bold",
69
121
  subtitle: "text-4xl text-gray-700",
70
122
  };
123
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
124
+ const useStyles = makeStyles((theme) => ({
125
+ button: {
126
+ alignItems: 'center',
127
+ backgroundColor: theme.colors.purple,
128
+ borderRadius: theme.borderRadii.xl_24,
129
+ elevation: 5,
130
+ flexDirection: 'row',
131
+ justifyContent: 'center',
132
+ padding: theme.spacing.m_16,
133
+ shadowColor: theme.colors.black,
134
+ shadowOffset: {
135
+ height: 2,
136
+ width: 0,
137
+ },
138
+ shadowOpacity: 0.25,
139
+ shadowRadius: 3.84,
140
+ },
141
+ }));
142
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
143
+ const stylesheet = createStyleSheet({
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
+
71
156
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
72
157
  const styles = StyleSheet.create({
73
158
  button: {
@@ -1,33 +1,44 @@
1
1
  import FontAwesome from "@expo/vector-icons/FontAwesome";
2
2
  import { Link, Tabs } from "expo-router";
3
+ <% if (props.stylingPackage?.name === "unistyles") { %>
4
+ import { createStyleSheet, useStyles } from 'react-native-unistyles'
5
+ import { Pressable } from 'react-native';
6
+ <% } else { %>
3
7
  import { Pressable, StyleSheet } from "react-native";
8
+ <% } %>
4
9
 
5
10
  function TabBarIcon(props: {
6
11
  name: React.ComponentProps<typeof FontAwesome>["name"];
7
12
  color: string;
8
13
  }) {
14
+ <% if (props.stylingPackage?.name === "unistyles") { %>
15
+ const {styles} = useStyles(stylesheet)
16
+ <% } %>
9
17
  return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
10
18
  }
11
19
 
12
20
  export default function TabLayout() {
21
+ <% if (props.stylingPackage?.name === "unistyles") { %>
22
+ const { styles } = useStyles(stylesheet)
23
+ <% } %>
13
24
  return (
14
25
  <Tabs
15
26
  screenOptions={{
16
- tabBarActiveTintColor: "black",
27
+ tabBarActiveTintColor: 'black',
17
28
  }}>
18
29
  <Tabs.Screen
19
- name="index"
30
+ name='index'
20
31
  options={{
21
- title: "Tab One",
22
- tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
32
+ title: 'Tab One',
33
+ tabBarIcon: ({ color }) => <TabBarIcon name='code' color={color} />,
23
34
  headerRight: () => (
24
- <Link href="/modal" asChild>
35
+ <Link href='/modal' asChild>
25
36
  <Pressable>
26
37
  {({ pressed }) => (
27
38
  <FontAwesome
28
- name="info-circle"
39
+ name='info-circle'
29
40
  size={25}
30
- color="gray"
41
+ color='gray'
31
42
  style={[styles.headerRight, { opacity: pressed ? 0.5 : 1 }]}
32
43
  />
33
44
  )}
@@ -47,6 +58,16 @@ export default function TabLayout() {
47
58
  );
48
59
  }
49
60
 
61
+ <% if (props.stylingPackage?.name === "unistyles") { %>
62
+ const stylesheet = createStyleSheet({
63
+ headerRight: {
64
+ marginRight: 15
65
+ },
66
+ tabBarIcon: {
67
+ marginBottom: -3
68
+ }
69
+ });
70
+ <% } else { %>
50
71
  const styles = StyleSheet.create({
51
72
  headerRight: {
52
73
  marginRight: 15
@@ -54,4 +75,5 @@ const styles = StyleSheet.create({
54
75
  tabBarIcon: {
55
76
  marginBottom: -3
56
77
  }
57
- });
78
+ });
79
+ <% } %>
@@ -2,6 +2,11 @@
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 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';
5
10
  <% } else { %>
6
11
  import { StyleSheet, Text, View } from "react-native";
7
12
  <% } %>
@@ -9,7 +14,17 @@
9
14
  import EditScreenInfo from "../../components/edit-screen-info";
10
15
 
11
16
  export default function TabOneScreen() {
12
- <% if (props.stylingPackage?.name === "nativewind") { %>
17
+ <% if (props.stylingPackage?.name === "unistyles") { %>
18
+ const { theme } = useStyles()
19
+
20
+ return (
21
+ <View style={theme.components.container}>
22
+ <Text style={theme.components.title}>Tab One</Text>
23
+ <View style={theme.components.separator} />
24
+ <EditScreenInfo path="app/(tabs)/index.tsx" />
25
+ </View>
26
+ );
27
+ <% } else if (props.stylingPackage?.name === "nativewind") { %>
13
28
  return (
14
29
  <View className={styles.container}>
15
30
  <Text className={styles.title}>Tab One</Text>
@@ -27,6 +42,14 @@ export default function TabOneScreen() {
27
42
  </YStack>
28
43
  </Theme>
29
44
  );
45
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
46
+ return (
47
+ <Box flex={1} alignItems="center" justifyContent="center">
48
+ <Text variant="title">Tab One</Text>
49
+ <Box height={1} marginVertical="l_32" width="80%" />
50
+ <EditScreenInfo path="app/(tabs)/index.tsx" />
51
+ </Box>
52
+ );
30
53
  <% } else { %>
31
54
  return (
32
55
  <View style={styles.container}>
@@ -52,6 +75,7 @@ export default function TabOneScreen() {
52
75
  justifyContent: "center",
53
76
  },
54
77
  separator: {
78
+ backgroundColor: '#d1d5db',
55
79
  height: 1,
56
80
  marginVertical: 30,
57
81
  width: "80%",
@@ -2,6 +2,11 @@
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 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';
5
10
  <% } else { %>
6
11
  import { StyleSheet, Text, View } from "react-native";
7
12
  <% } %>
@@ -9,7 +14,17 @@
9
14
  import EditScreenInfo from "../../components/edit-screen-info";
10
15
 
11
16
  export default function TabTwoScreen() {
12
- <% if (props.stylingPackage?.name === "nativewind") { %>
17
+ <% if (props.stylingPackage?.name === "unistyles") { %>
18
+ const { theme } = useStyles()
19
+
20
+ return (
21
+ <View style={theme.components.container}>
22
+ <Text style={theme.components.title}>Tab Two</Text>
23
+ <View style={theme.components.separator} />
24
+ <EditScreenInfo path='app/(tabs)/two.tsx' />
25
+ </View>
26
+ );
27
+ <% } else if (props.stylingPackage?.name === "nativewind") { %>
13
28
  return (
14
29
  <View className={styles.container}>
15
30
  <Text className={styles.title}>Tab Two</Text>
@@ -27,6 +42,14 @@ export default function TabTwoScreen() {
27
42
  </YStack>
28
43
  </Theme>
29
44
  );
45
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
46
+ return (
47
+ <Box flex={1} alignItems="center" justifyContent="center">
48
+ <Text variant="title">Tab Two</Text>
49
+ <Box height={1} marginVertical="l_32" width="80%" />
50
+ <EditScreenInfo path="app/(tabs)/two.tsx" />
51
+ </Box>
52
+ );
30
53
  <% } else { %>
31
54
  return (
32
55
  <View style={styles.container}>
@@ -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((theme) => ({
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: theme.colors.astral,
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 React, { useEffect } from "react";
3
7
  import { TamaguiProvider } from 'tamagui'
@@ -7,6 +11,10 @@
7
11
  import config from '../tamagui.config'
8
12
 
9
13
  SplashScreen.preventAutoHideAsync();
14
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
15
+ import { ThemeProvider } from '@shopify/restyle';
16
+ import { Stack } from 'expo-router';
17
+ import { theme } from 'theme';
10
18
  <% } else { %>
11
19
  import { Stack } from "expo-router";
12
20
  <% } %>
@@ -35,6 +43,8 @@ export default function RootLayout() {
35
43
  return (
36
44
  <% if (props.stylingPackage?.name === "tamagui") { %>
37
45
  <TamaguiProvider config={config}>
46
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
47
+ <ThemeProvider theme={theme}>
38
48
  <% } %>
39
49
  <Stack>
40
50
  <Stack.Screen name="(tabs)" options={{ headerShown: false }} />
@@ -42,6 +52,8 @@ export default function RootLayout() {
42
52
  </Stack>
43
53
  <% if (props.stylingPackage?.name === "tamagui") { %>
44
54
  </TamaguiProvider>
55
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
56
+ </ThemeProvider>
45
57
  <% } %>
46
58
  );
47
59
  }
@@ -3,6 +3,12 @@
3
3
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
4
4
  import { YStack, Paragraph, Separator, Theme } from "tamagui";
5
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';
6
12
  <% } else { %>
7
13
  import { Platform, StyleSheet, Text, View } from "react-native";
8
14
  <% } %>
@@ -11,7 +17,18 @@ import { StatusBar } from "expo-status-bar";
11
17
  import EditScreenInfo from "../components/edit-screen-info";
12
18
 
13
19
  export default function ModalScreen() {
14
- <% if (props.stylingPackage?.name === "nativewind") { %>
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") { %>
15
32
  return (
16
33
  <View className={styles.container}>
17
34
  <StatusBar style={Platform.OS === "ios" ? "light" : "auto"} />
@@ -31,6 +48,15 @@ export default function ModalScreen() {
31
48
  </YStack>
32
49
  </Theme>
33
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
+ );
34
60
  <% } else { %>
35
61
  return (
36
62
  <View style={styles.container}>
@@ -1,13 +1,20 @@
1
- import React from "react";
2
1
  <% if (props.stylingPackage?.name === "nativewind") { %>
3
2
  import { Text, View } from "react-native";
4
3
  <% } else if (props.stylingPackage?.name === "tamagui") { %>
5
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';
6
10
  <% } else { %>
7
11
  import { StyleSheet, Text, View } from "react-native";
8
12
  <% } %>
9
13
 
10
14
  export default function EditScreenInfo({ path }: { path: string }) {
15
+ <% if (props.stylingPackage?.name === "unistyles") { %>
16
+ const { styles } = useStyles(stylesheet);
17
+ <% } %>
11
18
  <% if (props.stylingPackage?.name === "nativewind") { %>
12
19
  return (
13
20
  <View>
@@ -40,6 +47,20 @@ export default function EditScreenInfo({ path }: { path: string }) {
40
47
  </YStack>
41
48
  </YStack>
42
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
+ );
43
64
  <% } else { %>
44
65
  return (
45
66
  <View>
@@ -69,6 +90,36 @@ export default function EditScreenInfo({ path }: { path: string }) {
69
90
  helpLinkText: `text-center`,
70
91
  homeScreenFilename: `my-2`,
71
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
+ });
72
123
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
73
124
  const styles = StyleSheet.create({
74
125
  codeHighlightContainer: {
@@ -1,3 +1,6 @@
1
+ <% if (props.stylingPackage?.name === "unistyles") { %>
2
+ import './unistyles';
3
+ <% } %>
1
4
  import "react-native-gesture-handler";
2
5
  <% if (props.stylingPackage?.name === "tamagui") { %>
3
6
  import React, { useEffect } from "react";
@@ -8,7 +11,11 @@ import "react-native-gesture-handler";
8
11
  import config from './tamagui.config'
9
12
 
10
13
  SplashScreen.preventAutoHideAsync();
14
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
15
+ import { ThemeProvider } from '@shopify/restyle';
16
+ import { theme } from 'theme';
11
17
  <% } %>
18
+
12
19
  import RootStack from "./src/navigation";
13
20
 
14
21
  export default function App() {
@@ -33,7 +40,13 @@ export default function App() {
33
40
  <RootStack />
34
41
  </TamaguiProvider>
35
42
  );
36
- <% } else { %>
43
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
44
+ return (
45
+ <ThemeProvider theme={theme}>
46
+ <RootStack />
47
+ </ThemeProvider>
48
+ );
49
+ <% } else { %>
37
50
  return <RootStack />;
38
51
  <% } %>
39
52
  }