create-expo-stack 2.4.0-next.1fb5698 → 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 (49) hide show
  1. package/README.md +1 -0
  2. package/build/commands/create-expo-stack.js +39 -17
  3. package/build/templates/base/App.tsx.ejs +22 -0
  4. package/build/templates/base/babel.config.js.ejs +1 -1
  5. package/build/templates/base/package.json.ejs +6 -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 +14 -1
  11. package/build/templates/packages/expo-router/drawer/app/[...unmatched].tsx.ejs +26 -0
  12. package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +36 -30
  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 +28 -0
  16. package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +4 -0
  17. package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +43 -1
  18. package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +36 -0
  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 +16 -2
  21. package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +15 -2
  22. package/build/templates/packages/expo-router/tabs/app/[...unmatched].tsx.ejs +28 -0
  23. package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +4 -0
  24. package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +15 -1
  25. package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +36 -0
  26. package/build/templates/packages/react-navigation/App.tsx.ejs +3 -0
  27. package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +59 -0
  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 +31 -2
  30. package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +47 -17
  31. package/build/templates/packages/react-navigation/screens/details.tsx.ejs +25 -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 +13 -0
  34. package/build/templates/packages/react-navigation/screens/one.tsx.ejs +12 -0
  35. package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +33 -2
  36. package/build/templates/packages/react-navigation/screens/two.tsx.ejs +12 -0
  37. package/build/templates/packages/unistyles/breakpoints.ts.ejs +9 -0
  38. package/build/templates/packages/unistyles/theme.ts.ejs +76 -0
  39. package/build/templates/packages/unistyles/unistyles.ts.ejs +27 -0
  40. package/build/types/types.d.ts +2 -2
  41. package/build/types/utilities/printOutput.d.ts +2 -2
  42. package/build/types.js +3 -2
  43. package/build/utilities/configureProjectFiles.js +22 -6
  44. package/build/utilities/generateProjectFiles.js +5 -2
  45. package/build/utilities/printOutput.js +14 -2
  46. package/build/utilities/runCLI.js +7 -3
  47. package/build/utilities/showHelp.js +3 -1
  48. package/package.json +2 -2
  49. package/build/templates/packages/expo-router/drawer/app/(drawer)/news.tsx.ejs +0 -71
@@ -4,6 +4,9 @@
4
4
  import { YStack, H2, Separator, Theme } from "tamagui";
5
5
  <% } else if (props.stylingPackage?.name === "restyle") { %>
6
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';
7
10
  <% } else { %>
8
11
  import { StyleSheet, Text, View } from "react-native";
9
12
  <% } %>
@@ -11,7 +14,17 @@
11
14
  import EditScreenInfo from "../../components/edit-screen-info";
12
15
 
