create-expo-stack 2.4.3-next.e841ea5 → 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 +21 -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 +1 -1
- 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,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "<%= props.projectName %>",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
+
<% if (props.navigationPackage?.name === "expo-router") { %>
|
|
5
|
+
"main": "expo-router/entry",
|
|
6
|
+
<% } %>
|
|
4
7
|
"scripts": {
|
|
5
8
|
"android": "expo start --android",
|
|
6
9
|
<% if (props.packageManager === "bun") { %>
|
|
7
|
-
"format": "
|
|
10
|
+
"format": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix && prettier \"**/*.{js,jsx,ts,tsx,json}\" --write",
|
|
8
11
|
<% } else { %>
|
|
9
12
|
"format": "eslint \"**/*.{js,jsx,ts,tsx}\" --fix && prettier \"**/*.{js,jsx,ts,tsx,json}\" --write",
|
|
10
13
|
<% } %>
|
|
@@ -66,13 +69,13 @@
|
|
|
66
69
|
<% if (props.navigationPackage?.name === "expo-router") { %>
|
|
67
70
|
"@expo/vector-icons": "^14.0.0",
|
|
68
71
|
"expo-linking": "~6.2.2",
|
|
69
|
-
"expo-router": "^3.4.
|
|
72
|
+
"expo-router": "^3.4.7",
|
|
70
73
|
"expo-constants": "~15.4.5",
|
|
71
74
|
"expo-system-ui": "~2.9.3",
|
|
72
75
|
"expo-web-browser": "~12.8.2",
|
|
73
76
|
"react-dom": "18.2.0",
|
|
74
77
|
"react-native-reanimated": "~3.6.2",
|
|
75
|
-
"react-native-web": "~0.19.
|
|
78
|
+
"react-native-web": "~0.19.10",
|
|
76
79
|
<% } %>
|
|
77
80
|
|
|
78
81
|
<% if (props.authenticationPackage?.name === "supabase") { %>
|
|
@@ -85,27 +88,38 @@
|
|
|
85
88
|
"firebase": "^10.5.2",
|
|
86
89
|
"react-native-url-polyfill": "^2.0.0",
|
|
87
90
|
<% } %>
|
|
91
|
+
|
|
92
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
93
|
+
"i18next": "^23.7.20",
|
|
94
|
+
"react-i18next": "^14.0.1",
|
|
95
|
+
"expo-localization": "~14.8.3",
|
|
96
|
+
<% } %>
|
|
88
97
|
|
|
89
|
-
"expo": "~50.0.
|
|
98
|
+
"expo": "~50.0.7",
|
|
90
99
|
"expo-status-bar": "~1.11.1",
|
|
91
100
|
"react": "18.2.0",
|
|
92
|
-
"react-native": "0.73.
|
|
101
|
+
"react-native": "0.73.6"
|
|
93
102
|
},
|
|
94
103
|
"devDependencies": {
|
|
104
|
+
<%# patch for this issue : https://github.com/expo/expo/issues/26641 %>
|
|
105
|
+
<% if (props.packageManager === "bun" && props.navigationPackage?.name === "expo-router") { %>
|
|
106
|
+
"ajv": "^8.12.0",
|
|
107
|
+
<% } %>
|
|
95
108
|
"@babel/core": "^7.20.0",
|
|
96
109
|
"@types/react": "~18.2.14",
|
|
97
110
|
"@typescript-eslint/eslint-plugin": "^6.7.2",
|
|
98
111
|
"@typescript-eslint/parser": "^6.7.2",
|
|
99
112
|
"eslint": "^8.50.0",
|
|
100
113
|
"eslint-config-universe": "^12.0.0",
|
|
101
|
-
"prettier": "^3.
|
|
114
|
+
"prettier": "^3.2.5",
|
|
102
115
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
103
116
|
"tailwindcss": "^3.4.0",
|
|
117
|
+
"prettier-plugin-tailwindcss": "^0.5.11",
|
|
104
118
|
<% } %>
|
|
105
119
|
<% if (props.stylingPackage?.name === "tamagui") { %>
|
|
106
120
|
"@tamagui/babel-plugin": "1.74.8",
|
|
107
121
|
<% } %>
|
|
108
|
-
"typescript": "^5.
|
|
122
|
+
"typescript": "^5.3.3"
|
|
109
123
|
},
|
|
110
124
|
"eslintConfig": {
|
|
111
125
|
"extends": "universe/native"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
printWidth: 100,
|
|
3
|
+
tabWidth: 2,
|
|
4
|
+
singleQuote: true,
|
|
5
|
+
bracketSameLine: true,
|
|
6
|
+
trailingComma: 'es5',
|
|
7
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
8
|
+
plugins: [require.resolve("prettier-plugin-tailwindcss")],
|
|
9
|
+
tailwindAttributes: ["className"],
|
|
10
|
+
<% } %>
|
|
11
|
+
};
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import FontAwesome from '@expo/vector-icons/FontAwesome';
|
|
2
1
|
import { Tabs } from 'expo-router';
|
|
3
2
|
import { StyleSheet } from 'react-native';
|
|
3
|
+
import { TabBarIcon } from '~/components/TabBarIcon';
|
|
4
4
|
|
|
5
|
-
function TabBarIcon(props: {
|
|
6
|
-
name: React.ComponentProps<typeof FontAwesome>['name'];
|
|
7
|
-
color: string;
|
|
8
|
-
}) {
|
|
9
|
-
return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
|
|
10
|
-
}
|
|
11
5
|
|
|
12
6
|
export default function TabLayout() {
|
|
13
7
|
return (
|
|
@@ -33,9 +27,3 @@ export default function TabLayout() {
|
|
|
33
27
|
</Tabs>
|
|
34
28
|
);
|
|
35
29
|
}
|
|
36
|
-
|
|
37
|
-
const styles = StyleSheet.create({
|
|
38
|
-
tabBarIcon: {
|
|
39
|
-
marginBottom: -3,
|
|
40
|
-
},
|
|
41
|
-
});
|
|
@@ -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/(drawer)/(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/(drawer)/(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/(drawer)/(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/(drawer)/(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/(drawer)/(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
|
+
});
|
|
@@ -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 Two</Text>
|
|
31
|
-
<View className={styles.separator} />
|
|
32
|
-
<EditScreenInfo path='app/(drawer)/(tabs)/two.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 Two</H2>
|
|
40
|
-
<Separator />
|
|
41
|
-
<EditScreenInfo path='app/(drawer)/(tabs)/two.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 Two</Text>
|
|
49
|
-
<Box height={1} marginVertical='l_32' width='80%' />
|
|
50
|
-
<EditScreenInfo path='app/(drawer)/(tabs)/two.tsx' />
|
|
51
|
-
</Box>
|
|
52
|
-
);
|
|
53
|
-
<% } else { %>
|
|
54
|
-
return (
|
|
55
|
-
<View style={styles.container}>
|
|
56
|
-
<Text style={styles.title}>Tab Two</Text>
|
|
57
|
-
<View style={styles.separator} />
|
|
58
|
-
<EditScreenInfo path='app/(drawer)/(tabs)/two.tsx' />
|
|
59
|
-
</View>
|
|
60
|
-
);
|
|
61
|
-
<% } %>
|
|
6
|
+
export default function Home() {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<Stack.Screen options={{ title: 'Tab Two' }} />
|
|
10
|
+
<View style={styles.container}>
|
|
11
|
+
<ScreenContent path="app/(drawer)/(tabs)/two.tsx" title="Tab Two" />
|
|
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
|
+
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ionicons, MaterialIcons } from '@expo/vector-icons';
|
|
2
2
|
import { Link } from 'expo-router';
|
|
3
3
|
import { Drawer } from 'expo-router/drawer';
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
import { HeaderButton } from '../../components/HeaderButton';
|
|
5
6
|
|
|
6
7
|
const DrawerLayout = () => (
|
|
7
8
|
<Drawer>
|
|
@@ -23,16 +24,7 @@ const DrawerLayout = () => (
|
|
|
23
24
|
),
|
|
24
25
|
headerRight: () => (
|
|
25
26
|
<Link href="/modal" asChild>
|
|
26
|
-
<
|
|
27
|
-
{({ pressed }) => (
|
|
28
|
-
<FontAwesome
|
|
29
|
-
name="info-circle"
|
|
30
|
-
size={25}
|
|
31
|
-
color="gray"
|
|
32
|
-
style={[styles.headerRight, { opacity: pressed ? 0.5 : 1 }]}
|
|
33
|
-
/>
|
|
34
|
-
)}
|
|
35
|
-
</Pressable>
|
|
27
|
+
<HeaderButton />
|
|
36
28
|
</Link>
|
|
37
29
|
),
|
|
38
30
|
}}
|
|
@@ -40,10 +32,4 @@ const DrawerLayout = () => (
|
|
|
40
32
|
</Drawer>
|
|
41
33
|
);
|
|
42
34
|
|
|
43
|
-
const styles = StyleSheet.create({
|
|
44
|
-
headerRight: {
|
|
45
|
-
marginRight: 15,
|
|
46
|
-
},
|
|
47
|
-
});
|
|
48
|
-
|
|
49
35
|
export default DrawerLayout;
|
|
@@ -1,90 +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 if (props.stylingPackage?.name === "stylesheet") { %>
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<Text style={theme.components.title}>Home</Text>
|
|
23
|
-
<View style={theme.components.separator} />
|
|
24
|
-
<EditScreenInfo path="app/(tabs)/index.tsx" />
|
|
6
|
+
export default function Home() {
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<Stack.Screen options={{ title: 'Home' }} />
|
|
10
|
+
<View style={styles.container}>
|
|
11
|
+
<ScreenContent path="app/(drawer)/(tabs)/index.tsx" title="Home" />
|
|
25
12
|
</View>
|
|
26
|
-
|
|
27
|
-
<% } else if (props.stylingPackage?.name === "nativewind") { %>
|
|
28
|
-
return (
|
|
29
|
-
<View className={styles.container}>
|
|
30
|
-
<Text className={styles.title}>Home</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>Home</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">Home</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}>Home</Text>
|
|
57
|
-
<View style={styles.separator} />
|
|
58
|
-
<EditScreenInfo path="app/(tabs)/index.tsx" />
|
|
59
|
-
</View>
|
|
13
|
+
</>
|
|
60
14
|
);
|
|
61
|
-
<% } %>
|
|
62
15
|
}
|
|
63
16
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
67
|
-
const styles = {
|
|
68
|
-
container: `items-center flex-1 justify-center`,
|
|
69
|
-
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
70
|
-
title: `text-xl font-bold`
|
|
71
|
-
};
|
|
72
|
-
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
73
|
-
const styles = StyleSheet.create({
|
|
17
|
+
const styles = StyleSheet.create({
|
|
74
18
|
container: {
|
|
75
|
-
alignItems: "center",
|
|
76
19
|
flex: 1,
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
separator: {
|
|
80
|
-
backgroundColor: '#d1d5db',
|
|
81
|
-
height: 1,
|
|
82
|
-
marginVertical: 30,
|
|
83
|
-
width: "80%",
|
|
20
|
+
padding: 24,
|
|
84
21
|
},
|
|
85
|
-
title: {
|
|
86
|
-
fontSize: 20,
|
|
87
|
-
fontWeight: "bold",
|
|
88
|
-
}
|
|
89
22
|
});
|
|
90
|
-
<% } %>
|
|
@@ -5,6 +5,10 @@ import '../global.css';
|
|
|
5
5
|
import '../unistyles';
|
|
6
6
|
<% } %>
|
|
7
7
|
|
|
8
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
9
|
+
import '../translation';
|
|
10
|
+
<% } %>
|
|
11
|
+
|
|
8
12
|
import 'react-native-gesture-handler';
|
|
9
13
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
10
14
|
import { Stack } from 'expo-router';
|
|
@@ -1,96 +1,20 @@
|
|
|
1
|
-
|
|
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
|
-
<% } %>
|
|
1
|
+
import { ScreenContent } from 'components/ScreenContent';
|
|
15
2
|
import { StatusBar } from 'expo-status-bar';
|
|
3
|
+
import { Platform } from 'react-native';
|
|
16
4
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<% if (props.stylingPackage?.name === 'unistyles') { %>
|
|
21
|
-
const { theme } = useStyles()
|
|
5
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
6
|
+
import { InternalizationExample } from 'components/InternalizationExample';
|
|
7
|
+
<% } %>
|
|
22
8
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
<% } %>
|
|
9
|
+
export default function Modal() {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<ScreenContent path="app/modal.tsx" title="Modal">
|
|
13
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
14
|
+
<InternalizationExample />
|
|
15
|
+
<% } %>
|
|
16
|
+
</ScreenContent>
|
|
17
|
+
<StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
|
|
18
|
+
</>
|
|
19
|
+
);
|
|
70
20
|
}
|
|
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
|
-
<% } %>
|
|
@@ -4,6 +4,9 @@ import '../global.css';
|
|
|
4
4
|
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
5
5
|
import '../unistyles';
|
|
6
6
|
<% } %>
|
|
7
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
8
|
+
import '../translation';
|
|
9
|
+
<% } %>
|
|
7
10
|
|
|
8
11
|
<% if (props.stylingPackage?.name === "tamagui") { %>
|
|
9
12
|
import { useFonts } from 'expo-font';
|