create-expo-stack 2.4.0-next.43d8ac0 → 2.4.0-next.79e55fd
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/build/commands/create-expo-stack.js +30 -16
- package/build/templates/base/App.tsx.ejs +3 -0
- package/build/templates/base/babel.config.js.ejs +10 -11
- package/build/templates/base/package.json.ejs +25 -21
- 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 -22
- package/build/templates/packages/expo-router/drawer/app/[...unmatched].tsx.ejs +5 -5
- package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +39 -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/metro.config.js.ejs +16 -0
- package/build/templates/packages/expo-router/stack/app/[...unmatched].tsx.ejs +1 -1
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +7 -0
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +35 -28
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +29 -43
- package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +9 -9
- package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +14 -23
- package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +13 -23
- package/build/templates/packages/expo-router/tabs/app/[...unmatched].tsx.ejs +4 -4
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +7 -0
- package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +13 -22
- package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +28 -28
- package/build/templates/packages/firebase/metro.config.js.ejs +9 -10
- package/build/templates/packages/nativewind/global.css +3 -0
- package/build/templates/packages/nativewind/metro.config.js +7 -0
- package/build/templates/packages/nativewind/tailwind.config.js.ejs +1 -0
- package/build/templates/packages/react-navigation/App.tsx.ejs +6 -0
- package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +6 -6
- package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +41 -6
- package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +24 -14
- package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +30 -23
- package/build/templates/packages/react-navigation/screens/details.tsx.ejs +5 -13
- package/build/templates/packages/react-navigation/screens/home.tsx.ejs +83 -0
- package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +8 -27
- package/build/templates/packages/react-navigation/screens/one.tsx.ejs +7 -26
- package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +8 -38
- package/build/templates/packages/react-navigation/screens/two.tsx.ejs +7 -26
- package/build/templates/packages/unistyles/theme.ts.ejs +68 -18
- package/build/templates/packages/unistyles/unistyles.ts.ejs +4 -5
- package/build/types/types.d.ts +1 -1
- package/build/utilities/configureProjectFiles.js +19 -8
- package/build/utilities/generateProjectFiles.js +2 -2
- package/build/utilities/runCLI.js +2 -2
- package/build/utilities/showHelp.js +2 -1
- package/package.json +2 -2
- package/build/templates/packages/expo-router/drawer/app/(drawer)/news.tsx.ejs +0 -95
- package/build/templates/packages/expo-router/metro.config.js +0 -11
|
@@ -2,7 +2,7 @@ import FontAwesome from "@expo/vector-icons/FontAwesome";
|
|
|
2
2
|
import { Link, Tabs } from "expo-router";
|
|
3
3
|
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
4
4
|
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
5
|
-
import { Pressable } from
|
|
5
|
+
import { Pressable } from 'react-native';
|
|
6
6
|
<% } else { %>
|
|
7
7
|
import { Pressable, StyleSheet } from "react-native";
|
|
8
8
|
<% } %>
|
|
@@ -19,26 +19,26 @@ function TabBarIcon(props: {
|
|
|
19
19
|
|
|
20
20
|
export default function TabLayout() {
|
|
21
21
|
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
22
|
-
const {styles} = useStyles(stylesheet)
|
|
22
|
+
const { styles } = useStyles(stylesheet)
|
|
23
23
|
<% } %>
|
|
24
24
|
return (
|
|
25
25
|
<Tabs
|
|
26
26
|
screenOptions={{
|
|
27
|
-
tabBarActiveTintColor:
|
|
27
|
+
tabBarActiveTintColor: 'black',
|
|
28
28
|
}}>
|
|
29
29
|
<Tabs.Screen
|
|
30
|
-
name=
|
|
30
|
+
name='index'
|
|
31
31
|
options={{
|
|
32
|
-
title:
|
|
33
|
-
tabBarIcon: ({ color }) => <TabBarIcon name=
|
|
32
|
+
title: 'Tab One',
|
|
33
|
+
tabBarIcon: ({ color }) => <TabBarIcon name='code' color={color} />,
|
|
34
34
|
headerRight: () => (
|
|
35
|
-
<Link href=
|
|
35
|
+
<Link href='/modal' asChild>
|
|
36
36
|
<Pressable>
|
|
37
37
|
{({ pressed }) => (
|
|
38
38
|
<FontAwesome
|
|
39
|
-
name=
|
|
39
|
+
name='info-circle'
|
|
40
40
|
size={25}
|
|
41
|
-
color=
|
|
41
|
+
color='gray'
|
|
42
42
|
style={[styles.headerRight, { opacity: pressed ? 0.5 : 1 }]}
|
|
43
43
|
/>
|
|
44
44
|
)}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
6
6
|
import { Box, Text } from 'theme';
|
|
7
7
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
8
|
-
import {
|
|
9
|
-
import { Text, View } from
|
|
8
|
+
import { useStyles } from 'react-native-unistyles'
|
|
9
|
+
import { Text, View } from 'react-native';
|
|
10
10
|
<% } else { %>
|
|
11
11
|
import { StyleSheet, Text, View } from "react-native";
|
|
12
12
|
<% } %>
|
|
@@ -15,9 +15,16 @@ import EditScreenInfo from "../../components/edit-screen-info";
|
|
|
15
15
|
|
|
16
16
|
export default function TabOneScreen() {
|
|
17
17
|
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
|
|
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") { %>
|
|
21
28
|
return (
|
|
22
29
|
<View className={styles.container}>
|
|
23
30
|
<Text className={styles.title}>Tab One</Text>
|
|
@@ -42,7 +49,7 @@ export default function TabOneScreen() {
|
|
|
42
49
|
<Box height={1} marginVertical="l_32" width="80%" />
|
|
43
50
|
<EditScreenInfo path="app/(tabs)/index.tsx" />
|
|
44
51
|
</Box>
|
|
45
|
-
);
|
|
52
|
+
);
|
|
46
53
|
<% } else { %>
|
|
47
54
|
return (
|
|
48
55
|
<View style={styles.container}>
|
|
@@ -60,23 +67,6 @@ export default function TabOneScreen() {
|
|
|
60
67
|
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
61
68
|
title: `text-xl font-bold`
|
|
62
69
|
};
|
|
63
|
-
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
64
|
-
const stylesheet = createStyleSheet({
|
|
65
|
-
container: {
|
|
66
|
-
alignItems: "center",
|
|
67
|
-
flex: 1,
|
|
68
|
-
justifyContent: "center",
|
|
69
|
-
},
|
|
70
|
-
separator: {
|
|
71
|
-
height: 1,
|
|
72
|
-
marginVertical: 30,
|
|
73
|
-
width: "80%",
|
|
74
|
-
},
|
|
75
|
-
title: {
|
|
76
|
-
fontSize: 20,
|
|
77
|
-
fontWeight: "bold",
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
70
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
81
71
|
const styles = StyleSheet.create({
|
|
82
72
|
container: {
|
|
@@ -85,6 +75,7 @@ export default function TabOneScreen() {
|
|
|
85
75
|
justifyContent: "center",
|
|
86
76
|
},
|
|
87
77
|
separator: {
|
|
78
|
+
backgroundColor: '#d1d5db',
|
|
88
79
|
height: 1,
|
|
89
80
|
marginVertical: 30,
|
|
90
81
|
width: "80%",
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
6
6
|
import { Box, Text } from 'theme';
|
|
7
7
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
8
|
-
import {
|
|
9
|
-
import { Text, View } from
|
|
8
|
+
import { useStyles } from 'react-native-unistyles'
|
|
9
|
+
import { Text, View } from 'react-native';
|
|
10
10
|
<% } else { %>
|
|
11
11
|
import { StyleSheet, Text, View } from "react-native";
|
|
12
12
|
<% } %>
|
|
@@ -15,9 +15,16 @@ import EditScreenInfo from "../../components/edit-screen-info";
|
|
|
15
15
|
|
|
16
16
|
export default function TabTwoScreen() {
|
|
17
17
|
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const { theme } = useStyles()
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<View style={theme.components.container}>
|
|
22
|
+
<Text style={theme.components.title}>Tab Two</Text>
|
|
23
|
+
<View style={theme.components.separator} />
|
|
24
|
+
<EditScreenInfo path='app/(tabs)/two.tsx' />
|
|
25
|
+
</View>
|
|
26
|
+
);
|
|
27
|
+
<% } else if (props.stylingPackage?.name === "nativewind") { %>
|
|
21
28
|
return (
|
|
22
29
|
<View className={styles.container}>
|
|
23
30
|
<Text className={styles.title}>Tab Two</Text>
|
|
@@ -42,7 +49,7 @@ export default function TabTwoScreen() {
|
|
|
42
49
|
<Box height={1} marginVertical="l_32" width="80%" />
|
|
43
50
|
<EditScreenInfo path="app/(tabs)/two.tsx" />
|
|
44
51
|
</Box>
|
|
45
|
-
);
|
|
52
|
+
);
|
|
46
53
|
<% } else { %>
|
|
47
54
|
return (
|
|
48
55
|
<View style={styles.container}>
|
|
@@ -60,23 +67,6 @@ export default function TabTwoScreen() {
|
|
|
60
67
|
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
61
68
|
title: `text-xl font-bold`
|
|
62
69
|
};
|
|
63
|
-
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
64
|
-
const stylesheet = createStyleSheet({
|
|
65
|
-
container: {
|
|
66
|
-
alignItems: "center",
|
|
67
|
-
flex: 1,
|
|
68
|
-
justifyContent: "center",
|
|
69
|
-
},
|
|
70
|
-
separator: {
|
|
71
|
-
height: 1,
|
|
72
|
-
marginVertical: 30,
|
|
73
|
-
width: "80%",
|
|
74
|
-
},
|
|
75
|
-
title: {
|
|
76
|
-
fontSize: 20,
|
|
77
|
-
fontWeight: "bold",
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
70
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
81
71
|
const styles = StyleSheet.create({
|
|
82
72
|
container: {
|
|
@@ -19,7 +19,7 @@ export default function NotFoundScreen() {
|
|
|
19
19
|
<% } %>
|
|
20
20
|
|
|
21
21
|
<% if (props.stylingPackage?.name === "unistyles") {%>
|
|
22
|
-
const {styles} = useStyles(stylesheet);
|
|
22
|
+
const { styles } = useStyles(stylesheet);
|
|
23
23
|
<% } %>
|
|
24
24
|
|
|
25
25
|
return (
|
|
@@ -79,7 +79,7 @@ export default function NotFoundScreen() {
|
|
|
79
79
|
linkText: `text-base text-[#2e78b7]`,
|
|
80
80
|
};
|
|
81
81
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
82
|
-
const stylesheet = createStyleSheet({
|
|
82
|
+
const stylesheet = createStyleSheet((theme) => ({
|
|
83
83
|
container: {
|
|
84
84
|
flex: 1,
|
|
85
85
|
alignItems: 'center',
|
|
@@ -96,9 +96,9 @@ export default function NotFoundScreen() {
|
|
|
96
96
|
},
|
|
97
97
|
linkText: {
|
|
98
98
|
fontSize: 14,
|
|
99
|
-
color:
|
|
99
|
+
color: theme.colors.astral,
|
|
100
100
|
},
|
|
101
|
-
});
|
|
101
|
+
}));
|
|
102
102
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
103
103
|
const styles = StyleSheet.create({
|
|
104
104
|
container: {
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
2
|
+
import '../global.css';
|
|
3
|
+
<% } %>
|
|
4
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
5
|
+
import '../unistyles';
|
|
6
|
+
<% } %>
|
|
7
|
+
|
|
1
8
|
<% if (props.stylingPackage?.name === "tamagui") { %>
|
|
2
9
|
import React, { useEffect } from "react";
|
|
3
10
|
import { TamaguiProvider } from 'tamagui'
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import { Platform } from 'react-native';
|
|
8
8
|
import { Box, Text } from 'theme';
|
|
9
9
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
10
|
-
import {
|
|
11
|
-
import { Platform, Text, View } from
|
|
10
|
+
import { useStyles } from 'react-native-unistyles'
|
|
11
|
+
import { Platform, Text, View } from 'react-native';
|
|
12
12
|
<% } else { %>
|
|
13
13
|
import { Platform, StyleSheet, Text, View } from "react-native";
|
|
14
14
|
<% } %>
|
|
@@ -18,9 +18,17 @@ import EditScreenInfo from "../components/edit-screen-info";
|
|
|
18
18
|
|
|
19
19
|
export default function ModalScreen() {
|
|
20
20
|
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
|
|
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") { %>
|
|
24
32
|
return (
|
|
25
33
|
<View className={styles.container}>
|
|
26
34
|
<StatusBar style={Platform.OS === "ios" ? "light" : "auto"} />
|
|
@@ -67,23 +75,6 @@ export default function ModalScreen() {
|
|
|
67
75
|
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
68
76
|
title: `text-xl font-bold`
|
|
69
77
|
};
|
|
70
|
-
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
71
|
-
const stylesheet = createStyleSheet({
|
|
72
|
-
container: {
|
|
73
|
-
alignItems: "center",
|
|
74
|
-
flex: 1,
|
|
75
|
-
justifyContent: "center"
|
|
76
|
-
},
|
|
77
|
-
separator: {
|
|
78
|
-
height: 1,
|
|
79
|
-
marginVertical: 30,
|
|
80
|
-
width: "80%"
|
|
81
|
-
},
|
|
82
|
-
title: {
|
|
83
|
-
fontSize: 20,
|
|
84
|
-
fontWeight: "bold"
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
78
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
88
79
|
const styles = StyleSheet.create({
|
|
89
80
|
container: {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { Box, Text } from 'theme';
|
|
7
7
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
8
8
|
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
9
|
-
import { Text, View } from
|
|
9
|
+
import { Text, View } from 'react-native';
|
|
10
10
|
<% } else { %>
|
|
11
11
|
import { StyleSheet, Text, View } from "react-native";
|
|
12
12
|
<% } %>
|
|
@@ -92,33 +92,33 @@ export default function EditScreenInfo({ path }: { path: string }) {
|
|
|
92
92
|
};
|
|
93
93
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
94
94
|
const stylesheet = createStyleSheet({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
122
|
});
|
|
123
123
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
124
124
|
const styles = StyleSheet.create({
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
const { getDefaultConfig } = require('expo/metro-config');
|
|
2
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
3
|
+
const { withNativeWind } = require("nativewind/metro");
|
|
4
|
+
<% } %>
|
|
2
5
|
|
|
3
6
|
/** @type {import('expo/metro-config').MetroConfig} */
|
|
4
7
|
// eslint-disable-next-line no-undef
|
|
5
|
-
const config = getDefaultConfig(__dirname
|
|
6
|
-
<%_ if (props.navigationPackage?.name === "expo-router") { -%>
|
|
7
|
-
, {
|
|
8
|
-
// [Web-only]: Enables CSS support in Metro.
|
|
9
|
-
isCSSEnabled: true
|
|
10
|
-
}
|
|
11
|
-
<% } %>
|
|
12
|
-
);
|
|
13
|
-
config.resolver.sourceExts.push('cjs');
|
|
8
|
+
const config = getDefaultConfig(__dirname);
|
|
14
9
|
|
|
15
|
-
|
|
10
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
11
|
+
module.exports = withNativeWind(config, { input: "./global.css" });
|
|
12
|
+
<% } else { %>
|
|
13
|
+
module.exports = config;
|
|
14
|
+
<% } %>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const { getDefaultConfig } = require('expo/metro-config');
|
|
2
|
+
const { withNativeWind } = require('nativewind/metro');
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line no-undef
|
|
5
|
+
const config = getDefaultConfig(__dirname);
|
|
6
|
+
|
|
7
|
+
module.exports = withNativeWind(config, { input: './global.css' });
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
2
|
+
import './global.css';
|
|
3
|
+
<% } %>
|
|
4
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
5
|
+
import './unistyles';
|
|
6
|
+
<% } %>
|
|
1
7
|
import "react-native-gesture-handler";
|
|
2
8
|
<% if (props.stylingPackage?.name === "tamagui") { %>
|
|
3
9
|
import React, { useEffect } from "react";
|
|
@@ -5,7 +5,7 @@ import React from "react";
|
|
|
5
5
|
import { Box, Text } from 'theme';
|
|
6
6
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
7
7
|
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
8
|
-
import { Text, View } from
|
|
8
|
+
import { Text, View } from 'react-native';
|
|
9
9
|
<% } else { %>
|
|
10
10
|
import { StyleSheet, Text, View } from "react-native";
|
|
11
11
|
<% } %>
|
|
@@ -57,7 +57,7 @@ import React from "react";
|
|
|
57
57
|
}
|
|
58
58
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
59
59
|
export default function EditScreenInfo({ path }: { path: string }) {
|
|
60
|
-
const {styles} = useStyles(stylesheet)
|
|
60
|
+
const { styles } = useStyles(stylesheet)
|
|
61
61
|
return (
|
|
62
62
|
<View>
|
|
63
63
|
<View style={styles.getStartedContainer}>
|
|
@@ -124,16 +124,16 @@ import React from "react";
|
|
|
124
124
|
paddingHorizontal: 4
|
|
125
125
|
},
|
|
126
126
|
getStartedContainer: {
|
|
127
|
-
alignItems:
|
|
127
|
+
alignItems: 'center',
|
|
128
128
|
marginHorizontal: 50
|
|
129
129
|
},
|
|
130
130
|
getStartedText: {
|
|
131
131
|
fontSize: 17,
|
|
132
132
|
lineHeight: 24,
|
|
133
|
-
textAlign:
|
|
133
|
+
textAlign: 'center'
|
|
134
134
|
},
|
|
135
135
|
helpContainer: {
|
|
136
|
-
alignItems:
|
|
136
|
+
alignItems: 'center',
|
|
137
137
|
marginHorizontal: 20,
|
|
138
138
|
marginTop: 15
|
|
139
139
|
},
|
|
@@ -141,7 +141,7 @@ import React from "react";
|
|
|
141
141
|
paddingVertical: 15
|
|
142
142
|
},
|
|
143
143
|
helpLinkText: {
|
|
144
|
-
textAlign:
|
|
144
|
+
textAlign: 'center'
|
|
145
145
|
},
|
|
146
146
|
homeScreenFilename: {
|
|
147
147
|
marginVertical: 7
|
|
@@ -1,15 +1,50 @@
|
|
|
1
|
+
import { FontAwesome, Ionicons, MaterialIcons } from '@expo/vector-icons';
|
|
1
2
|
import { createDrawerNavigator } from '@react-navigation/drawer';
|
|
3
|
+
import { Pressable } from 'react-native';
|
|
4
|
+
import { StackScreenProps } from '@react-navigation/stack';
|
|
2
5
|
|
|
3
|
-
import
|
|
4
|
-
import
|
|
6
|
+
import { RootStackParamList } from '.';
|
|
7
|
+
import TabNavigator from './tab-navigator';
|
|
8
|
+
import Home from '../screens/home';
|
|
9
|
+
|
|
10
|
+
type Props = StackScreenProps<RootStackParamList, 'DrawerNavigator'>;
|
|
5
11
|
|
|
6
12
|
const Drawer = createDrawerNavigator();
|
|
7
13
|
|
|
8
|
-
export default function DrawerNavigator() {
|
|
14
|
+
export default function DrawerNavigator({ navigation }: Props) {
|
|
9
15
|
return (
|
|
10
|
-
<Drawer.Navigator
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
<Drawer.Navigator>
|
|
17
|
+
<Drawer.Screen
|
|
18
|
+
name="Home"
|
|
19
|
+
component={Home}
|
|
20
|
+
options={{
|
|
21
|
+
drawerIcon: ({ size, color }) => <Ionicons name="home-outline" size={size} color={color} />,
|
|
22
|
+
}}
|
|
23
|
+
/>
|
|
24
|
+
<Drawer.Screen name="Tabs" component={TabNavigator}
|
|
25
|
+
options={{
|
|
26
|
+
headerRight: () => (
|
|
27
|
+
<Pressable onPress={() => navigation.navigate('Modal')}>
|
|
28
|
+
{({ pressed }) => (
|
|
29
|
+
<FontAwesome
|
|
30
|
+
name="info-circle"
|
|
31
|
+
size={25}
|
|
32
|
+
color="gray"
|
|
33
|
+
style={[
|
|
34
|
+
{
|
|
35
|
+
marginRight: 16,
|
|
36
|
+
opacity: pressed ? 0.5 : 1,
|
|
37
|
+
},
|
|
38
|
+
]}
|
|
39
|
+
/>
|
|
40
|
+
)}
|
|
41
|
+
</Pressable>
|
|
42
|
+
),
|
|
43
|
+
drawerIcon: ({ size, color }) => (
|
|
44
|
+
<MaterialIcons name="border-bottom" size={size} color={color} />
|
|
45
|
+
),
|
|
46
|
+
}}
|
|
47
|
+
/>
|
|
13
48
|
</Drawer.Navigator>
|
|
14
49
|
);
|
|
15
50
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { Box, Text, useTheme } from 'theme';
|
|
11
11
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
12
12
|
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
13
|
-
import { Text, View } from
|
|
13
|
+
import { Text, View } from 'react-native';
|
|
14
14
|
<% } else { %>
|
|
15
15
|
import { Text, View, StyleSheet } from "react-native";
|
|
16
16
|
<% } %>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<% } %>
|
|
32
32
|
|
|
33
33
|
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
34
|
-
const { styles } = useStyles(stylesheet)
|
|
34
|
+
const { styles, theme } = useStyles(stylesheet);
|
|
35
35
|
<% } %>
|
|
36
36
|
|
|
37
37
|
return (
|
|
@@ -77,6 +77,15 @@
|
|
|
77
77
|
</Box>
|
|
78
78
|
),
|
|
79
79
|
})}
|
|
80
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
81
|
+
options={({ navigation }) => ({
|
|
82
|
+
headerLeft: () => (
|
|
83
|
+
<View style={styles.backButton}>
|
|
84
|
+
<Feather name="chevron-left" size={16} color={theme.colors.azureRadiance} />
|
|
85
|
+
<Text style={styles.backButtonText} onPress={navigation.goBack}>Back</Text>
|
|
86
|
+
</View>
|
|
87
|
+
)
|
|
88
|
+
})}
|
|
80
89
|
<% } else { %>
|
|
81
90
|
options={({ navigation }) => ({
|
|
82
91
|
headerLeft: () => (
|
|
@@ -99,16 +108,16 @@
|
|
|
99
108
|
backButtonText: "text-blue-500 ml-1"
|
|
100
109
|
};
|
|
101
110
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
102
|
-
const stylesheet = createStyleSheet({
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
const stylesheet = createStyleSheet((theme) => ({
|
|
112
|
+
backButton: {
|
|
113
|
+
flexDirection: 'row',
|
|
114
|
+
paddingLeft: 20,
|
|
115
|
+
},
|
|
116
|
+
backButtonText: {
|
|
117
|
+
color: theme.colors.azureRadiance,
|
|
118
|
+
marginLeft: 4,
|
|
119
|
+
},
|
|
120
|
+
}));
|
|
112
121
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
113
122
|
const styles = StyleSheet.create({
|
|
114
123
|
backButton: {
|
|
@@ -153,7 +162,7 @@
|
|
|
153
162
|
</NavigationContainer>
|
|
154
163
|
);
|
|
155
164
|
}
|
|
156
|
-
<% } else if (props.navigationPackage?.options.type === 'drawer') { %>
|
|
165
|
+
<% } else if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
|
|
157
166
|
import { NavigationContainer } from "@react-navigation/native";
|
|
158
167
|
import { createStackNavigator } from '@react-navigation/stack';
|
|
159
168
|
|
|
@@ -163,6 +172,7 @@
|
|
|
163
172
|
export type RootStackParamList = {
|
|
164
173
|
DrawerNavigator: undefined;
|
|
165
174
|
Modal: undefined;
|
|
175
|
+
TabNavigator: undefined;
|
|
166
176
|
};
|
|
167
177
|
|
|
168
178
|
const Stack = createStackNavigator<RootStackParamList>();
|
|
@@ -179,7 +189,7 @@
|
|
|
179
189
|
<Stack.Screen
|
|
180
190
|
name="Modal"
|
|
181
191
|
component={Modal}
|
|
182
|
-
options={{ presentation: "modal" }}
|
|
192
|
+
options={{ presentation: "modal", headerLeft: () => null }}
|
|
183
193
|
/>
|
|
184
194
|
</Stack.Navigator>
|
|
185
195
|
</NavigationContainer>
|