create-expo-stack 2.4.3 → 2.5.0-next.00da55e
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 +213 -156
- package/build/commands/create-expo-stack.js +62 -56
- package/build/templates/base/App.tsx.ejs +51 -91
- package/build/templates/base/app.json.ejs +6 -0
- package/build/templates/base/components/BackButton.tsx.ejs +23 -0
- package/build/templates/base/components/Button.tsx.ejs +40 -0
- package/build/templates/base/components/EditScreenInfo.tsx.ejs +55 -0
- package/build/templates/base/components/HeaderButton.tsx.ejs +28 -0
- package/build/templates/base/components/ScreenContent.tsx.ejs +38 -0
- package/build/templates/base/components/TabBarIcon.tsx.ejs +15 -0
- package/build/templates/base/package.json.ejs +17 -7
- package/build/templates/base/prettier.config.js.ejs +11 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +1 -13
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/index.tsx.ejs +18 -84
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/two.tsx.ejs +18 -84
- package/build/templates/packages/expo-router/drawer/app/(drawer)/_layout.tsx.ejs +4 -18
- package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +12 -80
- package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +4 -0
- package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +16 -92
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +3 -0
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +17 -171
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +23 -187
- package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +6 -50
- package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +18 -84
- package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +18 -83
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +3 -0
- package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +17 -92
- package/build/templates/packages/i18next/components/InternalizationExample.tsx.ejs +23 -0
- package/build/templates/packages/i18next/core/i18n/fallbackChecker.ts.ejs +13 -0
- package/build/templates/packages/i18next/core/i18n/init.ts.ejs +24 -0
- package/build/templates/packages/i18next/core/i18n/languageDetector.ts.ejs +13 -0
- package/build/templates/packages/i18next/translation/en.json.ejs +8 -0
- package/build/templates/packages/i18next/translation/fr.json.ejs +8 -0
- package/build/templates/packages/i18next/translation/index.ts.ejs +20 -0
- package/build/templates/packages/nativewind/components/BackButton.tsx.ejs +18 -0
- package/build/templates/packages/nativewind/components/Button.tsx.ejs +14 -0
- package/build/templates/packages/nativewind/components/EditScreenInfo.tsx.ejs +40 -0
- package/build/templates/packages/nativewind/components/ScreenContent.tsx.ejs +25 -0
- package/build/templates/packages/react-navigation/App.tsx.ejs +4 -1
- package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +14 -26
- package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +2 -101
- package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +8 -62
- package/build/templates/packages/react-navigation/screens/details.tsx.ejs +22 -108
- package/build/templates/packages/react-navigation/screens/home.tsx.ejs +3 -82
- package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +16 -104
- package/build/templates/packages/react-navigation/screens/one.tsx.ejs +2 -97
- package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +37 -182
- package/build/templates/packages/react-navigation/screens/two.tsx.ejs +3 -98
- package/build/templates/packages/restyle/components/BackButton.tsx.ejs +15 -0
- package/build/templates/packages/restyle/components/Button.tsx.ejs +32 -0
- package/build/templates/packages/restyle/components/EditScreenInfo.tsx.ejs +29 -0
- package/build/templates/packages/restyle/components/ScreenContent.tsx.ejs +20 -0
- package/build/templates/packages/tamagui/components/BackButton.tsx.ejs +19 -0
- package/build/templates/packages/tamagui/components/Button.tsx.ejs +9 -0
- package/build/templates/packages/tamagui/components/EditScreenInfo.tsx.ejs +29 -0
- package/build/templates/packages/tamagui/components/ScreenContent.tsx.ejs +22 -0
- package/build/templates/packages/unistyles/components/BackButton.tsx.ejs +26 -0
- package/build/templates/packages/unistyles/components/Button.tsx.ejs +12 -0
- package/build/templates/packages/unistyles/components/EditScreenInfo.tsx.ejs +61 -0
- package/build/templates/packages/unistyles/components/ScreenContent.tsx.ejs +24 -0
- package/build/templates/packages/unistyles/theme.ts.ejs +30 -46
- package/build/types/types.d.ts +3 -2
- package/build/types/utilities/configureProjectFiles.d.ts +1 -1
- package/build/types/utilities/generateProjectFiles.d.ts +1 -1
- package/build/types/utilities/getPackageManager.d.ts +1 -0
- package/build/types/utilities/validateProjectName.d.ts +1 -1
- package/build/types.js +3 -2
- package/build/utilities/configureProjectFiles.js +86 -19
- package/build/utilities/generateProjectFiles.js +8 -4
- package/build/utilities/getPackageManager.js +9 -2
- package/build/utilities/printOutput.js +4 -2
- package/build/utilities/renderTitle.js +8 -1
- package/build/utilities/runCLI.js +124 -34
- package/build/utilities/showHelp.js +4 -1
- package/build/utilities/validateProjectName.js +14 -8
- package/package.json +66 -66
- package/build/templates/base/.prettierrc +0 -7
- package/build/templates/packages/expo-router/drawer/components/edit-screen-info.tsx.ejs +0 -153
- package/build/templates/packages/expo-router/index.js +0 -4
- package/build/templates/packages/expo-router/index.ts +0 -1
- package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +0 -153
- package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +0 -180
- package/build/types/templates/packages/expo-router/index.d.ts +0 -1
- /package/build/templates/packages/expo-router/drawer/app/{[...unmatched].tsx.ejs → +not-found.tsx.ejs} +0 -0
- /package/build/templates/packages/expo-router/stack/app/{[...unmatched].tsx.ejs → +not-found.tsx.ejs} +0 -0
- /package/build/templates/packages/expo-router/tabs/app/{[...unmatched].tsx.ejs → +not-found.tsx.ejs} +0 -0
|
@@ -1,177 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { Stack, useRouter } from "expo-router";
|
|
6
|
-
import { Button, Text, YStack } from "tamagui";
|
|
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";
|
|
14
|
-
<% } else { %>
|
|
15
|
-
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
16
|
-
<% } %>
|
|
17
|
-
import { Feather } from '@expo/vector-icons';
|
|
18
|
-
import { Stack, useLocalSearchParams, useRouter } from "expo-router";
|
|
1
|
+
import { ScreenContent } from 'components/ScreenContent';
|
|
2
|
+
import { Stack, useLocalSearchParams } from 'expo-router';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
19
4
|
|
|
20
5
|
export default function Details() {
|
|
21
|
-
|
|
22
|
-
const router = useRouter();
|
|
6
|
+
const { name } = useLocalSearchParams();
|
|
23
7
|
|
|
24
|
-
|
|
25
|
-
|
|
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") { %>
|
|
36
|
-
const BackButton = () => (
|
|
37
|
-
<TouchableOpacity onPress={router.back}>
|
|
38
|
-
<View className={styles.backButton}>
|
|
39
|
-
<Feather name="chevron-left" size={16} color="#007AFF" />
|
|
40
|
-
<Text className={styles.backButtonText}>Back</Text>
|
|
41
|
-
</View>
|
|
42
|
-
</TouchableOpacity>
|
|
43
|
-
);
|
|
44
|
-
<% } else if (props.stylingPackage?.name === "tamagui") { %>
|
|
45
|
-
|
|
46
|
-
const BackButton = () => (
|
|
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>
|
|
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
|
-
);
|
|
60
|
-
<% } else { %>
|
|
61
|
-
const BackButton = () => (
|
|
62
|
-
<TouchableOpacity onPress={router.back}>
|
|
63
|
-
<View style={styles.backButton}>
|
|
64
|
-
<Feather name="chevron-left" size={16} color="#007AFF" />
|
|
65
|
-
<Text style={styles.backButtonText}>Back</Text>
|
|
66
|
-
</View>
|
|
67
|
-
</TouchableOpacity>
|
|
68
|
-
);
|
|
69
|
-
<% } %>
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
73
|
-
<View className={styles.container}>
|
|
74
|
-
<Stack.Screen options={{ title: "Details", headerLeft: () => <BackButton /> }} />
|
|
75
|
-
<View className={styles.main}>
|
|
76
|
-
<Text className={styles.title}>Details</Text>
|
|
77
|
-
<Text className={styles.subtitle}>Showing details for user {name}.</Text>
|
|
78
|
-
</View>
|
|
79
|
-
</View>
|
|
80
|
-
<% } else if (props.stylingPackage?.name === "tamagui") { %>
|
|
81
|
-
<Container>
|
|
82
|
-
<Stack.Screen options={{ title: "Details", headerLeft: () => <BackButton /> }} />
|
|
83
|
-
<Main>
|
|
84
|
-
<YStack>
|
|
85
|
-
<Title>Details</Title>
|
|
86
|
-
<Subtitle>Showing details for user {name}.</Subtitle>
|
|
87
|
-
</YStack>
|
|
88
|
-
</Main>
|
|
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") { %>
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<Stack.Screen options={{ title: 'Details' }} />
|
|
103
11
|
<View style={styles.container}>
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
</View>
|
|
109
|
-
</View>
|
|
110
|
-
<% } else { %>
|
|
111
|
-
<View style={styles.container}>
|
|
112
|
-
<Stack.Screen options={{ title: "Details", headerLeft: () => <BackButton /> }} />
|
|
113
|
-
<View style={styles.main}>
|
|
114
|
-
<Text style={styles.title}>Details</Text>
|
|
115
|
-
<Text style={styles.subtitle}>Showing details for user {name}.</Text>
|
|
116
|
-
</View>
|
|
117
|
-
</View>
|
|
118
|
-
<% } %>
|
|
119
|
-
);
|
|
12
|
+
<ScreenContent path="screens/details.tsx" title={`Showing details for user ${name}`} />
|
|
13
|
+
</View>
|
|
14
|
+
</>
|
|
15
|
+
);
|
|
120
16
|
}
|
|
121
17
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
title: "text-[64px] font-bold",
|
|
129
|
-
subtitle: "text-4xl text-gray-700",
|
|
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
|
-
}));
|
|
150
|
-
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
151
|
-
const styles = StyleSheet.create({
|
|
152
|
-
backButton: {
|
|
153
|
-
flexDirection: "row",
|
|
154
|
-
},
|
|
155
|
-
backButtonText: {
|
|
156
|
-
color: "#007AFF",
|
|
157
|
-
marginLeft: 4,
|
|
158
|
-
},
|
|
159
|
-
container: {
|
|
160
|
-
flex: 1,
|
|
161
|
-
padding: 24,
|
|
162
|
-
},
|
|
163
|
-
main: {
|
|
164
|
-
flex: 1,
|
|
165
|
-
maxWidth: 960,
|
|
166
|
-
marginHorizontal: "auto",
|
|
167
|
-
},
|
|
168
|
-
title: {
|
|
169
|
-
fontSize: 64,
|
|
170
|
-
fontWeight: "bold",
|
|
171
|
-
},
|
|
172
|
-
subtitle: {
|
|
173
|
-
fontSize: 36,
|
|
174
|
-
color: "#38434D",
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
<% } %>
|
|
18
|
+
const styles = StyleSheet.create({
|
|
19
|
+
container: {
|
|
20
|
+
flex: 1,
|
|
21
|
+
padding: 24,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -1,199 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<% } else if (props.stylingPackage?.name === "tamagui") { %>
|
|
4
|
-
import { YStack } from "tamagui";
|
|
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';
|
|
12
|
-
<% } else { %>
|
|
13
|
-
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
14
|
-
<% } %>
|
|
15
|
-
import { Stack } from "expo-router";
|
|
1
|
+
import { Stack, Link } from 'expo-router';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
16
3
|
|
|
17
|
-
import {
|
|
4
|
+
import { Button } from '../components/Button';
|
|
18
5
|
|
|
19
|
-
|
|
20
|
-
<% if (props.stylingPackage?.name === "restyle") { %>
|
|
21
|
-
const styles = useStyles();
|
|
22
|
-
<% } %>
|
|
6
|
+
import { ScreenContent } from '~/components/ScreenContent';
|
|
23
7
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
9
|
+
import { InternalizationExample } from 'components/InternalizationExample';
|
|
10
|
+
<% } %>
|
|
27
11
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<View className={styles.main}>
|
|
33
|
-
<View>
|
|
34
|
-
<Text className={styles.title}>Hello World</Text>
|
|
35
|
-
<Text className={styles.subtitle}>This is the first page of your app.</Text>
|
|
36
|
-
</View>
|
|
37
|
-
<Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
|
|
38
|
-
<TouchableOpacity className={styles.button} >
|
|
39
|
-
<Text className={styles.buttonText}>Show Details</Text>
|
|
40
|
-
</TouchableOpacity>
|
|
41
|
-
</Link>
|
|
42
|
-
</View>
|
|
43
|
-
</View>
|
|
44
|
-
<% } else if (props.stylingPackage?.name === "tamagui") { %>
|
|
45
|
-
<Container>
|
|
46
|
-
<Main>
|
|
47
|
-
<Stack.Screen options={{ title: "Overview" }} />
|
|
48
|
-
<YStack>
|
|
49
|
-
<Title>Hello World</Title>
|
|
50
|
-
<Subtitle>This is the first page of your app.</Subtitle>
|
|
51
|
-
</YStack>
|
|
52
|
-
<Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
|
|
53
|
-
<Button><ButtonText>Show Details</ButtonText></Button>
|
|
54
|
-
</Link>
|
|
55
|
-
</Main>
|
|
56
|
-
</Container>
|
|
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") { %>
|
|
12
|
+
export default function Home() {
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<Stack.Screen options={{ title: 'Home' }} />
|
|
81
16
|
<View style={styles.container}>
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
</View>
|
|
94
|
-
</View>
|
|
95
|
-
<% } else { %>
|
|
96
|
-
<View style={styles.container}>
|
|
97
|
-
<View style={styles.main}>
|
|
98
|
-
<Stack.Screen options={{ title: "Overview" }} />
|
|
99
|
-
<View>
|
|
100
|
-
<Text style={styles.title}>Hello World</Text>
|
|
101
|
-
<Text style={styles.subtitle}>This is the first page of your app.</Text>
|
|
102
|
-
</View>
|
|
103
|
-
<Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
|
|
104
|
-
<TouchableOpacity style={styles.button} >
|
|
105
|
-
<Text style={styles.buttonText}>Show Details</Text>
|
|
106
|
-
</TouchableOpacity>
|
|
107
|
-
</Link>
|
|
108
|
-
</View>
|
|
109
|
-
</View>
|
|
110
|
-
<% } %>
|
|
111
|
-
);
|
|
17
|
+
<ScreenContent path="app/index.tsx" title="Home">
|
|
18
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
19
|
+
<InternalizationExample />
|
|
20
|
+
<% } %>
|
|
21
|
+
</ScreenContent>
|
|
22
|
+
<Link href={{ pathname: '/details', params: { name: 'Dan' } }} asChild>
|
|
23
|
+
<Button title="Show Details" />
|
|
24
|
+
</Link>
|
|
25
|
+
</View>
|
|
26
|
+
</>
|
|
27
|
+
);
|
|
112
28
|
}
|
|
113
29
|
|
|
114
|
-
|
|
115
|
-
const styles = {
|
|
116
|
-
button: "items-center bg-indigo-500 rounded-[28px] shadow-md p-4",
|
|
117
|
-
buttonText: "text-white text-lg font-semibold text-center",
|
|
118
|
-
container: "flex-1 p-6",
|
|
119
|
-
main: "flex-1 max-w-[960] justify-between",
|
|
120
|
-
title: "text-[64px] font-bold",
|
|
121
|
-
subtitle: "text-4xl text-gray-700",
|
|
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({
|
|
30
|
+
const styles = StyleSheet.create({
|
|
144
31
|
container: {
|
|
145
32
|
flex: 1,
|
|
146
33
|
padding: 24,
|
|
147
34
|
},
|
|
148
|
-
main: {
|
|
149
|
-
flex: 1,
|
|
150
|
-
maxWidth: 960,
|
|
151
|
-
marginHorizontal: 'auto',
|
|
152
|
-
justifyContent: 'space-between',
|
|
153
|
-
},
|
|
154
35
|
});
|
|
155
|
-
|
|
156
|
-
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
157
|
-
const styles = StyleSheet.create({
|
|
158
|
-
button: {
|
|
159
|
-
alignItems: "center",
|
|
160
|
-
backgroundColor: "#6366F1",
|
|
161
|
-
borderRadius: 24,
|
|
162
|
-
elevation: 5,
|
|
163
|
-
flexDirection: "row",
|
|
164
|
-
justifyContent: "center",
|
|
165
|
-
padding: 16,
|
|
166
|
-
shadowColor: "#000",
|
|
167
|
-
shadowOffset: {
|
|
168
|
-
height: 2,
|
|
169
|
-
width: 0
|
|
170
|
-
},
|
|
171
|
-
shadowOpacity: 0.25,
|
|
172
|
-
shadowRadius: 3.84
|
|
173
|
-
},
|
|
174
|
-
buttonText: {
|
|
175
|
-
color: "#FFFFFF",
|
|
176
|
-
fontSize: 16,
|
|
177
|
-
fontWeight: "600",
|
|
178
|
-
textAlign: "center",
|
|
179
|
-
},
|
|
180
|
-
container: {
|
|
181
|
-
flex: 1,
|
|
182
|
-
padding: 24,
|
|
183
|
-
},
|
|
184
|
-
main: {
|
|
185
|
-
flex: 1,
|
|
186
|
-
maxWidth: 960,
|
|
187
|
-
marginHorizontal: "auto",
|
|
188
|
-
justifyContent: "space-between",
|
|
189
|
-
},
|
|
190
|
-
title: {
|
|
191
|
-
fontSize: 64,
|
|
192
|
-
fontWeight: "bold",
|
|
193
|
-
},
|
|
194
|
-
subtitle: {
|
|
195
|
-
color: "#38434D",
|
|
196
|
-
fontSize: 36,
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
<% } %>
|
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
import FontAwesome from "@expo/vector-icons/FontAwesome";
|
|
2
1
|
import { Link, Tabs } from "expo-router";
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
<% } else { %>
|
|
7
|
-
import { Pressable, StyleSheet } from "react-native";
|
|
8
|
-
<% } %>
|
|
2
|
+
import { HeaderButton } from '../../components/HeaderButton';
|
|
3
|
+
import { TabBarIcon } from '../../components/TabBarIcon';
|
|
4
|
+
|
|
9
5
|
|
|
10
|
-
function TabBarIcon(props: {
|
|
11
|
-
name: React.ComponentProps<typeof FontAwesome>["name"];
|
|
12
|
-
color: string;
|
|
13
|
-
}) {
|
|
14
|
-
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
15
|
-
const {styles} = useStyles(stylesheet)
|
|
16
|
-
<% } %>
|
|
17
|
-
return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
|
|
18
|
-
}
|
|
19
6
|
|
|
20
7
|
export default function TabLayout() {
|
|
21
|
-
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
22
|
-
const { styles } = useStyles(stylesheet)
|
|
23
|
-
<% } %>
|
|
24
8
|
return (
|
|
25
9
|
<Tabs
|
|
26
10
|
screenOptions={{
|
|
@@ -30,19 +14,10 @@ export default function TabLayout() {
|
|
|
30
14
|
name='index'
|
|
31
15
|
options={{
|
|
32
16
|
title: 'Tab One',
|
|
33
|
-
tabBarIcon: ({ color }) => <TabBarIcon name=
|
|
17
|
+
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
|
|
34
18
|
headerRight: () => (
|
|
35
19
|
<Link href='/modal' asChild>
|
|
36
|
-
|
|
37
|
-
{({ pressed }) => (
|
|
38
|
-
<FontAwesome
|
|
39
|
-
name='info-circle'
|
|
40
|
-
size={25}
|
|
41
|
-
color='gray'
|
|
42
|
-
style={[styles.headerRight, { opacity: pressed ? 0.5 : 1 }]}
|
|
43
|
-
/>
|
|
44
|
-
)}
|
|
45
|
-
</Pressable>
|
|
20
|
+
<HeaderButton />
|
|
46
21
|
</Link>
|
|
47
22
|
),
|
|
48
23
|
}}
|
|
@@ -50,7 +25,7 @@ export default function TabLayout() {
|
|
|
50
25
|
<Tabs.Screen
|
|
51
26
|
name="two"
|
|
52
27
|
options={{
|
|
53
|
-
title:
|
|
28
|
+
title: 'Tab Two',
|
|
54
29
|
tabBarIcon: ({ color }) => <TabBarIcon name="code" color={color} />,
|
|
55
30
|
}}
|
|
56
31
|
/>
|
|
@@ -58,22 +33,3 @@ export default function TabLayout() {
|
|
|
58
33
|
);
|
|
59
34
|
}
|
|
60
35
|
|
|
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 { %>
|
|
71
|
-
const styles = StyleSheet.create({
|
|
72
|
-
headerRight: {
|
|
73
|
-
marginRight: 15
|
|
74
|
-
},
|
|
75
|
-
tabBarIcon: {
|
|
76
|
-
marginBottom: -3
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
<% } %>
|
|
@@ -1,88 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 { %>
|
|
11
|
-
import { StyleSheet, Text, View } from "react-native";
|
|
12
|
-
<% } %>
|
|
1
|
+
import { Stack } from 'expo-router';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
13
3
|
|
|
14
|
-
import
|
|
4
|
+
import { ScreenContent } from '~/components/ScreenContent';
|
|
15
5
|
|
|
16
|
-
export default function
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</View>
|
|
26
|
-
);
|
|
27
|
-
<% } else if (props.stylingPackage?.name === "nativewind") { %>
|
|
28
|
-
return (
|
|
29
|
-
<View className={styles.container}>
|
|
30
|
-
<Text className={styles.title}>Tab One</Text>
|
|
31
|
-
<View className={styles.separator} />
|
|
32
|
-
<EditScreenInfo path="app/(tabs)/index.tsx" />
|
|
33
|
-
</View>
|
|
34
|
-
);
|
|
35
|
-
<% } else if (props.stylingPackage?.name === "tamagui") { %>
|
|
36
|
-
return (
|
|
37
|
-
<Theme name="light">
|
|
38
|
-
<YStack flex={1} alignItems="center" justifyContent="center">
|
|
39
|
-
<H2>Tab One</H2>
|
|
40
|
-
<Separator />
|
|
41
|
-
<EditScreenInfo path="app/(tabs)/index.tsx" />
|
|
42
|
-
</YStack>
|
|
43
|
-
</Theme>
|
|
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
|
-
);
|
|
53
|
-
<% } else { %>
|
|
54
|
-
return (
|
|
55
|
-
<View style={styles.container}>
|
|
56
|
-
<Text style={styles.title}>Tab One</Text>
|
|
57
|
-
<View style={styles.separator} />
|
|
58
|
-
<EditScreenInfo path="app/(tabs)/index.tsx" />
|
|
59
|
-
</View>
|
|
60
|
-
);
|
|
61
|
-
<% } %>
|
|
6
|
+
export default function Home() {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<Stack.Screen options={{ title: 'Tab One' }} />
|
|
10
|
+
<View style={styles.container}>
|
|
11
|
+
<ScreenContent path="app/(tabs)/index.tsx" title="Tab One" />
|
|
12
|
+
</View>
|
|
13
|
+
</>
|
|
14
|
+
);
|
|
62
15
|
}
|
|
63
16
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
71
|
-
const styles = StyleSheet.create({
|
|
72
|
-
container: {
|
|
73
|
-
alignItems: "center",
|
|
74
|
-
flex: 1,
|
|
75
|
-
justifyContent: "center",
|
|
76
|
-
},
|
|
77
|
-
separator: {
|
|
78
|
-
backgroundColor: '#d1d5db',
|
|
79
|
-
height: 1,
|
|
80
|
-
marginVertical: 30,
|
|
81
|
-
width: "80%",
|
|
82
|
-
},
|
|
83
|
-
title: {
|
|
84
|
-
fontSize: 20,
|
|
85
|
-
fontWeight: "bold",
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
<% } %>
|
|
17
|
+
const styles = StyleSheet.create({
|
|
18
|
+
container: {
|
|
19
|
+
flex: 1,
|
|
20
|
+
padding: 24,
|
|
21
|
+
},
|
|
22
|
+
});
|