13
16
  export default function TabTwoScreen() {
14
- <% 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") { %>
15
28
  return (
16
29
  <View className={styles.container}>
17
30
  <Text className={styles.title}>Tab Two</Text>
@@ -36,7 +49,7 @@ export default function TabTwoScreen() {
36
49
  <Box height={1} marginVertical="l_32" width="80%" />
37
50
  <EditScreenInfo path="app/(tabs)/two.tsx" />
38
51
  </Box>
39
- );
52
+ );
40
53
  <% } else { %>
41
54
  return (
42
55
  <View style={styles.container}>
@@ -1,6 +1,9 @@
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") { %>
@@ -15,6 +18,10 @@ export default function NotFoundScreen() {
15
18
  const styles = useStyles();
16
19
  <% } %>
17
20
 
21
+ <% if (props.stylingPackage?.name === "unistyles") {%>
22
+ const { styles } = useStyles(stylesheet);
23
+ <% } %>
24
+
18
25
  return (
19
26
  <% if (props.stylingPackage?.name === "nativewind") {%>
20
27
  <>
@@ -71,6 +78,27 @@ export default function NotFoundScreen() {
71
78
  link: `mt-4 pt-4`,
72
79
  linkText: `text-base text-[#2e78b7]`,
73
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
+ }));
74
102
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
75
103
  const styles = StyleSheet.create({
76
104
  container: {
@@ -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'
@@ -6,6 +6,9 @@
6
6
  <% } else if (props.stylingPackage?.name === "restyle") { %>
7
7
  import { Platform } from 'react-native';
8
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';
9
12
  <% } else { %>
10
13
  import { Platform, StyleSheet, Text, View } from "react-native";
11
14
  <% } %>
@@ -14,7 +17,18 @@ import { StatusBar } from "expo-status-bar";
14
17
  import EditScreenInfo from "../components/edit-screen-info";
15
18
 
16
19
  export default function ModalScreen() {
17
- <% 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") { %>
18
32
  return (
19
33
  <View className={styles.container}>
20
34
  <StatusBar style={Platform.OS === "ios" ? "light" : "auto"} />
@@ -4,11 +4,17 @@
4
4
  import { YStack, H4, Paragraph } from "tamagui"
5
5
  <% } else if (props.stylingPackage?.name === "restyle") { %>
6
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';
7
10
  <% } else { %>
8
11
  import { StyleSheet, Text, View } from "react-native";
9
12
  <% } %>
10
13
 
11
14
  export default function EditScreenInfo({ path }: { path: string }) {
15
+ <% if (props.stylingPackage?.name === "unistyles") { %>
16
+ const { styles } = useStyles(stylesheet);
17
+ <% } %>
12
18
  <% if (props.stylingPackage?.name === "nativewind") { %>
13
19
  return (
14
20
  <View>
@@ -84,6 +90,36 @@ export default function EditScreenInfo({ path }: { path: string }) {
84
90
  helpLinkText: `text-center`,
85
91
  homeScreenFilename: `my-2`,
86
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
+ });
87
123
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
88
124
  const styles = StyleSheet.create({
89
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";
@@ -3,6 +3,9 @@ import React from "react";
3
3
  import { Text, View } from "react-native";
4
4
  <% } else if (props.stylingPackage?.name === "restyle") { %>
5
5
  import { Box, Text } from 'theme';
6
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
7
+ import { createStyleSheet, useStyles } from 'react-native-unistyles'
8
+ import { Text, View } from 'react-native';
6
9
  <% } else { %>
7
10
  import { StyleSheet, Text, View } from "react-native";
8
11
  <% } %>
@@ -52,6 +55,32 @@ import React from "react";
52
55
  </Box>
53
56
  );
54
57
  }
58
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
59
+ export default function EditScreenInfo({ path }: { path: string }) {
60
+ const { styles } = useStyles(stylesheet)
61
+ return (
62
+ <View>
63
+ <View style={styles.getStartedContainer}>
64
+ <Text
65
+ style={styles.getStartedText}>
66
+ Open up the code for this screen:
67
+ </Text>
68
+
69
+ <View
70
+ style={[styles.codeHighlightContainer, styles.homeScreenFilename]}
71
+ >
72
+ <Text>{path}</Text>
73
+ </View>
74
+
75
+ <Text
76
+ style={styles.getStartedText}
77
+ >
78
+ Change any of the text, save the file, and your app will automatically update.
79
+ </Text>
80
+ </View>
81
+ </View>
82
+ );
83
+ }
55
84
  <% } else { %>
56
85
  export default function EditScreenInfo({ path }: { path: string }) {
57
86
  return (
@@ -88,6 +117,36 @@ import React from "react";
88
117
  helpLink: "py-4",
89
118
  helpLinkText: "text-center"
90
119
  };
120
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
121
+ const stylesheet = createStyleSheet({
122
+ codeHighlightContainer: {
123
+ borderRadius: 3,
124
+ paddingHorizontal: 4
125
+ },
126
+ getStartedContainer: {
127
+ alignItems: 'center',
128
+ marginHorizontal: 50
129
+ },
130
+ getStartedText: {
131
+ fontSize: 17,
132
+ lineHeight: 24,
133
+ textAlign: 'center'
134
+ },
135
+ helpContainer: {
136
+ alignItems: 'center',
137
+ marginHorizontal: 20,
138
+ marginTop: 15
139
+ },
140
+ helpLink: {
141
+ paddingVertical: 15
142
+ },
143
+ helpLinkText: {
144
+ textAlign: 'center'
145
+ },
146
+ homeScreenFilename: {
147
+ marginVertical: 7
148
+ }
149
+ });
91
150
  <% } else if (props.stylingPackage?.name !== "restyle") { %>
92
151
  const styles = StyleSheet.create({
93
152
  codeHighlightContainer: {
@@ -1,15 +1,50 @@
1
+ import { FontAwesome, Ionicons, MaterialIcons } from '@expo/vector-icons';
1
2
  import { createDrawerNavigator } from '@react-navigation/drawer';
3
+ import { Pressable } from 'react-native';
4
+ import { StackScreenProps } from '@react-navigation/stack';
2
5
 
3
- import One from '../screens/one';
4
- import Two from '../screens/two';
6
+ import TabNavigator from './tab-navigator';
7
+ import Home from '../screens/home';
8
+ import { RootStackParamList } from '.';
9
+
10
+ type Props = StackScreenProps<RootStackParamList, 'DrawerNavigator'>;
5
11
 
6
12
  const Drawer = createDrawerNavigator();
7
13
 
8
- export default function DrawerNavigator() {
14
+ export default function DrawerNavigator({ navigation }: Props) {
9
15
  return (
10
- <Drawer.Navigator initialRouteName="One">
11
- <Drawer.Screen name="One" component={One} />
12
- <Drawer.Screen name="Two" component={Two} />
16
+ <Drawer.Navigator>
17
+ <Drawer.Screen
18
+ name="Home"
19
+ component={Home}
20
+ options={{
21
+ drawerIcon: ({ size, color }) => <Ionicons name="home-outline" size={size} color={color} />,
22
+ }}
23
+ />
24
+ <Drawer.Screen name="Tabs" component={TabNavigator}
25
+ options={{
26
+ headerRight: () => (
27
+ <Pressable onPress={() => navigation.navigate('Modal')}>
28
+ {({ pressed }) => (
29
+ <FontAwesome
30
+ name="info-circle"
31
+ size={25}
32
+ color="gray"
33
+ style={[
34
+ {
35
+ marginRight: 16,
36
+ opacity: pressed ? 0.5 : 1,
37
+ },
38
+ ]}
39
+ />
40
+ )}
41
+ </Pressable>
42
+ ),
43
+ drawerIcon: ({ size, color }) => (
44
+ <MaterialIcons name="border-bottom" size={size} color={color} />
45
+ ),
46
+ }}
47
+ />
13
48
  </Drawer.Navigator>
14
49
  );
15
50
  }
@@ -8,6 +8,9 @@
8
8
  import { Button, Text } from "tamagui";
9
9
  <% } else if (props.stylingPackage?.name === "restyle") { %>
10
10
  import { Box, Text, useTheme } from 'theme';
11
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
12
+ import { createStyleSheet, useStyles } from 'react-native-unistyles'
13
+ import { Text, View } from 'react-native';
11
14
  <% } else { %>
12
15
  import { Text, View, StyleSheet } from "react-native";
13
16
  <% } %>
@@ -26,6 +29,11 @@
26
29
  <% if (props.stylingPackage?.name === "restyle") { %>
27
30
  const { colors } = useTheme();
28
31
  <% } %>
32
+
33
+ <% if (props.stylingPackage?.name === "unistyles") { %>
34
+ const { styles, theme } = useStyles(stylesheet);
35
+ <% } %>
36
+
29
37
  return (
30
38
  <NavigationContainer>
31
39
  <Stack.Navigator initialRouteName="Overview">
@@ -69,6 +77,15 @@
69
77
  </Box>
70
78
  ),
71
79
  })}
80
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
81
+ options={({ navigation }) => ({
82
+ headerLeft: () => (
83
+ <View style={styles.backButton}>
84
+ <Feather name="chevron-left" size={16} color={theme.colors.azureRadiance} />
85
+ <Text style={styles.backButtonText} onPress={navigation.goBack}>Back</Text>
86
+ </View>
87
+ )
88
+ })}
72
89
  <% } else { %>
73
90
  options={({ navigation }) => ({
74
91
  headerLeft: () => (
@@ -90,6 +107,17 @@
90
107
  backButton: "flex-row",
91
108
  backButtonText: "text-blue-500 ml-1"
92
109
  };
110
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
111
+ const stylesheet = createStyleSheet((theme) => ({
112
+ backButton: {
113
+ flexDirection: 'row',
114
+ paddingLeft: 20,
115
+ },
116
+ backButtonText: {
117
+ color: theme.colors.azureRadiance,
118
+ marginLeft: 4,
119
+ },
120
+ }));
93
121
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
94
122
  const styles = StyleSheet.create({
95
123
  backButton: {
@@ -134,7 +162,7 @@
134
162
  </NavigationContainer>
135
163
  );
136
164
  }
137
- <% } else if (props.navigationPackage?.options.type === 'drawer') { %>
165
+ <% } else if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
138
166
  import { NavigationContainer } from "@react-navigation/native";
139
167
  import { createStackNavigator } from '@react-navigation/stack';
140
168
 
@@ -144,6 +172,7 @@
144
172
  export type RootStackParamList = {
145
173
  DrawerNavigator: undefined;
146
174
  Modal: undefined;
175
+ TabNavigator: undefined;
147
176
  };
148
177
 
149
178
  const Stack = createStackNavigator<RootStackParamList>();
@@ -160,7 +189,7 @@
160
189
  <Stack.Screen
161
190
  name="Modal"
162
191
  component={Modal}
163
- options={{ presentation: "modal" }}
192
+ options={{ presentation: "modal", headerLeft: () => null }}
164
193
  />
165
194
  </Stack.Navigator>
166
195
  </NavigationContainer>
@@ -1,61 +1,90 @@
1
- import FontAwesome from "@expo/vector-icons/FontAwesome";
1
+ import FontAwesome from '@expo/vector-icons/FontAwesome';
2
2
  import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
3
3
  import { StackScreenProps } from '@react-navigation/stack';
4
- import { Pressable, StyleSheet } from "react-native";
4
+ <% if (props.stylingPackage?.name === 'unistyles') { %>
5
+ import { createStyleSheet, useStyles } from 'react-native-unistyles'
6
+ import { Pressable } from 'react-native';
7
+ <% } else if (props.navigationPackage?.options.type === 'drawer + tabs' ) { %>
8
+ import { StyleSheet } from 'react-native';
9
+ <% } else { %>
10
+ import { Pressable, StyleSheet } from 'react-native';
11
+ <% } %>
5
12
 
6
13
  import { RootStackParamList } from '.';
7
- import One from "../screens/one";
8
- import Two from "../screens/two";
14
+ import One from '../screens/one';
15
+ import Two from '../screens/two';
9
16
 
10
17
  const Tab = createBottomTabNavigator();
11
18
 
12
19
  function TabBarIcon(props: {
13
- name: React.ComponentProps<typeof FontAwesome>["name"];
20
+ name: React.ComponentProps<typeof FontAwesome>['name'];
14
21
  color: string;
15
22
  }) {
23
+ <% if (props.stylingPackage?.name === 'unistyles') {%>
24
+ const { styles } = useStyles(stylesheet)
25
+ <% } %>
16
26
  return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
17
27
  }
18
28
 
19
29
  type Props = StackScreenProps<RootStackParamList, 'TabNavigator'>;
20
30
 
21
31
  export default function TabLayout({ navigation }: Props) {
32
+ <% if (props.stylingPackage?.name === 'unistyles') {%>
33
+ const { styles } = useStyles(stylesheet)
34
+ <% } %>
35
+
22
36
  return (
23
37
  <Tab.Navigator
24
38
  screenOptions={{
25
- tabBarActiveTintColor: "black",
39
+ tabBarActiveTintColor: 'black',
40
+ <% if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
41
+ headerShown: false,
42
+ <% } %>
26
43
  }}>
27
44
  <Tab.Screen
28
- name="One"
45
+ name='One'
29
46
  component={One}
30
47
  options={{
31
- title: "Tab One",
32
- tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
48
+ title: 'Tab One',
49
+ tabBarIcon: ({ color }) => <TabBarIcon name='code' color={color} />,
50
+ <% if (props.navigationPackage?.options.type === 'tabs') { %>
33
51
  headerRight: () => (
34
- <Pressable onPress={() => navigation.navigate("Modal")}>
52
+ <Pressable onPress={() => navigation.navigate('Modal')}>
35
53
  {({ pressed }) => (
36
54
  <FontAwesome
37
- name="info-circle"
55
+ name='info-circle'
38
56
  size={25}
39
- color="gray"
57
+ color='gray'
40
58
  style={[styles.headerRight, { opacity: pressed ? 0.5 : 1 }]}
41
59
  />
42
60
  )}
43
61
  </Pressable>
44
- ),
62
+ )
63
+ <% } %>
45
64
  }}
46
65
  />
47
66
  <Tab.Screen
48
- name="Two"
67
+ name='Two'
49
68
  component={Two}
50
69
  options={{
51
- title: "Tab Two",
52
- tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
70
+ title: 'Tab Two',
71
+ tabBarIcon: ({ color }) => <TabBarIcon name='code' color={color} />,
53
72
  }}
54
73
  />
55
74
  </Tab.Navigator>
56
75
  );
57
76
  }
58
77
 
78
+ <% if (props.stylingPackage?.name === 'unistyles') { %>
79
+ const stylesheet = createStyleSheet({
80
+ headerRight: {
81
+ marginRight: 15
82
+ },
83
+ tabBarIcon: {
84
+ marginBottom: -3
85
+ }
86
+ });
87
+ <% } else { %>
59
88
  const styles = StyleSheet.create({
60
89
  headerRight: {
61
90
  marginRight: 15
@@ -63,4 +92,5 @@ const styles = StyleSheet.create({
63
92
  tabBarIcon: {
64
93
  marginBottom: -3
65
94
  }
66
- });
95
+ });
96
+ <% } %>
@@ -6,6 +6,9 @@ import { RouteProp, useRoute } from "@react-navigation/native";
6
6
  import { Container, Main, Subtitle, Title } from "../../tamagui.config";
7
7
  <% } else if (props.stylingPackage?.name === "restyle") { %>
8
8
  import { Box, Text } from 'theme';
9
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
10
+ import { createStyleSheet, useStyles } from 'react-native-unistyles'
11
+ import { View, Text } from 'react-native';
9
12
  <% } else { %>
10
13
  import { View, StyleSheet, Text } from "react-native";
11
14
  <% } %>
@@ -45,6 +48,16 @@ export default function Details() {
45
48
  </Text>
46
49
  </Box>
47
50
  </Box>
51
+ );
52
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
53
+ const { styles, theme } = useStyles(stylesheet)
54
+ return (
55
+ <View style={styles.container}>
56
+ <View style={styles.main}>
57
+ <Text style={theme.components.title}>Details</Text>
58
+ <Text style={theme.components.subtitle}>Showing details for user {router.params.name}.</Text>
59
+ </View>
60
+ </View>
48
61
  );
49
62
  <% } else { %>
50
63
  return (
@@ -65,6 +78,18 @@ export default function Details() {
65
78
  title: "text-[64px] font-bold",
66
79
  subtitle: "text-4xl text-gray-700",
67
80
  };
81
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
82
+ const stylesheet = createStyleSheet({
83
+ container: {
84
+ flex: 1,
85
+ padding: 24,
86
+ },
87
+ main: {
88
+ flex: 1,
89
+ maxWidth: 960,
90
+ marginHorizontal: 'auto',
91
+ },
92
+ });
68
93
  <% } else if (props.stylingPackage?.name === "stylesheet") { %>
69
94
  const styles = StyleSheet.create({
70
95
  container: {
@@ -0,0 +1,83 @@
1
+ <% if (props.stylingPackage?.name === 'nativewind') { %>
2
+ import { Text, View } from 'react-native';
3
+ <% } else if (props.stylingPackage?.name === 'tamagui') { %>
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';
10
+ <% } else if (props.stylingPackage?.name === 'stylesheet') { %>
11
+ import { StyleSheet, Text, View } from 'react-native';
12
+ <% } %>
13
+
14
+ const Page = () => {
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}>News</Text>
21
+ <View style={theme.components.separator} />
22
+ </View>
23
+ );
24
+ <% } else if (props.stylingPackage?.name === 'nativewind') { %>
25
+ return (
26
+ <View className={styles.container}>
27
+ <Text className={styles.title}>Home</Text>
28
+ <View className={styles.separator} />
29
+ <EditScreenInfo path='app/(tabs)/index.tsx' />
30
+ </View>
31
+ );
32
+ <% } else if (props.stylingPackage?.name === 'tamagui') { %>
33
+ return (
34
+ <Theme name='light'>
35
+ <YStack flex={1} alignItems='center' justifyContent='center'>
36
+ <H2>Home</H2>
37
+ <Separator />
38
+ </YStack>
39
+ </Theme>
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
+ );
48
+ <% } else { %>
49
+ return (
50
+ <View style={styles.container}>
51
+ <Text style={styles.title}>Home</Text>
52
+ <View style={styles.separator} />
53
+ </View>
54
+ );
55
+ <% } %>
56
+ }
57
+
58
+ export default Page;
59
+
60
+ <% if (props.stylingPackage?.name === 'nativewind') { %>
61
+ const styles = {
62
+ container: `items-center flex-1 justify-center`,
63
+ separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
64
+ title: `text-xl font-bold`
65
+ };
66
+ <% } else if (props.stylingPackage?.name === 'stylesheet') { %>
67
+ const styles = StyleSheet.create({
68
+ container: {
69
+ alignItems: 'center',
70
+ flex: 1,
71
+ justifyContent: 'center',
72
+ },
73
+ separator: {
74
+ height: 1,
75
+ marginVertical: 30,
76
+ width: '80%',
77
+ },
78
+ title: {
79
+ fontSize: 20,
80
+ fontWeight: 'bold',
81
+ }
82
+ });
83
+ <% } %>
@@ -6,6 +6,9 @@
6
6
  <% } else if (props.stylingPackage?.name === "restyle") { %>
7
7
  import { Platform } from 'react-native';
8
8
  import { Box, Text, makeStyles } from 'theme';
9
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
10
+ import { useStyles } from 'react-native-unistyles'
11
+ import { Platform, Text, View } from 'react-native';
9
12
  <% } else { %>
10
13
  import { Platform, StyleSheet, Text, View } from "react-native";
11
14
  <% } %>
@@ -45,6 +48,16 @@ export default function Modal() {
45
48
  <EditScreenInfo path="src/screens/modal.tsx" />
46
49
  </Box>
47
50
  );
51
+ <% } else if (props.stylingPackage?.name === "unistyles") { %>
52
+ const { theme } = useStyles()
53
+ return (
54
+ <View style={theme.components.container}>
55
+ <StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
56
+ <Text style={theme.components.title}>Modal</Text>
57
+ <View style={theme.components.separator} />
58
+ <EditScreenInfo path='src/screens/modal.tsx' />
59
+ </View>
60
+ );
48
61
  <% } else { %>
49
62
  return (
50
63
  <View style={styles.container}>