create-expo-stack 2.21.0-next.7a731e6 → 2.21.1
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 +17 -17
- package/build/templates/base/App.tsx.ejs +9 -1
- package/build/templates/base/babel.config.js.ejs +8 -1
- package/build/templates/base/components/EditScreenInfo.tsx.ejs +0 -11
- package/build/templates/base/package.json.ejs +3 -21
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +1 -1
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/index.tsx.ejs +2 -2
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/two.tsx.ejs +2 -2
- package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +2 -2
- package/build/templates/packages/expo-router/drawer/app/+not-found.tsx.ejs +3 -3
- package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +7 -0
- package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +1 -1
- package/build/templates/packages/expo-router/metro.config.js.ejs +3 -3
- package/build/templates/packages/expo-router/stack/app/+not-found.tsx.ejs +7 -13
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +4 -4
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +13 -12
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +17 -42
- package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +1 -1
- package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +1 -1
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +7 -0
- package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +1 -1
- package/build/templates/packages/firebase/metro.config.js.ejs +3 -3
- package/build/templates/packages/nativewind/components/BackButton.tsx.ejs +5 -1
- package/build/templates/packages/nativewind/components/Button.tsx.ejs +3 -3
- package/build/templates/packages/nativewind/components/Container.tsx.ejs +13 -0
- package/build/templates/packages/nativewind/components/EditScreenInfo.tsx.ejs +5 -5
- package/build/templates/packages/nativewind/components/ScreenContent.tsx.ejs +5 -5
- package/build/templates/packages/nativewind/global.css +3 -5
- package/build/templates/packages/nativewind/metro.config.js +3 -4
- package/build/templates/packages/nativewind/nativewind-env.d.ts +1 -3
- package/build/templates/packages/nativewind/tailwind.config.js.ejs +15 -0
- package/build/templates/packages/nativewindui/components/EditScreenInfo.tsx.ejs +0 -11
- package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +1 -1
- package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/index.tsx.ejs +2 -2
- package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/two.tsx.ejs +2 -2
- package/build/templates/packages/nativewindui/drawer/app/_layout.tsx.ejs +1 -1
- package/build/templates/packages/nativewindui/tabs/app/(tabs)/index.tsx.ejs +12 -12
- package/build/templates/packages/nativewindui/tabs/app/(tabs)/two.tsx.ejs +1 -1
- package/build/templates/packages/nativewindui/tabs/app/_layout.tsx.ejs +4 -4
- package/build/templates/packages/nativewindui/tabs/app/modal.tsx.ejs +1 -1
- package/build/templates/packages/react-navigation/App.tsx.ejs +11 -1
- package/build/templates/packages/unistyles/components/EditScreenInfo.tsx.ejs +0 -11
- package/build/types/utilities/validateProjectName.d.ts +2 -1
- package/build/utilities/configureProjectFiles.js +7 -10
- package/build/utilities/runCLI.js +14 -8
- package/build/utilities/showHelp.js +2 -2
- package/build/utilities/validateProjectName.js +1 -1
- package/package.json +74 -73
- package/build/templates/packages/nativewind/postcss.config.mjs +0 -5
- package/build/templates/packages/nativewind/prettier.config.js +0 -10
package/README.md
CHANGED
|
@@ -59,24 +59,24 @@ Each project is generated based on the results of the CLI, on a per-file basis.
|
|
|
59
59
|
|
|
60
60
|
| Library | Category | Version | Description |
|
|
61
61
|
| ------------------ | ------------------- | ------- | ---------------------------------------------- |
|
|
62
|
-
| React Native | Mobile Framework | v0.
|
|
63
|
-
| React | UI Framework | v19
|
|
64
|
-
| TypeScript | Language | v5
|
|
65
|
-
| React Navigation | Navigation | v7
|
|
66
|
-
| Expo | SDK |
|
|
67
|
-
| Expo
|
|
68
|
-
| Expo
|
|
69
|
-
| Expo
|
|
70
|
-
| Expo
|
|
71
|
-
| Expo
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
62
|
+
| React Native | Mobile Framework | v0.79 | The best cross-platform mobile framework |
|
|
63
|
+
| React | UI Framework | v19 | The most popular UI framework in the world |
|
|
64
|
+
| TypeScript | Language | v5 | Static typechecking |
|
|
65
|
+
| React Navigation | Navigation | v7 | Performant and consistent navigation framework |
|
|
66
|
+
| Expo | SDK | v53 | Allows (optional) Expo modules |
|
|
67
|
+
| Expo Font | Custom Fonts | v13 | Import custom fonts |
|
|
68
|
+
| Expo Linking | URL Handling | v7 | Open your app via a URL |
|
|
69
|
+
| Expo Router | Navigation | v5 | File-based routing in React-Native |
|
|
70
|
+
| Expo Splash Screen | Splash Screen | v0.27 | Custom splash screen |
|
|
71
|
+
| Expo Status Bar | Status Bar Library | v2 | Status bar support |
|
|
72
|
+
| Expo System UI | System UI Library | v5 | System UI support |
|
|
73
|
+
| Expo Web Browser | Web Browser Library | v14 | Open links in the browser |
|
|
74
|
+
| NativeWind | UI Framework | v4.1 | Tailwind CSS for React Native |
|
|
75
75
|
| Unistyles | UI Framework | v3 | Superset of StyleSheet |
|
|
76
|
-
| Safe Area Context | Safe Area Library | v5
|
|
77
|
-
| React Native Web | Web Support | v0.
|
|
78
|
-
| Firebase | Backend and Auth | v10
|
|
79
|
-
| Supabase | Backend and Auth | v2
|
|
76
|
+
| Safe Area Context | Safe Area Library | v5 | Safe area support |
|
|
77
|
+
| React Native Web | Web Support | v0.20 | React Native for Web |
|
|
78
|
+
| Firebase | Backend and Auth | v10 | Cloud-hosted NoSQL database from Google |
|
|
79
|
+
| Supabase | Backend and Auth | v2 | Open source Firebase alternative |
|
|
80
80
|
|
|
81
81
|
## Reporting Bugs & Feedback
|
|
82
82
|
|
|
@@ -11,6 +11,7 @@ import { StatusBar } from 'expo-status-bar';
|
|
|
11
11
|
|
|
12
12
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
13
13
|
import './global.css';
|
|
14
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
14
15
|
<% } else if (props.stylingPackage?.name === "nativewinui") { %>
|
|
15
16
|
import './global.css';
|
|
16
17
|
import 'expo-dev-client';
|
|
@@ -24,14 +25,21 @@ import { StatusBar } from 'expo-status-bar';
|
|
|
24
25
|
|
|
25
26
|
export default function App() {
|
|
26
27
|
return (
|
|
28
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
29
|
+
<SafeAreaProvider>
|
|
30
|
+
<% } else { %>
|
|
27
31
|
<>
|
|
32
|
+
<% } %>
|
|
28
33
|
<ScreenContent title="Home" path="App.tsx">
|
|
29
34
|
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
30
35
|
<InternalizationExample />
|
|
31
36
|
<% } %>
|
|
32
37
|
</ScreenContent>
|
|
33
38
|
<StatusBar style="auto" />
|
|
39
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
40
|
+
</SafeAreaProvider>
|
|
41
|
+
<% } else { %>
|
|
34
42
|
</>
|
|
43
|
+
<% } %>
|
|
35
44
|
);
|
|
36
45
|
}
|
|
37
|
-
|
|
@@ -15,7 +15,14 @@ module.exports = function(api) {
|
|
|
15
15
|
plugins.push('react-native-worklets/plugin');
|
|
16
16
|
|
|
17
17
|
return {
|
|
18
|
-
|
|
18
|
+
<% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "nativewindui") { %>
|
|
19
|
+
presets: [
|
|
20
|
+
['babel-preset-expo', { jsxImportSource: 'nativewind' }],
|
|
21
|
+
'nativewind/babel',
|
|
22
|
+
],
|
|
23
|
+
<% } else { %>
|
|
24
|
+
presets: ['babel-preset-expo'],
|
|
25
|
+
<% } %>
|
|
19
26
|
plugins,
|
|
20
27
|
};
|
|
21
28
|
};
|
|
@@ -38,17 +38,6 @@ const styles = StyleSheet.create({
|
|
|
38
38
|
lineHeight: 24,
|
|
39
39
|
textAlign: 'center',
|
|
40
40
|
},
|
|
41
|
-
helpContainer: {
|
|
42
|
-
alignItems: 'center',
|
|
43
|
-
marginHorizontal: 20,
|
|
44
|
-
marginTop: 15,
|
|
45
|
-
},
|
|
46
|
-
helpLink: {
|
|
47
|
-
paddingVertical: 15,
|
|
48
|
-
},
|
|
49
|
-
helpLinkText: {
|
|
50
|
-
textAlign: 'center',
|
|
51
|
-
},
|
|
52
41
|
homeScreenFilename: {
|
|
53
42
|
marginVertical: 7,
|
|
54
43
|
},
|
|
@@ -31,10 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
<% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "nativewindui") { %>
|
|
34
|
-
"nativewind": "
|
|
35
|
-
"react-native-css": "latest",
|
|
36
|
-
"postcss": "^8.5.6",
|
|
37
|
-
"@tailwindcss/postcss": "^4.1.13",
|
|
34
|
+
"nativewind": "latest",
|
|
38
35
|
<% } %>
|
|
39
36
|
<% if (props.stylingPackage?.name === "nativewindui") { %>
|
|
40
37
|
"@shopify/flash-list": "2.0.2",
|
|
@@ -146,8 +143,8 @@
|
|
|
146
143
|
"eslint-config-prettier": "^10.1.2",
|
|
147
144
|
"prettier": "^3.2.5",
|
|
148
145
|
<% if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "nativewindui") { %>
|
|
149
|
-
"tailwindcss": "^4.
|
|
150
|
-
"prettier-plugin-tailwindcss": "^0.
|
|
146
|
+
"tailwindcss": "^3.4.0",
|
|
147
|
+
"prettier-plugin-tailwindcss": "^0.5.11",
|
|
151
148
|
<% } %>
|
|
152
149
|
"typescript": "~5.9.2"
|
|
153
150
|
},
|
|
@@ -157,20 +154,5 @@
|
|
|
157
154
|
<% if (props.packageManager === "yarn"){ %>
|
|
158
155
|
"packageManager": "yarn@4.9.4",
|
|
159
156
|
<% } %>
|
|
160
|
-
<% if (props.stylingPackage?.name === "nativewind" && props.packageManager === "yarn") { %>
|
|
161
|
-
"resolutions": {
|
|
162
|
-
"lightningcss": "1.30.1"
|
|
163
|
-
},
|
|
164
|
-
<% } else if (props.stylingPackage?.name === "nativewind" && props.packageManager === "pnpm") { %>
|
|
165
|
-
"pnpm": {
|
|
166
|
-
"overrides": {
|
|
167
|
-
"lightningcss": "1.30.1"
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
<% } else if (props.stylingPackage?.name === "nativewind") { %>
|
|
171
|
-
"overrides": {
|
|
172
|
-
"lightningcss": "1.30.1"
|
|
173
|
-
},
|
|
174
|
-
<% } %>
|
|
175
157
|
"private": true
|
|
176
158
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tabs } from 'expo-router';
|
|
2
|
-
import { TabBarIcon } from '
|
|
2
|
+
import { TabBarIcon } from '@/components/TabBarIcon';
|
|
3
3
|
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
4
4
|
import { useUnistyles } from "react-native-unistyles";
|
|
5
5
|
<% } %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Stack } from 'expo-router';
|
|
2
2
|
|
|
3
|
-
import { Container } from '
|
|
4
|
-
import { ScreenContent } from '
|
|
3
|
+
import { Container } from '@/components/Container';
|
|
4
|
+
import { ScreenContent } from '@/components/ScreenContent';
|
|
5
5
|
|
|
6
6
|
export default function Home() {
|
|
7
7
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Stack } from 'expo-router';
|
|
2
2
|
|
|
3
|
-
import { Container } from '
|
|
4
|
-
import { ScreenContent } from '
|
|
3
|
+
import { Container } from '@/components/Container';
|
|
4
|
+
import { ScreenContent } from '@/components/ScreenContent';
|
|
5
5
|
|
|
6
6
|
export default function Home() {
|
|
7
7
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Stack } from 'expo-router';
|
|
2
2
|
|
|
3
|
-
import { Container } from '
|
|
4
|
-
import { ScreenContent } from '
|
|
3
|
+
import { Container } from '@/components/Container';
|
|
4
|
+
import { ScreenContent } from '@/components/ScreenContent';
|
|
5
5
|
|
|
6
6
|
export default function Home() {
|
|
7
7
|
return (
|
|
@@ -2,16 +2,16 @@ import { Link, Stack } from 'expo-router';
|
|
|
2
2
|
<% if (props.stylingPackage?.name === "nativewind") {%>
|
|
3
3
|
import { Text } from 'react-native';
|
|
4
4
|
|
|
5
|
-
import { Container } from '
|
|
5
|
+
import { Container } from '@/components/Container';
|
|
6
6
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
7
7
|
import { StyleSheet } from 'react-native-unistyles'
|
|
8
8
|
import { Text } from 'react-native';
|
|
9
9
|
|
|
10
|
-
import { Container } from '
|
|
10
|
+
import { Container } from '@/components/Container';
|
|
11
11
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
12
12
|
import { StyleSheet, Text } from 'react-native';
|
|
13
13
|
|
|
14
|
-
import { Container } from '
|
|
14
|
+
import { Container } from '@/components/Container';
|
|
15
15
|
<% } %>
|
|
16
16
|
|
|
17
17
|
export default function NotFoundScreen() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
2
2
|
import '../global.css';
|
|
3
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
3
4
|
<% } else if (props.stylingPackage?.name === "nativewinui") { %>
|
|
4
5
|
import '../global.css';
|
|
5
6
|
import 'expo-dev-client';
|
|
@@ -35,6 +36,9 @@ export default function RootLayout() {
|
|
|
35
36
|
|
|
36
37
|
return (
|
|
37
38
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
39
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
40
|
+
<SafeAreaProvider>
|
|
41
|
+
<% } %>
|
|
38
42
|
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
39
43
|
<Stack
|
|
40
44
|
screenOptions={{
|
|
@@ -60,6 +64,9 @@ export default function RootLayout() {
|
|
|
60
64
|
<Stack.Screen name="(drawer)" options={{ headerShown: false }} />
|
|
61
65
|
<Stack.Screen name="modal" options={{ title: 'Modal', presentation: 'modal' }} />
|
|
62
66
|
</Stack>
|
|
67
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
68
|
+
</SafeAreaProvider>
|
|
69
|
+
<% } %>
|
|
63
70
|
</GestureHandlerRootView>
|
|
64
71
|
);
|
|
65
72
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StatusBar } from 'expo-status-bar';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { ScreenContent } from '
|
|
4
|
+
import { ScreenContent } from '@/components/ScreenContent';
|
|
5
5
|
|
|
6
6
|
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
7
7
|
import { InternalizationExample } from 'components/InternalizationExample';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Learn more https://docs.expo.io/guides/customizing-metro
|
|
2
2
|
const { getDefaultConfig } = require('expo/metro-config');
|
|
3
3
|
<% if (["nativewind", "nativewindui"].includes(props.stylingPackage?.name)) { %>
|
|
4
|
-
const {
|
|
4
|
+
const { withNativeWind } = require("nativewind/metro");
|
|
5
5
|
<% } %>
|
|
6
6
|
|
|
7
7
|
/** @type {import('expo/metro-config').MetroConfig} */
|
|
@@ -9,9 +9,9 @@ const { getDefaultConfig } = require('expo/metro-config');
|
|
|
9
9
|
const config = getDefaultConfig(__dirname);
|
|
10
10
|
|
|
11
11
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
12
|
-
module.exports =
|
|
12
|
+
module.exports = withNativeWind(config, { input: "./global.css" });
|
|
13
13
|
<% } else if (props.stylingPackage?.name === "nativewindui") { %>
|
|
14
|
-
module.exports =
|
|
14
|
+
module.exports = withNativeWind(config, { input: "./global.css", inlineRem: 16 });
|
|
15
15
|
<% } else { %>
|
|
16
16
|
module.exports = config;
|
|
17
17
|
<% } %>
|
|
@@ -2,13 +2,16 @@ import { Link, Stack } from 'expo-router';
|
|
|
2
2
|
<% if (props.stylingPackage?.name === "nativewind") {%>
|
|
3
3
|
import { Text, View } from 'react-native';
|
|
4
4
|
|
|
5
|
+
import { Container } from '@/components/Container';
|
|
5
6
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
6
7
|
import { StyleSheet } from 'react-native-unistyles'
|
|
7
8
|
import { Text, View } from 'react-native';
|
|
8
9
|
|
|
10
|
+
import { Container } from '@/components/Container';
|
|
9
11
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
10
12
|
import { StyleSheet, Text, View } from 'react-native';
|
|
11
13
|
|
|
14
|
+
import { Container } from '@/components/Container';
|
|
12
15
|
<% } %>
|
|
13
16
|
|
|
14
17
|
export default function NotFoundScreen() {
|
|
@@ -17,22 +20,22 @@ export default function NotFoundScreen() {
|
|
|
17
20
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
18
21
|
<View className={styles.container}>
|
|
19
22
|
<Stack.Screen options={{ title: "Oops!" }} />
|
|
20
|
-
<
|
|
23
|
+
<Container>
|
|
21
24
|
<Text className={styles.title}>{"This screen doesn't exist."}</Text>
|
|
22
25
|
<Link href="/" className={styles.link}>
|
|
23
26
|
<Text className={styles.linkText}>Go to home screen!</Text>
|
|
24
27
|
</Link>
|
|
25
|
-
</
|
|
28
|
+
</Container>
|
|
26
29
|
</View>
|
|
27
30
|
<% } else { %>
|
|
28
31
|
<View style={styles.container}>
|
|
29
32
|
<Stack.Screen options={{ title: "Oops!" }} />
|
|
30
|
-
<
|
|
33
|
+
<Container>
|
|
31
34
|
<Text style={styles.title}>{"This screen doesn't exist."}</Text>
|
|
32
35
|
<Link href="/" style={styles.link}>
|
|
33
36
|
<Text style={styles.linkText}>Go to home screen!</Text>
|
|
34
37
|
</Link>
|
|
35
|
-
</
|
|
38
|
+
</Container>
|
|
36
39
|
</View>
|
|
37
40
|
<% } %>
|
|
38
41
|
);
|
|
@@ -41,7 +44,6 @@ export default function NotFoundScreen() {
|
|
|
41
44
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
42
45
|
const styles = {
|
|
43
46
|
container: `flex flex-1 bg-white`,
|
|
44
|
-
contentContainer: `flex flex-1 m-6`,
|
|
45
47
|
title: `text-xl font-bold`,
|
|
46
48
|
link: `mt-4 pt-4`,
|
|
47
49
|
linkText: `text-base text-[#2e78b7]`,
|
|
@@ -52,10 +54,6 @@ const styles = StyleSheet.create((theme) => ({
|
|
|
52
54
|
flex: 1,
|
|
53
55
|
backgroundColor: 'white',
|
|
54
56
|
},
|
|
55
|
-
contentContainer: {
|
|
56
|
-
flex: 1,
|
|
57
|
-
margin: 24,
|
|
58
|
-
},
|
|
59
57
|
title: {
|
|
60
58
|
fontSize: 20,
|
|
61
59
|
fontWeight: 'bold',
|
|
@@ -76,10 +74,6 @@ const styles = StyleSheet.create({
|
|
|
76
74
|
flex: 1,
|
|
77
75
|
backgroundColor: 'white',
|
|
78
76
|
},
|
|
79
|
-
contentContainer: {
|
|
80
|
-
flex: 1,
|
|
81
|
-
margin: 24,
|
|
82
|
-
},
|
|
83
77
|
title: {
|
|
84
78
|
fontSize: 20,
|
|
85
79
|
fontWeight: 'bold',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
2
2
|
import '../global.css';
|
|
3
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
3
4
|
<% } %>
|
|
4
5
|
|
|
5
6
|
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
@@ -35,10 +36,9 @@ export default function Layout() {
|
|
|
35
36
|
}}
|
|
36
37
|
/>
|
|
37
38
|
<% } else if (props.stylingPackage?.name === "nativewind") { %>
|
|
38
|
-
<
|
|
39
|
-
<Stack
|
|
40
|
-
|
|
41
|
-
</Stack>
|
|
39
|
+
<SafeAreaProvider>
|
|
40
|
+
<Stack />
|
|
41
|
+
</SafeAreaProvider>
|
|
42
42
|
<% } else { %>
|
|
43
43
|
<Stack />
|
|
44
44
|
<% } %>
|
|
@@ -3,12 +3,12 @@ import { StyleSheet, View } from 'react-native';
|
|
|
3
3
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
4
4
|
import { StyleSheet } from 'react-native-unistyles';
|
|
5
5
|
import { View } from 'react-native';
|
|
6
|
+
<% } else { %>
|
|
7
|
+
import { View } from 'react-native';
|
|
6
8
|
<% } %>
|
|
7
9
|
import { Stack, useLocalSearchParams } from 'expo-router';
|
|
8
10
|
|
|
9
|
-
<% if (props.stylingPackage?.name !== "nativewind") { %>
|
|
10
11
|
import { Container } from '@/components/Container';
|
|
11
|
-
<% } %>
|
|
12
12
|
import { ScreenContent } from '@/components/ScreenContent';
|
|
13
13
|
|
|
14
14
|
export default function Details() {
|
|
@@ -16,22 +16,23 @@ export default function Details() {
|
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
19
|
-
|
|
20
|
-
<Stack.Screen options={{ title: 'Details' }} />
|
|
21
|
-
<ScreenContent path="screens/details.tsx" title={`Showing details for user ${name}`} />
|
|
22
|
-
</>
|
|
19
|
+
<View className={styles.container}>
|
|
23
20
|
<% } else { %>
|
|
24
21
|
<View style={styles.container}>
|
|
25
|
-
<Stack.Screen options={{ title: 'Details' }} />
|
|
26
|
-
<Container>
|
|
27
|
-
<ScreenContent path="screens/details.tsx" title={`Showing details for user ${name}`} />
|
|
28
|
-
</Container>
|
|
29
|
-
</View>
|
|
30
22
|
<% } %>
|
|
23
|
+
<Stack.Screen options={{ title: 'Details' }} />
|
|
24
|
+
<Container>
|
|
25
|
+
<ScreenContent path="screens/details.tsx" title={`Showing details for user ${name}`} />
|
|
26
|
+
</Container>
|
|
27
|
+
</View>
|
|
31
28
|
);
|
|
32
29
|
}
|
|
33
30
|
|
|
34
|
-
<% if (props.stylingPackage?.name === "
|
|
31
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
32
|
+
const styles = {
|
|
33
|
+
container: "flex flex-1 bg-white",
|
|
34
|
+
}
|
|
35
|
+
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
35
36
|
const styles = StyleSheet.create({
|
|
36
37
|
container: {
|
|
37
38
|
flex: 1,
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
+
import { Stack, Link } from 'expo-router';
|
|
1
2
|
<% if (props.stylingPackage?.name === "stylesheet") { %>
|
|
2
3
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import { Stack, Link } from 'expo-router';
|
|
4
4
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
5
5
|
import { StyleSheet } from 'react-native-unistyles';
|
|
6
|
-
import { Stack, Link } from 'expo-router';
|
|
7
6
|
import { View } from 'react-native';
|
|
8
7
|
<% } else { %>
|
|
9
8
|
import { View } from 'react-native';
|
|
10
|
-
import { router } from 'expo-router';
|
|
11
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
12
9
|
<% } %>
|
|
13
10
|
|
|
14
11
|
import { Button } from '@/components/Button';
|
|
15
|
-
<% if (props.stylingPackage?.name !== "nativewind") { %>
|
|
16
12
|
import { Container } from '@/components/Container';
|
|
17
|
-
<% } %>
|
|
18
13
|
import { ScreenContent } from '@/components/ScreenContent';
|
|
19
14
|
|
|
20
15
|
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
@@ -22,54 +17,34 @@ import { ScreenContent } from '@/components/ScreenContent';
|
|
|
22
17
|
<% } %>
|
|
23
18
|
|
|
24
19
|
export default function Home() {
|
|
25
|
-
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
26
|
-
const insets = useSafeAreaInsets();
|
|
27
|
-
<% } %>
|
|
28
20
|
return (
|
|
29
21
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
30
|
-
<View className=
|
|
31
|
-
|
|
22
|
+
<View className={styles.container}>
|
|
23
|
+
<% } else { %>
|
|
24
|
+
<View style={styles.container}>
|
|
25
|
+
<% } %>
|
|
26
|
+
<Stack.Screen options={{ title: 'Home' }} />
|
|
27
|
+
<Container>
|
|
32
28
|
<ScreenContent path="app/index.tsx" title="Home">
|
|
29
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
33
30
|
<InternalizationExample />
|
|
31
|
+
<% } %>
|
|
34
32
|
</ScreenContent>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<View className={styles.buttonWrapper} style={{ paddingBottom: insets.bottom }}>
|
|
39
|
-
<Button
|
|
40
|
-
title="Show Details"
|
|
41
|
-
onPress={() => router.push({ pathname: '/details', params: { name: 'Dan' } })}
|
|
42
|
-
/>
|
|
43
|
-
</View>
|
|
44
|
-
</View>
|
|
45
|
-
<% } else { %>
|
|
46
|
-
<View style={styles.container}>
|
|
47
|
-
<Stack.Screen options={{ title: 'Home' }} />
|
|
48
|
-
<Container>
|
|
49
|
-
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
50
|
-
<ScreenContent path="app/index.tsx" title="Home">
|
|
51
|
-
<InternalizationExample />
|
|
52
|
-
</ScreenContent>
|
|
33
|
+
<Link href={{ pathname: '/details', params: { name: 'Dan' } }} asChild>
|
|
34
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
35
|
+
<Button title="Show Details" style={styles.button} />
|
|
53
36
|
<% } else { %>
|
|
54
|
-
|
|
37
|
+
<Button title="Show Details" />
|
|
55
38
|
<% } %>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<% } else { %>
|
|
60
|
-
<Button title="Show Details" />
|
|
61
|
-
<% } %>
|
|
62
|
-
</Link>
|
|
63
|
-
</Container>
|
|
64
|
-
</View>
|
|
65
|
-
<% } %>
|
|
39
|
+
</Link>
|
|
40
|
+
</Container>
|
|
41
|
+
</View>
|
|
66
42
|
);
|
|
67
43
|
}
|
|
68
44
|
|
|
69
45
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
70
46
|
const styles = {
|
|
71
|
-
|
|
72
|
-
container: "flex flex-1 bg-white px-4",
|
|
47
|
+
container: "flex flex-1 bg-white",
|
|
73
48
|
}
|
|
74
49
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
75
50
|
const styles = StyleSheet.create({
|
|
@@ -6,7 +6,7 @@ import { StyleSheet } from 'react-native-unistyles';
|
|
|
6
6
|
import { StyleSheet, View } from 'react-native';
|
|
7
7
|
<% } %>
|
|
8
8
|
|
|
9
|
-
import { ScreenContent } from '
|
|
9
|
+
import { ScreenContent } from '@/components/ScreenContent';
|
|
10
10
|
|
|
11
11
|
export default function Home() {
|
|
12
12
|
return (
|
|
@@ -6,7 +6,7 @@ import { StyleSheet } from 'react-native-unistyles';
|
|
|
6
6
|
import { StyleSheet, View } from 'react-native';
|
|
7
7
|
<% } %>
|
|
8
8
|
|
|
9
|
-
import { ScreenContent } from '
|
|
9
|
+
import { ScreenContent } from '@/components/ScreenContent';
|
|
10
10
|
|
|
11
11
|
export default function Home() {
|
|
12
12
|
return (
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
2
2
|
import '../global.css';
|
|
3
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
3
4
|
<% } else if (props.stylingPackage?.name === "nativewinui") { %>
|
|
4
5
|
import '../global.css';
|
|
5
6
|
import 'expo-dev-client';
|
|
@@ -28,6 +29,9 @@ export default function RootLayout() {
|
|
|
28
29
|
<% } %>
|
|
29
30
|
|
|
30
31
|
return (
|
|
32
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
33
|
+
<SafeAreaProvider>
|
|
34
|
+
<% } %>
|
|
31
35
|
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
32
36
|
<Stack
|
|
33
37
|
screenOptions={{
|
|
@@ -46,5 +50,8 @@ export default function RootLayout() {
|
|
|
46
50
|
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
47
51
|
<Stack.Screen name="modal" options={{ presentation: "modal" }} />
|
|
48
52
|
</Stack>
|
|
53
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
54
|
+
</SafeAreaProvider>
|
|
55
|
+
<% } %>
|
|
49
56
|
);
|
|
50
57
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StatusBar } from 'expo-status-bar';
|
|
2
2
|
import { Platform } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { ScreenContent } from '
|
|
4
|
+
import { ScreenContent } from '@/components/ScreenContent';
|
|
5
5
|
|
|
6
6
|
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
7
7
|
import { InternalizationExample } from 'components/InternalizationExample';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
// Learn more https://docs.expo.io/guides/customizing-metro
|
|
2
1
|
const { getDefaultConfig } = require('expo/metro-config');
|
|
3
2
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
4
|
-
const {
|
|
3
|
+
const { withNativeWind } = require("nativewind/metro");
|
|
5
4
|
<% } %>
|
|
6
5
|
|
|
7
6
|
/** @type {import('expo/metro-config').MetroConfig} */
|
|
7
|
+
// eslint-disable-next-line no-undef
|
|
8
8
|
const config = getDefaultConfig(__dirname);
|
|
9
9
|
|
|
10
10
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
11
|
-
module.exports =
|
|
11
|
+
module.exports = withNativeWind(config, { input: "./global.css" });
|
|
12
12
|
<% } else { %>
|
|
13
13
|
module.exports = config;
|
|
14
14
|
<% } %>
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { Feather } from '@expo/vector-icons';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
interface BackButtonProps {
|
|
5
|
+
onPress: () => void;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const BackButton: React.FC<BackButtonProps> = ({ onPress }) => {
|
|
5
9
|
return (
|
|
6
10
|
<View className={styles.backButton}>
|
|
7
11
|
<Feather name="chevron-left" size={16} color="#007AFF" />
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { forwardRef } from 'react';
|
|
2
2
|
import { Text, TouchableOpacity, TouchableOpacityProps, View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
interface ButtonProps extends TouchableOpacityProps {
|
|
5
5
|
title: string;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
|
|
8
8
|
export const Button = forwardRef<View, ButtonProps>(({ title, ...touchableProps }, ref) => {
|
|
9
9
|
return (
|
|
@@ -16,6 +16,6 @@ export const Button = forwardRef<View, ButtonProps>(({ title, ...touchableProps
|
|
|
16
16
|
Button.displayName = 'Button';
|
|
17
17
|
|
|
18
18
|
const styles = {
|
|
19
|
-
button: 'items-center bg-indigo-500 rounded-[28px] shadow-md p-4
|
|
19
|
+
button: 'items-center bg-indigo-500 rounded-[28px] shadow-md p-4',
|
|
20
20
|
buttonText: 'text-white text-lg font-semibold text-center',
|
|
21
21
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
interface ContainerProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const Container: React.FC<ContainerProps> = ({ children }) => {
|
|
8
|
+
return <View className={styles.container}>{children}</View>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const styles = {
|
|
12
|
+
container: "flex flex-1 p-safe-offset-6",
|
|
13
|
+
};
|