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
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import FontAwesome from
|
|
1
|
+
import FontAwesome from '@expo/vector-icons/FontAwesome';
|
|
2
2
|
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
|
|
3
3
|
import { StackScreenProps } from '@react-navigation/stack';
|
|
4
|
-
<% if (props.stylingPackage?.name ===
|
|
4
|
+
<% if (props.stylingPackage?.name === 'unistyles') { %>
|
|
5
5
|
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
6
|
-
import { Pressable } from
|
|
6
|
+
import { Pressable } from 'react-native';
|
|
7
|
+
<% } else if (props.navigationPackage?.options.type === 'drawer + tabs' ) { %>
|
|
8
|
+
import { StyleSheet } from 'react-native';
|
|
7
9
|
<% } else { %>
|
|
8
|
-
import { Pressable, StyleSheet } from
|
|
10
|
+
import { Pressable, StyleSheet } from 'react-native';
|
|
9
11
|
<% } %>
|
|
10
12
|
|
|
11
13
|
import { RootStackParamList } from '.';
|
|
12
|
-
import One from
|
|
13
|
-
import Two from
|
|
14
|
+
import One from '../screens/one';
|
|
15
|
+
import Two from '../screens/two';
|
|
14
16
|
|
|
15
17
|
const Tab = createBottomTabNavigator();
|
|
16
18
|
|
|
17
19
|
function TabBarIcon(props: {
|
|
18
|
-
name: React.ComponentProps<typeof FontAwesome>[
|
|
20
|
+
name: React.ComponentProps<typeof FontAwesome>['name'];
|
|
19
21
|
color: string;
|
|
20
22
|
}) {
|
|
21
|
-
<% if (props.stylingPackage?.name ===
|
|
22
|
-
const {styles} = useStyles(stylesheet)
|
|
23
|
+
<% if (props.stylingPackage?.name === 'unistyles') {%>
|
|
24
|
+
const { styles } = useStyles(stylesheet)
|
|
23
25
|
<% } %>
|
|
24
26
|
return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
|
|
25
27
|
}
|
|
@@ -27,48 +29,53 @@ function TabBarIcon(props: {
|
|
|
27
29
|
type Props = StackScreenProps<RootStackParamList, 'TabNavigator'>;
|
|
28
30
|
|
|
29
31
|
export default function TabLayout({ navigation }: Props) {
|
|
30
|
-
<% if (props.stylingPackage?.name ===
|
|
31
|
-
const {styles} = useStyles(stylesheet)
|
|
32
|
+
<% if (props.stylingPackage?.name === 'unistyles') {%>
|
|
33
|
+
const { styles } = useStyles(stylesheet)
|
|
32
34
|
<% } %>
|
|
33
35
|
|
|
34
36
|
return (
|
|
35
37
|
<Tab.Navigator
|
|
36
38
|
screenOptions={{
|
|
37
|
-
tabBarActiveTintColor:
|
|
39
|
+
tabBarActiveTintColor: 'black',
|
|
40
|
+
<% if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
|
|
41
|
+
headerShown: false,
|
|
42
|
+
<% } %>
|
|
38
43
|
}}>
|
|
39
44
|
<Tab.Screen
|
|
40
|
-
name=
|
|
45
|
+
name='One'
|
|
41
46
|
component={One}
|
|
42
47
|
options={{
|
|
43
|
-
title:
|
|
44
|
-
tabBarIcon: ({ color }) => <TabBarIcon name=
|
|
48
|
+
title: 'Tab One',
|
|
49
|
+
tabBarIcon: ({ color }) => <TabBarIcon name='code' color={color} />,
|
|
50
|
+
<% if (props.navigationPackage?.options.type === 'tabs') { %>
|
|
45
51
|
headerRight: () => (
|
|
46
|
-
<Pressable onPress={() => navigation.navigate(
|
|
52
|
+
<Pressable onPress={() => navigation.navigate('Modal')}>
|
|
47
53
|
{({ pressed }) => (
|
|
48
54
|
<FontAwesome
|
|
49
|
-
name=
|
|
55
|
+
name='info-circle'
|
|
50
56
|
size={25}
|
|
51
|
-
color=
|
|
57
|
+
color='gray'
|
|
52
58
|
style={[styles.headerRight, { opacity: pressed ? 0.5 : 1 }]}
|
|
53
59
|
/>
|
|
54
60
|
)}
|
|
55
61
|
</Pressable>
|
|
56
|
-
|
|
62
|
+
)
|
|
63
|
+
<% } %>
|
|
57
64
|
}}
|
|
58
65
|
/>
|
|
59
66
|
<Tab.Screen
|
|
60
|
-
name=
|
|
67
|
+
name='Two'
|
|
61
68
|
component={Two}
|
|
62
69
|
options={{
|
|
63
|
-
title:
|
|
64
|
-
tabBarIcon: ({ color }) => <TabBarIcon name=
|
|
70
|
+
title: 'Tab Two',
|
|
71
|
+
tabBarIcon: ({ color }) => <TabBarIcon name='code' color={color} />,
|
|
65
72
|
}}
|
|
66
73
|
/>
|
|
67
74
|
</Tab.Navigator>
|
|
68
75
|
);
|
|
69
76
|
}
|
|
70
77
|
|
|
71
|
-
<% if (props.stylingPackage?.name ===
|
|
78
|
+
<% if (props.stylingPackage?.name === 'unistyles') { %>
|
|
72
79
|
const stylesheet = createStyleSheet({
|
|
73
80
|
headerRight: {
|
|
74
81
|
marginRight: 15
|
|
@@ -8,7 +8,7 @@ import { RouteProp, useRoute } from "@react-navigation/native";
|
|
|
8
8
|
import { Box, Text } from 'theme';
|
|
9
9
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
10
10
|
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
11
|
-
import { View, Text } from
|
|
11
|
+
import { View, Text } from 'react-native';
|
|
12
12
|
<% } else { %>
|
|
13
13
|
import { View, StyleSheet, Text } from "react-native";
|
|
14
14
|
<% } %>
|
|
@@ -50,12 +50,12 @@ export default function Details() {
|
|
|
50
50
|
</Box>
|
|
51
51
|
);
|
|
52
52
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
53
|
-
const {styles} = useStyles(stylesheet)
|
|
53
|
+
const { styles, theme } = useStyles(stylesheet)
|
|
54
54
|
return (
|
|
55
55
|
<View style={styles.container}>
|
|
56
56
|
<View style={styles.main}>
|
|
57
|
-
<Text style={
|
|
58
|
-
<Text style={
|
|
57
|
+
<Text style={theme.components.title}>Details</Text>
|
|
58
|
+
<Text style={theme.components.subtitle}>Showing details for user {router.params.name}.</Text>
|
|
59
59
|
</View>
|
|
60
60
|
</View>
|
|
61
61
|
);
|
|
@@ -87,15 +87,7 @@ export default function Details() {
|
|
|
87
87
|
main: {
|
|
88
88
|
flex: 1,
|
|
89
89
|
maxWidth: 960,
|
|
90
|
-
marginHorizontal:
|
|
91
|
-
},
|
|
92
|
-
title: {
|
|
93
|
-
fontSize: 64,
|
|
94
|
-
fontWeight: "bold",
|
|
95
|
-
},
|
|
96
|
-
subtitle: {
|
|
97
|
-
fontSize: 36,
|
|
98
|
-
color: "#38434D",
|
|
90
|
+
marginHorizontal: 'auto',
|
|
99
91
|
},
|
|
100
92
|
});
|
|
101
93
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<% if (props.stylingPackage?.name === 'nativewind') { %>
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
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
|
+
<% } %>
|
|
13
|
+
|
|
14
|
+
const Page = () => {
|
|
15
|
+
<% if (props.stylingPackage?.name === 'unistyles') { %>
|
|
16
|
+
const { theme } = useStyles();
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<View style={theme.components.container}>
|
|
20
|
+
<Text style={theme.components.title}>News</Text>
|
|
21
|
+
<View style={theme.components.separator} />
|
|
22
|
+
</View>
|
|
23
|
+
);
|
|
24
|
+
<% } else if (props.stylingPackage?.name === 'nativewind') { %>
|
|
25
|
+
return (
|
|
26
|
+
<View className={styles.container}>
|
|
27
|
+
<Text className={styles.title}>Home</Text>
|
|
28
|
+
<View className={styles.separator} />
|
|
29
|
+
<EditScreenInfo path='app/(tabs)/index.tsx' />
|
|
30
|
+
</View>
|
|
31
|
+
);
|
|
32
|
+
<% } else if (props.stylingPackage?.name === 'tamagui') { %>
|
|
33
|
+
return (
|
|
34
|
+
<Theme name='light'>
|
|
35
|
+
<YStack flex={1} alignItems='center' justifyContent='center'>
|
|
36
|
+
<H2>Home</H2>
|
|
37
|
+
<Separator />
|
|
38
|
+
</YStack>
|
|
39
|
+
</Theme>
|
|
40
|
+
);
|
|
41
|
+
<% } else if (props.stylingPackage?.name === 'restyle') { %>
|
|
42
|
+
return (
|
|
43
|
+
<Box flex={1} alignItems='center' justifyContent='center'>
|
|
44
|
+
<Text variant='title'>Home</Text>
|
|
45
|
+
<Box height={1} marginVertical='l_32' width='80%' />
|
|
46
|
+
</Box>
|
|
47
|
+
);
|
|
48
|
+
<% } else { %>
|
|
49
|
+
return (
|
|
50
|
+
<View style={styles.container}>
|
|
51
|
+
<Text style={styles.title}>Home</Text>
|
|
52
|
+
<View style={styles.separator} />
|
|
53
|
+
</View>
|
|
54
|
+
);
|
|
55
|
+
<% } %>
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export default Page;
|
|
59
|
+
|
|
60
|
+
<% if (props.stylingPackage?.name === 'nativewind') { %>
|
|
61
|
+
const styles = {
|
|
62
|
+
container: `items-center flex-1 justify-center`,
|
|
63
|
+
separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
|
|
64
|
+
title: `text-xl font-bold`
|
|
65
|
+
};
|
|
66
|
+
<% } else if (props.stylingPackage?.name === 'stylesheet') { %>
|
|
67
|
+
const styles = StyleSheet.create({
|
|
68
|
+
container: {
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
flex: 1,
|
|
71
|
+
justifyContent: 'center',
|
|
72
|
+
},
|
|
73
|
+
separator: {
|
|
74
|
+
height: 1,
|
|
75
|
+
marginVertical: 30,
|
|
76
|
+
width: '80%',
|
|
77
|
+
},
|
|
78
|
+
title: {
|
|
79
|
+
fontSize: 20,
|
|
80
|
+
fontWeight: 'bold',
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
<% } %>
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
import { Platform } from 'react-native';
|
|
8
8
|
import { Box, Text, makeStyles } 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
|
<% } %>
|
|
@@ -49,13 +49,13 @@ export default function Modal() {
|
|
|
49
49
|
</Box>
|
|
50
50
|
);
|
|
51
51
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
52
|
-
const {
|
|
52
|
+
const { theme } = useStyles()
|
|
53
53
|
return (
|
|
54
|
-
<View style={
|
|
55
|
-
<StatusBar style={Platform.OS ===
|
|
56
|
-
<Text style={
|
|
57
|
-
<View style={
|
|
58
|
-
<EditScreenInfo path=
|
|
54
|
+
<View style={theme.components.container}>
|
|
55
|
+
<StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
|
|
56
|
+
<Text style={theme.components.title}>Modal</Text>
|
|
57
|
+
<View style={theme.components.separator} />
|
|
58
|
+
<EditScreenInfo path='src/screens/modal.tsx' />
|
|
59
59
|
</View>
|
|
60
60
|
);
|
|
61
61
|
<% } else { %>
|
|
@@ -86,25 +86,6 @@ export default function Modal() {
|
|
|
86
86
|
width: '80%',
|
|
87
87
|
},
|
|
88
88
|
}));
|
|
89
|
-
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
90
|
-
const stylesheet = createStyleSheet({
|
|
91
|
-
container: {
|
|
92
|
-
alignItems: "center",
|
|
93
|
-
flex: 1,
|
|
94
|
-
justifyContent: "center"
|
|
95
|
-
},
|
|
96
|
-
separator: {
|
|
97
|
-
backgroundColor: "gray",
|
|
98
|
-
height: 1,
|
|
99
|
-
marginVertical: 30,
|
|
100
|
-
opacity: 0.25,
|
|
101
|
-
width: "80%",
|
|
102
|
-
},
|
|
103
|
-
title: {
|
|
104
|
-
fontSize: 20,
|
|
105
|
-
fontWeight: "bold"
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
89
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
109
90
|
const styles = StyleSheet.create({
|
|
110
91
|
container: {
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
6
6
|
import { Box, Text, makeStyles } 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
|
<% } %>
|
|
@@ -43,12 +43,12 @@ export default function TabOneScreen() {
|
|
|
43
43
|
</Box>
|
|
44
44
|
);
|
|
45
45
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
46
|
-
const {
|
|
46
|
+
const { theme } = useStyles()
|
|
47
47
|
return (
|
|
48
|
-
<View style={
|
|
49
|
-
<Text style={
|
|
50
|
-
<View style={
|
|
51
|
-
<EditScreenInfo path=
|
|
48
|
+
<View style={theme.components.container}>
|
|
49
|
+
<Text style={theme.components.title}>Tab One</Text>
|
|
50
|
+
<View style={theme.components.separator} />
|
|
51
|
+
<EditScreenInfo path='src/screens/one.tsx' />
|
|
52
52
|
</View>
|
|
53
53
|
);
|
|
54
54
|
<% } else { %>
|
|
@@ -78,25 +78,6 @@ export default function TabOneScreen() {
|
|
|
78
78
|
width: '80%',
|
|
79
79
|
},
|
|
80
80
|
}));
|
|
81
|
-
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
82
|
-
const stylesheet = createStyleSheet({
|
|
83
|
-
container: {
|
|
84
|
-
alignItems: "center",
|
|
85
|
-
flex: 1,
|
|
86
|
-
justifyContent: "center",
|
|
87
|
-
},
|
|
88
|
-
separator: {
|
|
89
|
-
backgroundColor: "gray",
|
|
90
|
-
height: 1,
|
|
91
|
-
marginVertical: 30,
|
|
92
|
-
opacity: 0.25,
|
|
93
|
-
width: "80%",
|
|
94
|
-
},
|
|
95
|
-
title: {
|
|
96
|
-
fontSize: 20,
|
|
97
|
-
fontWeight: "bold",
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
81
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
101
82
|
const styles = StyleSheet.create({
|
|
102
83
|
container: {
|
|
@@ -10,7 +10,7 @@ import { StackNavigationProp } from "@react-navigation/stack";
|
|
|
10
10
|
import { Box, Text, makeStyles } from 'theme';
|
|
11
11
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
12
12
|
import { createStyleSheet, useStyles } from 'react-native-unistyles'
|
|
13
|
-
import { Text, TouchableOpacity, View } from
|
|
13
|
+
import { Text, TouchableOpacity, View } from 'react-native';
|
|
14
14
|
<% } else { %>
|
|
15
15
|
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
16
16
|
<% } %>
|
|
@@ -70,16 +70,16 @@ export default function Overview() {
|
|
|
70
70
|
</Box>
|
|
71
71
|
);
|
|
72
72
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
73
|
-
const {styles} = useStyles(stylesheet)
|
|
73
|
+
const { styles, theme } = useStyles(stylesheet)
|
|
74
74
|
return (
|
|
75
75
|
<View style={styles.container}>
|
|
76
76
|
<View style={styles.main}>
|
|
77
77
|
<View>
|
|
78
|
-
<Text style={
|
|
79
|
-
<Text style={
|
|
78
|
+
<Text style={theme.components.title}>Hello World</Text>
|
|
79
|
+
<Text style={theme.components.subtitle}>This is the first page of your app.</Text>
|
|
80
80
|
</View>
|
|
81
|
-
<TouchableOpacity style={
|
|
82
|
-
<Text style={
|
|
81
|
+
<TouchableOpacity style={theme.components.button} onPress={() => navigation.navigate('Details', { name: 'Dan' })}>
|
|
82
|
+
<Text style={theme.components.buttonText}>Show Details</Text>
|
|
83
83
|
</TouchableOpacity>
|
|
84
84
|
</View>
|
|
85
85
|
</View>
|
|
@@ -131,28 +131,6 @@ export default function Overview() {
|
|
|
131
131
|
}));
|
|
132
132
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
133
133
|
const stylesheet = createStyleSheet({
|
|
134
|
-
button: {
|
|
135
|
-
alignItems: "center",
|
|
136
|
-
backgroundColor: "#6366F1",
|
|
137
|
-
borderRadius: 24,
|
|
138
|
-
elevation: 5,
|
|
139
|
-
flexDirection: "row",
|
|
140
|
-
justifyContent: "center",
|
|
141
|
-
padding: 16,
|
|
142
|
-
shadowColor: "#000",
|
|
143
|
-
shadowOffset: {
|
|
144
|
-
height: 2,
|
|
145
|
-
width: 0
|
|
146
|
-
},
|
|
147
|
-
shadowOpacity: 0.25,
|
|
148
|
-
shadowRadius: 3.84
|
|
149
|
-
},
|
|
150
|
-
buttonText: {
|
|
151
|
-
color: "#FFFFFF",
|
|
152
|
-
fontSize: 16,
|
|
153
|
-
fontWeight: "600",
|
|
154
|
-
textAlign: "center",
|
|
155
|
-
},
|
|
156
134
|
container: {
|
|
157
135
|
flex: 1,
|
|
158
136
|
padding: 24,
|
|
@@ -160,17 +138,9 @@ export default function Overview() {
|
|
|
160
138
|
main: {
|
|
161
139
|
flex: 1,
|
|
162
140
|
maxWidth: 960,
|
|
163
|
-
marginHorizontal:
|
|
164
|
-
justifyContent:
|
|
165
|
-
},
|
|
166
|
-
title: {
|
|
167
|
-
fontSize: 64,
|
|
168
|
-
fontWeight: "bold",
|
|
141
|
+
marginHorizontal: 'auto',
|
|
142
|
+
justifyContent: 'space-between',
|
|
169
143
|
},
|
|
170
|
-
subtitle: {
|
|
171
|
-
color: "#38434D",
|
|
172
|
-
fontSize: 36,
|
|
173
|
-
}
|
|
174
144
|
});
|
|
175
145
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
176
146
|
const styles = StyleSheet.create({
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
6
6
|
import { Box, Text, makeStyles } 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
|
<% } %>
|
|
@@ -33,12 +33,12 @@ export default function TabTwoScreen() {
|
|
|
33
33
|
</Theme>
|
|
34
34
|
);
|
|
35
35
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
36
|
-
const {
|
|
36
|
+
const { theme } = useStyles()
|
|
37
37
|
return (
|
|
38
|
-
<View style={
|
|
39
|
-
<Text style={
|
|
40
|
-
<View style={
|
|
41
|
-
<EditScreenInfo path=
|
|
38
|
+
<View style={theme.components.container}>
|
|
39
|
+
<Text style={theme.components.title}>Tab Two</Text>
|
|
40
|
+
<View style={theme.components.separator} />
|
|
41
|
+
<EditScreenInfo path='src/screens/two.tsx' />
|
|
42
42
|
</View>
|
|
43
43
|
);
|
|
44
44
|
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
@@ -78,25 +78,6 @@ export default function TabTwoScreen() {
|
|
|
78
78
|
width: '80%',
|
|
79
79
|
},
|
|
80
80
|
}));
|
|
81
|
-
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
82
|
-
const stylesheet = createStyleSheet({
|
|
83
|
-
container: {
|
|
84
|
-
alignItems: "center",
|
|
85
|
-
flex: 1,
|
|
86
|
-
justifyContent: "center",
|
|
87
|
-
},
|
|
88
|
-
separator: {
|
|
89
|
-
backgroundColor: "gray",
|
|
90
|
-
height: 1,
|
|
91
|
-
marginVertical: 30,
|
|
92
|
-
opacity: 0.25,
|
|
93
|
-
width: "80%",
|
|
94
|
-
},
|
|
95
|
-
title: {
|
|
96
|
-
fontSize: 20,
|
|
97
|
-
fontWeight: "bold",
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
81
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
101
82
|
const styles = StyleSheet.create({
|
|
102
83
|
container: {
|
|
@@ -1,26 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
},
|
|
8
|
-
margins: {
|
|
9
|
-
sm: 2,
|
|
10
|
-
md: 4,
|
|
11
|
-
lg: 8,
|
|
12
|
-
xl: 12
|
|
13
|
-
}
|
|
1
|
+
const colors = {
|
|
2
|
+
white: '#ffffff',
|
|
3
|
+
azureRadiance: '#007AFF',
|
|
4
|
+
limedSpruce: '#38434D',
|
|
5
|
+
cornflowerBlue: '#6366F1',
|
|
6
|
+
astral: '#2E78B7'
|
|
14
7
|
} as const;
|
|
15
8
|
|
|
16
|
-
export const
|
|
17
|
-
colors
|
|
18
|
-
|
|
9
|
+
export const lightTheme = {
|
|
10
|
+
colors,
|
|
11
|
+
components: {
|
|
12
|
+
<% if (props.navigationPackage?.options.type === 'tabs' || props.navigationPackage?.options.type === 'drawer') {%>
|
|
13
|
+
container: {
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
flex: 1,
|
|
16
|
+
justifyContent: 'center'
|
|
17
|
+
},
|
|
18
|
+
title: {
|
|
19
|
+
fontSize: 20,
|
|
20
|
+
fontWeight: 'bold',
|
|
21
|
+
},
|
|
22
|
+
<% if (props.navigationPackage?.name === 'expo-router') { %>
|
|
23
|
+
separator: {
|
|
24
|
+
height: 1,
|
|
25
|
+
marginVertical: 30,
|
|
26
|
+
width: '80%',
|
|
27
|
+
},
|
|
28
|
+
<% } else { %>
|
|
29
|
+
separator: {
|
|
30
|
+
backgroundColor: 'gray',
|
|
31
|
+
height: 1,
|
|
32
|
+
marginVertical: 30,
|
|
33
|
+
opacity: 0.25,
|
|
34
|
+
width: '80%',
|
|
35
|
+
},
|
|
36
|
+
<% } %>
|
|
37
|
+
<% } else { %>
|
|
38
|
+
button: {
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
backgroundColor: colors.cornflowerBlue,
|
|
41
|
+
borderRadius: 24,
|
|
42
|
+
elevation: 5,
|
|
43
|
+
flexDirection: 'row',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
padding: 16,
|
|
46
|
+
shadowColor: '#000',
|
|
47
|
+
shadowOffset: {
|
|
48
|
+
height: 2,
|
|
49
|
+
width: 0,
|
|
50
|
+
},
|
|
51
|
+
shadowOpacity: 0.25,
|
|
52
|
+
shadowRadius: 3.84,
|
|
53
|
+
},
|
|
54
|
+
buttonText: {
|
|
55
|
+
color: colors.white,
|
|
56
|
+
fontSize: 16,
|
|
57
|
+
fontWeight: '600',
|
|
58
|
+
textAlign: 'center',
|
|
59
|
+
},
|
|
60
|
+
title: {
|
|
61
|
+
fontSize: 64,
|
|
62
|
+
fontWeight: 'bold',
|
|
63
|
+
},
|
|
64
|
+
subtitle: {
|
|
65
|
+
color: colors.limedSpruce,
|
|
66
|
+
fontSize: 36,
|
|
67
|
+
},
|
|
68
|
+
<% } %>
|
|
19
69
|
},
|
|
20
70
|
margins: {
|
|
21
71
|
sm: 2,
|
|
22
72
|
md: 4,
|
|
23
73
|
lg: 8,
|
|
24
|
-
xl: 12
|
|
25
|
-
}
|
|
74
|
+
xl: 12,
|
|
75
|
+
},
|
|
26
76
|
} as const;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { breakpoints } from './breakpoints';
|
|
2
|
-
import { darkTheme, lightTheme } from './theme';
|
|
3
1
|
import { UnistylesRegistry } from 'react-native-unistyles';
|
|
4
2
|
|
|
3
|
+
import { breakpoints } from './breakpoints';
|
|
4
|
+
import { lightTheme } from './theme';
|
|
5
|
+
|
|
5
6
|
type AppBreakpoints = typeof breakpoints;
|
|
6
7
|
|
|
7
8
|
// if you defined themes
|
|
8
9
|
type AppThemes = {
|
|
9
10
|
light: typeof lightTheme;
|
|
10
|
-
dark: typeof darkTheme;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
// override library types
|
|
@@ -19,10 +19,9 @@ declare module 'react-native-unistyles' {
|
|
|
19
19
|
UnistylesRegistry.addBreakpoints(breakpoints)
|
|
20
20
|
.addThemes({
|
|
21
21
|
light: lightTheme,
|
|
22
|
-
dark: darkTheme
|
|
23
22
|
// register other themes with unique names
|
|
24
23
|
})
|
|
25
24
|
.addConfig({
|
|
26
25
|
// you can pass here optional config described below
|
|
27
|
-
adaptiveThemes: true
|
|
26
|
+
adaptiveThemes: true,
|
|
28
27
|
});
|
package/build/types/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface CliFlags {
|
|
|
6
6
|
packageManager: PackageManager;
|
|
7
7
|
}
|
|
8
8
|
export declare const availablePackages: readonly ["@react-navigation/drawer", "expo-router", "expoRouter", "firebase", "nativewind", "react-navigation", "reactNavigation", "react-native-gesture-handler", "react-native-reanimated", "reactnavigation", "stylesheet", "supabase", "tamagui", "restyle", "unistyles"];
|
|
9
|
-
export type NavigationTypes = 'stack' | 'tabs' | 'drawer' | undefined;
|
|
9
|
+
export type NavigationTypes = 'stack' | 'tabs' | 'drawer + tabs' | undefined;
|
|
10
10
|
export type PackageManager = 'yarn' | 'npm' | 'pnpm' | 'bun';
|
|
11
11
|
export type AvailablePackages = {
|
|
12
12
|
name: (typeof availablePackages)[number];
|