create-expo-stack 2.3.15 → 2.4.0-next.43d8ac0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -1
- package/build/commands/create-expo-stack.js +23 -2
- package/build/templates/base/App.tsx.ejs +34 -0
- package/build/templates/base/package.json.ejs +9 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +33 -1
- package/build/templates/packages/expo-router/drawer/app/(drawer)/news.tsx.ejs +34 -1
- package/build/templates/packages/expo-router/drawer/app/[...unmatched].tsx.ejs +51 -0
- package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +10 -2
- package/build/templates/packages/expo-router/stack/app/[...unmatched].tsx.ejs +53 -0
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +9 -3
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +61 -0
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +101 -2
- package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +23 -1
- package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +33 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +33 -0
- package/build/templates/packages/expo-router/tabs/app/[...unmatched].tsx.ejs +53 -0
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +8 -0
- package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +35 -0
- package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +52 -1
- package/build/templates/packages/react-navigation/App.tsx.ejs +11 -1
- package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +82 -1
- package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +38 -3
- package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +30 -3
- package/build/templates/packages/react-navigation/screens/details.tsx.ejs +46 -0
- package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +57 -1
- package/build/templates/packages/react-navigation/screens/one.tsx.ejs +53 -0
- package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +105 -1
- package/build/templates/packages/react-navigation/screens/two.tsx.ejs +53 -0
- package/build/templates/packages/restyle/theme/Box.tsx.ejs +6 -0
- package/build/templates/packages/restyle/theme/Text.tsx.ejs +6 -0
- package/build/templates/packages/restyle/theme/index.ts.ejs +6 -0
- package/build/templates/packages/restyle/theme/theme.ts.ejs +67 -0
- package/build/templates/packages/unistyles/breakpoints.ts.ejs +9 -0
- package/build/templates/packages/unistyles/theme.ts.ejs +26 -0
- package/build/templates/packages/unistyles/unistyles.ts.ejs +28 -0
- package/build/types/types.d.ts +1 -1
- package/build/types/utilities/printOutput.d.ts +2 -2
- package/build/types.js +4 -2
- package/build/utilities/configureProjectFiles.js +22 -1
- package/build/utilities/generateProjectFiles.js +7 -1
- package/build/utilities/printOutput.js +14 -2
- package/build/utilities/runCLI.js +10 -2
- package/build/utilities/showHelp.js +3 -1
- package/package.json +66 -66
|
@@ -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} = 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
|
-
|
|
44
|
+
<% } else if (props.stylingPackage?.name === "tamagui") { %>
|
|
31
45
|
<Container>
|
|
32
46
|
<Main>
|
|
33
47
|
<Stack.Screen options={{ title: "Overview" }} />
|
|
@@ -40,7 +54,30 @@ export default function Page() {
|
|
|
40
54
|
</Link>
|
|
41
55
|
</Main>
|
|
42
56
|
</Container>
|
|
43
|
-
|
|
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 { %>
|
|
44
81
|
<View style={styles.container}>
|
|
45
82
|
<View style={styles.main}>
|
|
46
83
|
<Stack.Screen options={{ title: "Overview" }} />
|
|
@@ -68,6 +105,68 @@ export default function Page() {
|
|
|
68
105
|
title: "text-[64px] font-bold",
|
|
69
106
|
subtitle: "text-4xl text-gray-700",
|
|
70
107
|
};
|
|
108
|
+
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
109
|
+
const useStyles = makeStyles((theme) => ({
|
|
110
|
+
button: {
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
backgroundColor: theme.colors.purple,
|
|
113
|
+
borderRadius: theme.borderRadii.xl_24,
|
|
114
|
+
elevation: 5,
|
|
115
|
+
flexDirection: 'row',
|
|
116
|
+
justifyContent: 'center',
|
|
117
|
+
padding: theme.spacing.m_16,
|
|
118
|
+
shadowColor: theme.colors.black,
|
|
119
|
+
shadowOffset: {
|
|
120
|
+
height: 2,
|
|
121
|
+
width: 0,
|
|
122
|
+
},
|
|
123
|
+
shadowOpacity: 0.25,
|
|
124
|
+
shadowRadius: 3.84,
|
|
125
|
+
},
|
|
126
|
+
}));
|
|
127
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
128
|
+
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
|
+
});
|
|
71
170
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
72
171
|
const styles = StyleSheet.create({
|
|
73
172
|
button: {
|
|
@@ -1,15 +1,26 @@
|
|
|
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={{
|
|
@@ -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 { createStyleSheet, 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,6 +14,9 @@
|
|
|
9
14
|
import EditScreenInfo from "../../components/edit-screen-info";
|
|
10
15
|
|
|
11
16
|
export default function TabOneScreen() {
|
|
17
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
18
|
+
const { styles } = useStyles(stylesheet)
|
|
19
|
+
<% } %>
|
|
12
20
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
13
21
|
return (
|
|
14
22
|
<View className={styles.container}>
|
|
@@ -27,6 +35,14 @@ export default function TabOneScreen() {
|
|
|
27
35
|
</YStack>
|
|
28
36
|
</Theme>
|
|
29
37
|
);
|
|
38
|
+
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
39
|
+
return (
|
|
40
|
+
<Box flex={1} alignItems="center" justifyContent="center">
|
|
41
|
+
<Text variant="title">Tab One</Text>
|
|
42
|
+
<Box height={1} marginVertical="l_32" width="80%" />
|
|
43
|
+
<EditScreenInfo path="app/(tabs)/index.tsx" />
|
|
44
|
+
</Box>
|
|
45
|
+
);
|
|
30
46
|
<% } else { %>
|
|
31
47
|
return (
|
|
32
48
|
<View style={styles.container}>
|
|
@@ -44,6 +60,23 @@ export default function TabOneScreen() {
|
|
|
44
60
|
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
45
61
|
title: `text-xl font-bold`
|
|
46
62
|
};
|
|
63
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
64
|
+
const stylesheet = createStyleSheet({
|
|
65
|
+
container: {
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
flex: 1,
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
},
|
|
70
|
+
separator: {
|
|
71
|
+
height: 1,
|
|
72
|
+
marginVertical: 30,
|
|
73
|
+
width: "80%",
|
|
74
|
+
},
|
|
75
|
+
title: {
|
|
76
|
+
fontSize: 20,
|
|
77
|
+
fontWeight: "bold",
|
|
78
|
+
}
|
|
79
|
+
});
|
|
47
80
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
48
81
|
const styles = StyleSheet.create({
|
|
49
82
|
container: {
|
|
@@ -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 { createStyleSheet, 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,6 +14,9 @@
|
|
|
9
14
|
import EditScreenInfo from "../../components/edit-screen-info";
|
|
10
15
|
|
|
11
16
|
export default function TabTwoScreen() {
|
|
17
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
18
|
+
const {styles} = useStyles(stylesheet)
|
|
19
|
+
<% } %>
|
|
12
20
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
13
21
|
return (
|
|
14
22
|
<View className={styles.container}>
|
|
@@ -27,6 +35,14 @@ export default function TabTwoScreen() {
|
|
|
27
35
|
</YStack>
|
|
28
36
|
</Theme>
|
|
29
37
|
);
|
|
38
|
+
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
39
|
+
return (
|
|
40
|
+
<Box flex={1} alignItems="center" justifyContent="center">
|
|
41
|
+
<Text variant="title">Tab Two</Text>
|
|
42
|
+
<Box height={1} marginVertical="l_32" width="80%" />
|
|
43
|
+
<EditScreenInfo path="app/(tabs)/two.tsx" />
|
|
44
|
+
</Box>
|
|
45
|
+
);
|
|
30
46
|
<% } else { %>
|
|
31
47
|
return (
|
|
32
48
|
<View style={styles.container}>
|
|
@@ -44,6 +60,23 @@ export default function TabTwoScreen() {
|
|
|
44
60
|
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
45
61
|
title: `text-xl font-bold`
|
|
46
62
|
};
|
|
63
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
64
|
+
const stylesheet = createStyleSheet({
|
|
65
|
+
container: {
|
|
66
|
+
alignItems: "center",
|
|
67
|
+
flex: 1,
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
},
|
|
70
|
+
separator: {
|
|
71
|
+
height: 1,
|
|
72
|
+
marginVertical: 30,
|
|
73
|
+
width: "80%",
|
|
74
|
+
},
|
|
75
|
+
title: {
|
|
76
|
+
fontSize: 20,
|
|
77
|
+
fontWeight: "bold",
|
|
78
|
+
}
|
|
79
|
+
});
|
|
47
80
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
48
81
|
const styles = StyleSheet.create({
|
|
49
82
|
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({
|
|
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
|
<% } %>
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
import config from '../tamagui.config'
|
|
8
8
|
|
|
9
9
|
SplashScreen.preventAutoHideAsync();
|
|
10
|
+
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
11
|
+
import { ThemeProvider } from '@shopify/restyle';
|
|
12
|
+
import { Stack } from 'expo-router';
|
|
13
|
+
import { theme } from 'theme';
|
|
10
14
|
<% } else { %>
|
|
11
15
|
import { Stack } from "expo-router";
|
|
12
16
|
<% } %>
|
|
@@ -35,6 +39,8 @@ export default function RootLayout() {
|
|
|
35
39
|
return (
|
|
36
40
|
<% if (props.stylingPackage?.name === "tamagui") { %>
|
|
37
41
|
<TamaguiProvider config={config}>
|
|
42
|
+
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
43
|
+
<ThemeProvider theme={theme}>
|
|
38
44
|
<% } %>
|
|
39
45
|
<Stack>
|
|
40
46
|
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
@@ -42,6 +48,8 @@ export default function RootLayout() {
|
|
|
42
48
|
</Stack>
|
|
43
49
|
<% if (props.stylingPackage?.name === "tamagui") { %>
|
|
44
50
|
</TamaguiProvider>
|
|
51
|
+
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
52
|
+
</ThemeProvider>
|
|
45
53
|
<% } %>
|
|
46
54
|
);
|
|
47
55
|
}
|
|
@@ -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 { createStyleSheet, 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,6 +17,9 @@ import { StatusBar } from "expo-status-bar";
|
|
|
11
17
|
import EditScreenInfo from "../components/edit-screen-info";
|
|
12
18
|
|
|
13
19
|
export default function ModalScreen() {
|
|
20
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
21
|
+
const {styles} = useStyles(stylesheet)
|
|
22
|
+
<% } %>
|
|
14
23
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
15
24
|
return (
|
|
16
25
|
<View className={styles.container}>
|
|
@@ -31,6 +40,15 @@ export default function ModalScreen() {
|
|
|
31
40
|
</YStack>
|
|
32
41
|
</Theme>
|
|
33
42
|
);
|
|
43
|
+
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
44
|
+
return (
|
|
45
|
+
<Box flex={1} alignItems="center" justifyContent="center">
|
|
46
|
+
<StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
|
|
47
|
+
<Text variant="title">Modal</Text>
|
|
48
|
+
<Box height={1} marginVertical="l_32" width="80%" />
|
|
49
|
+
<EditScreenInfo path="app/modal.tsx" />
|
|
50
|
+
</Box>
|
|
51
|
+
);
|
|
34
52
|
<% } else { %>
|
|
35
53
|
return (
|
|
36
54
|
<View style={styles.container}>
|
|
@@ -49,6 +67,23 @@ export default function ModalScreen() {
|
|
|
49
67
|
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
50
68
|
title: `text-xl font-bold`
|
|
51
69
|
};
|
|
70
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
71
|
+
const stylesheet = createStyleSheet({
|
|
72
|
+
container: {
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
flex: 1,
|
|
75
|
+
justifyContent: "center"
|
|
76
|
+
},
|
|
77
|
+
separator: {
|
|
78
|
+
height: 1,
|
|
79
|
+
marginVertical: 30,
|
|
80
|
+
width: "80%"
|
|
81
|
+
},
|
|
82
|
+
title: {
|
|
83
|
+
fontSize: 20,
|
|
84
|
+
fontWeight: "bold"
|
|
85
|
+
}
|
|
86
|
+
});
|
|
52
87
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
53
88
|
const styles = StyleSheet.create({
|
|
54
89
|
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: {
|
|
@@ -8,7 +8,11 @@ import "react-native-gesture-handler";
|
|
|
8
8
|
import config from './tamagui.config'
|
|
9
9
|
|
|
10
10
|
SplashScreen.preventAutoHideAsync();
|
|
11
|
+
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
12
|
+
import { ThemeProvider } from '@shopify/restyle';
|
|
13
|
+
import { theme } from 'theme';
|
|
11
14
|
<% } %>
|
|
15
|
+
|
|
12
16
|
import RootStack from "./src/navigation";
|
|
13
17
|
|
|
14
18
|
export default function App() {
|
|
@@ -33,7 +37,13 @@ export default function App() {
|
|
|
33
37
|
<RootStack />
|
|
34
38
|
</TamaguiProvider>
|
|
35
39
|
);
|
|
36
|
-
<% } else { %>
|
|
40
|
+
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
41
|
+
return (
|
|
42
|
+
<ThemeProvider theme={theme}>
|
|
43
|
+
<RootStack />
|
|
44
|
+
</ThemeProvider>
|
|
45
|
+
);
|
|
46
|
+
<% } else { %>
|
|
37
47
|
return <RootStack />;
|
|
38
48
|
<% } %>
|
|
39
49
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
3
3
|
import { Text, View } from "react-native";
|
|
4
|
+
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
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";
|
|
4
9
|
<% } else { %>
|
|
5
10
|
import { StyleSheet, Text, View } from "react-native";
|
|
6
11
|
<% } %>
|
|
@@ -30,6 +35,52 @@ import React from "react";
|
|
|
30
35
|
</View>
|
|
31
36
|
);
|
|
32
37
|
}
|
|
38
|
+
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
39
|
+
export default function EditScreenInfo({ path }: { path: string }) {
|
|
40
|
+
return (
|
|
41
|
+
<Box>
|
|
42
|
+
<Box alignItems="center" marginHorizontal="xl_64">
|
|
43
|
+
<Text variant="body" lineHeight={24} textAlign="center">
|
|
44
|
+
Open up the code for this screen:
|
|
45
|
+
</Text>
|
|
46
|
+
|
|
47
|
+
<Box borderRadius="s_3" paddingHorizontal="xs_4" marginVertical="s_8">
|
|
48
|
+
<Text>{path}</Text>
|
|
49
|
+
</Box>
|
|
50
|
+
|
|
51
|
+
<Text variant="body" lineHeight={24} textAlign="center">
|
|
52
|
+
Change any of the text, save the file, and your app will automatically update.
|
|
53
|
+
</Text>
|
|
54
|
+
</Box>
|
|
55
|
+
</Box>
|
|
56
|
+
);
|
|
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
|
+
}
|
|
33
84
|
<% } else { %>
|
|
34
85
|
export default function EditScreenInfo({ path }: { path: string }) {
|
|
35
86
|
return (
|
|
@@ -66,7 +117,37 @@ import React from "react";
|
|
|
66
117
|
helpLink: "py-4",
|
|
67
118
|
helpLinkText: "text-center"
|
|
68
119
|
};
|
|
69
|
-
<% } else { %>
|
|
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
|
+
});
|
|
150
|
+
<% } else if (props.stylingPackage?.name !== "restyle") { %>
|
|
70
151
|
const styles = StyleSheet.create({
|
|
71
152
|
codeHighlightContainer: {
|
|
72
153
|
borderRadius: 3,
|