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.
- package/README.md +1 -0
- package/build/commands/create-expo-stack.js +39 -17
- package/build/templates/base/App.tsx.ejs +22 -0
- package/build/templates/base/babel.config.js.ejs +1 -1
- package/build/templates/base/package.json.ejs +6 -1
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +41 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/index.tsx.ejs +88 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/two.tsx.ejs +88 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/_layout.tsx.ejs +43 -19
- package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +14 -1
- package/build/templates/packages/expo-router/drawer/app/[...unmatched].tsx.ejs +26 -0
- package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +36 -30
- package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +96 -0
- package/build/templates/packages/expo-router/drawer/components/edit-screen-info.tsx.ejs +153 -0
- package/build/templates/packages/expo-router/stack/app/[...unmatched].tsx.ejs +28 -0
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +4 -0
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +43 -1
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +36 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +30 -8
- package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +16 -2
- package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +15 -2
- package/build/templates/packages/expo-router/tabs/app/[...unmatched].tsx.ejs +28 -0
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +4 -0
- package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +15 -1
- package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +36 -0
- package/build/templates/packages/react-navigation/App.tsx.ejs +3 -0
- package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +59 -0
- package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +41 -6
- package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +31 -2
- package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +47 -17
- package/build/templates/packages/react-navigation/screens/details.tsx.ejs +25 -0
- package/build/templates/packages/react-navigation/screens/home.tsx.ejs +83 -0
- package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +13 -0
- package/build/templates/packages/react-navigation/screens/one.tsx.ejs +12 -0
- package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +33 -2
- package/build/templates/packages/react-navigation/screens/two.tsx.ejs +12 -0
- package/build/templates/packages/unistyles/breakpoints.ts.ejs +9 -0
- package/build/templates/packages/unistyles/theme.ts.ejs +76 -0
- package/build/templates/packages/unistyles/unistyles.ts.ejs +27 -0
- package/build/types/types.d.ts +2 -2
- package/build/types/utilities/printOutput.d.ts +2 -2
- package/build/types.js +3 -2
- package/build/utilities/configureProjectFiles.js +22 -6
- package/build/utilities/generateProjectFiles.js +5 -2
- package/build/utilities/printOutput.js +14 -2
- package/build/utilities/runCLI.js +7 -3
- package/build/utilities/showHelp.js +3 -1
- package/package.json +2 -2
- package/build/templates/packages/expo-router/drawer/app/(drawer)/news.tsx.ejs +0 -71
|
@@ -1,13 +1,16 @@
|
|
|
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 {
|
|
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
|
-
|
|
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,25 +20,25 @@ import { Slot } from 'expo-router';
|
|
|
17
20
|
<% } %>
|
|
18
21
|
|
|
19
22
|
export const unstable_settings = {
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
// Ensure that reloading on `/modal` keeps a back button present.
|
|
24
|
+
initialRouteName: "(drawer)",
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
export default function RootLayout() {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
+
});
|
|
30
33
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (loaded) {
|
|
36
|
+
SplashScreen.hideAsync();
|
|
37
|
+
}
|
|
38
|
+
}, [loaded]);
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
if (!loaded) return null;
|
|
41
|
+
<% } %>
|
|
39
42
|
|
|
40
43
|
return (
|
|
41
44
|
<% if (props.stylingPackage?.name === "tamagui") { %>
|
|
@@ -43,13 +46,16 @@ export default function RootLayout() {
|
|
|
43
46
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
44
47
|
<ThemeProvider theme={theme}>
|
|
45
48
|
<% } %>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
+
);
|
|
55
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,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({
|
|
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
|
+
});
|
|
74
102
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
75
103
|
const styles = StyleSheet.create({
|
|
76
104
|
container: {
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
9
9
|
import { Box, Text } from 'theme';
|
|
10
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";
|
|
11
14
|
<% } else { %>
|
|
12
15
|
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
13
16
|
<% } %>
|
|
@@ -17,7 +20,19 @@ import { Stack, useLocalSearchParams, useRouter } from "expo-router";
|
|
|
17
20
|
export default function Details() {
|
|
18
21
|
const { name } = useLocalSearchParams();
|
|
19
22
|
const router = useRouter();
|
|
20
|
-
|
|
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") { %>
|
|
21
36
|
const BackButton = () => (
|
|
22
37
|
<TouchableOpacity onPress={router.back}>
|
|
23
38
|
<View className={styles.backButton}>
|
|
@@ -84,6 +99,14 @@ export default function Details() {
|
|
|
84
99
|
</Box>
|
|
85
100
|
</Box>
|
|
86
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>
|
|
87
110
|
<% } else { %>
|
|
88
111
|
<View style={styles.container}>
|
|
89
112
|
<Stack.Screen options={{ title: "Details", headerLeft: () => <BackButton /> }} />
|
|
@@ -105,6 +128,25 @@ export default function Details() {
|
|
|
105
128
|
title: "text-[64px] font-bold",
|
|
106
129
|
subtitle: "text-4xl text-gray-700",
|
|
107
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
|
+
}));
|
|
108
150
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
109
151
|
const styles = StyleSheet.create({
|
|
110
152
|
backButton: {
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
7
7
|
import { TouchableOpacity } from 'react-native';
|
|
8
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';
|
|
9
12
|
<% } else { %>
|
|
10
13
|
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
11
14
|
<% } %>
|
|
@@ -18,6 +21,10 @@ export default function Page() {
|
|
|
18
21
|
const styles = useStyles();
|
|
19
22
|
<% } %>
|
|
20
23
|
|
|
24
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
25
|
+
const { styles, theme } = useStyles(stylesheet);
|
|
26
|
+
<% } %>
|
|
27
|
+
|
|
21
28
|
return (
|
|
22
29
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
23
30
|
<View className={styles.container}>
|
|
@@ -70,6 +77,21 @@ export default function Page() {
|
|
|
70
77
|
</Box>
|
|
71
78
|
</Box>
|
|
72
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>
|
|
73
95
|
<% } else { %>
|
|
74
96
|
<View style={styles.container}>
|
|
75
97
|
<View style={styles.main}>
|
|
@@ -117,6 +139,20 @@ export default function Page() {
|
|
|
117
139
|
shadowRadius: 3.84,
|
|
118
140
|
},
|
|
119
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
|
+
|
|
120
156
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
121
157
|
const styles = StyleSheet.create({
|
|
122
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:
|
|
27
|
+
tabBarActiveTintColor: 'black',
|
|
17
28
|
}}>
|
|
18
29
|
<Tabs.Screen
|
|
19
|
-
name=
|
|
30
|
+
name='index'
|
|
20
31
|
options={{
|
|
21
|
-
title:
|
|
22
|
-
tabBarIcon: ({ color }) => <TabBarIcon name=
|
|
32
|
+
title: 'Tab One',
|
|
33
|
+
tabBarIcon: ({ color }) => <TabBarIcon name='code' color={color} />,
|
|
23
34
|
headerRight: () => (
|
|
24
|
-
<Link href=
|
|
35
|
+
<Link href='/modal' asChild>
|
|
25
36
|
<Pressable>
|
|
26
37
|
{({ pressed }) => (
|
|
27
38
|
<FontAwesome
|
|
28
|
-
name=
|
|
39
|
+
name='info-circle'
|
|
29
40
|
size={25}
|
|
30
|
-
color=
|
|
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
|
+
<% } %>
|
|
@@ -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 TabOneScreen() {
|
|
14
|
-
|
|
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") { %>
|
|
15
28
|
return (
|
|
16
29
|
<View className={styles.container}>
|
|
17
30
|
<Text className={styles.title}>Tab One</Text>
|
|
@@ -36,7 +49,7 @@ export default function TabOneScreen() {
|
|
|
36
49
|
<Box height={1} marginVertical="l_32" width="80%" />
|
|
37
50
|
<EditScreenInfo path="app/(tabs)/index.tsx" />
|
|
38
51
|
</Box>
|
|
39
|
-
);
|
|
52
|
+
);
|
|
40
53
|
<% } else { %>
|
|
41
54
|
return (
|
|
42
55
|
<View style={styles.container}>
|
|
@@ -62,6 +75,7 @@ export default function TabOneScreen() {
|
|
|
62
75
|
justifyContent: "center",
|
|
63
76
|
},
|
|
64
77
|
separator: {
|
|
78
|
+
backgroundColor: '#d1d5db',
|
|
65
79
|
height: 1,
|
|
66
80
|
marginVertical: 30,
|
|
67
81
|
width: "80%",
|