create-expo-stack 2.1.19 → 2.1.20
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/templates/packages/expo-router/stack/app/_layout.tsx.ejs +3 -3
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +21 -22
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +36 -39
- package/build/templates/packages/tamagui/tamagui.config.ts.ejs +57 -51
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { Feather } from "@expo/vector-icons";
|
|
|
4
4
|
import { Text, TouchableOpacity, View } from "react-native";
|
|
5
5
|
<% } else if (props.stylingPackage?.name === "tamagui") { %>
|
|
6
6
|
import React, { useEffect } from "react";
|
|
7
|
-
import { TamaguiProvider, Button } from "tamagui";
|
|
7
|
+
import { TamaguiProvider, Button, Text } from "tamagui";
|
|
8
8
|
import { useFonts } from "expo-font";
|
|
9
9
|
import { Stack, useRouter, SplashScreen } from "expo-router";
|
|
10
10
|
|
|
@@ -42,7 +42,7 @@ export default function Layout() {
|
|
|
42
42
|
if (!loaded) return null;
|
|
43
43
|
|
|
44
44
|
const BackButton = () => (
|
|
45
|
-
<Button onPress={router.back} icon={<Feather name="chevron-left" size={16} color="#007AFF" />}>Back</Button>
|
|
45
|
+
<Button unstyled flexDirection="row" backgroundColor="transparent" paddingLeft={0} pressStyle={{ opacity: 0.5 }} onPress={router.back} icon={<Feather name="chevron-left" size={16} color="#007AFF" />}><Text color="#007AFF">Back</Text></Button>
|
|
46
46
|
)
|
|
47
47
|
<% } else { %>
|
|
48
48
|
const BackButton = () => (
|
|
@@ -58,7 +58,7 @@ export default function Layout() {
|
|
|
58
58
|
return (
|
|
59
59
|
<% if (props.stylingPackage?.name === "tamagui") { %>
|
|
60
60
|
<TamaguiProvider config={config}>
|
|
61
|
-
|
|
61
|
+
<% } %>
|
|
62
62
|
<Stack>
|
|
63
63
|
<Stack.Screen name="index" options={{ title: "Overview" }} />
|
|
64
64
|
<Stack.Screen name="details"
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
2
2
|
import { View, Text } from "react-native";
|
|
3
3
|
<% } else if (props.stylingPackage?.name === "tamagui") { %>
|
|
4
|
-
import { YStack
|
|
4
|
+
import { YStack } from "tamagui";
|
|
5
|
+
import { Container, Main, Subtitle, Title } from "../tamagui.config";
|
|
5
6
|
<% } else { %>
|
|
6
7
|
import { StyleSheet, View, Text } from "react-native";
|
|
7
8
|
<% } %>
|
|
@@ -9,34 +10,32 @@ import { useLocalSearchParams } from "expo-router";
|
|
|
9
10
|
|
|
10
11
|
export default function Details() {
|
|
11
12
|
const { name } = useLocalSearchParams();
|
|
13
|
+
return (
|
|
12
14
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
13
|
-
|
|
14
|
-
<View className={styles.
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
<Text className={styles.subtitle}>Showing details for user {name}.</Text>
|
|
18
|
-
</View>
|
|
15
|
+
<View className={styles.container}>
|
|
16
|
+
<View className={styles.main}>
|
|
17
|
+
<Text className={styles.title}>Details</Text>
|
|
18
|
+
<Text className={styles.subtitle}>Showing details for user {name}.</Text>
|
|
19
19
|
</View>
|
|
20
|
-
|
|
20
|
+
</View>
|
|
21
21
|
<% } else if (props.stylingPackage?.name === "tamagui") { %>
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
<YStack
|
|
25
|
-
<
|
|
26
|
-
<
|
|
22
|
+
<Container>
|
|
23
|
+
<Main>
|
|
24
|
+
<YStack>
|
|
25
|
+
<Title>Details</Title>
|
|
26
|
+
<Subtitle>Showing details for user {name}.</Subtitle>
|
|
27
27
|
</YStack>
|
|
28
|
-
</
|
|
29
|
-
|
|
28
|
+
</Main>
|
|
29
|
+
</Container>
|
|
30
30
|
<% } else { %>
|
|
31
|
-
|
|
32
|
-
<View style={styles.
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
<Text style={styles.subtitle}>Showing details for user {name}.</Text>
|
|
36
|
-
</View>
|
|
31
|
+
<View style={styles.container}>
|
|
32
|
+
<View style={styles.main}>
|
|
33
|
+
<Text style={styles.title}>Details</Text>
|
|
34
|
+
<Text style={styles.subtitle}>Showing details for user {name}.</Text>
|
|
37
35
|
</View>
|
|
38
|
-
|
|
36
|
+
</View>
|
|
39
37
|
<% } %>
|
|
38
|
+
);
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
@@ -1,60 +1,57 @@
|
|
|
1
1
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
2
2
|
import { Text, TouchableOpacity, View } from "react-native";
|
|
3
3
|
<% } else if (props.stylingPackage?.name === "tamagui") { %>
|
|
4
|
-
import { YStack
|
|
4
|
+
import { YStack } from "tamagui";
|
|
5
|
+
import { Container, Main, Title, Subtitle, Button, ButtonText } from '../tamagui.config';
|
|
5
6
|
<% } else { %>
|
|
6
7
|
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
7
8
|
<% } %>
|
|
8
9
|
import { Link } from "expo-router";
|
|
9
10
|
|
|
10
11
|
export default function Page() {
|
|
12
|
+
return (
|
|
11
13
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
12
|
-
|
|
13
|
-
<View className={styles.
|
|
14
|
-
<View
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
<Text className={styles.subtitle}>This is the first page of your app.</Text>
|
|
18
|
-
</View>
|
|
19
|
-
<Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
|
|
20
|
-
<TouchableOpacity className={styles.button} >
|
|
21
|
-
<Text className={styles.buttonText}>Show Details</Text>
|
|
22
|
-
</TouchableOpacity>
|
|
23
|
-
</Link>
|
|
14
|
+
<View className={styles.container}>
|
|
15
|
+
<View className={styles.main}>
|
|
16
|
+
<View>
|
|
17
|
+
<Text className={styles.title}>Hello World</Text>
|
|
18
|
+
<Text className={styles.subtitle}>This is the first page of your app.</Text>
|
|
24
19
|
</View>
|
|
20
|
+
<Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
|
|
21
|
+
<TouchableOpacity className={styles.button} >
|
|
22
|
+
<Text className={styles.buttonText}>Show Details</Text>
|
|
23
|
+
</TouchableOpacity>
|
|
24
|
+
</Link>
|
|
25
25
|
</View>
|
|
26
|
-
|
|
26
|
+
</View>
|
|
27
27
|
<% } else if (props.stylingPackage?.name === "tamagui") { %>
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
<YStack
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
<Paragraph>This is the first page of your app.</Paragraph>
|
|
34
|
-
</YStack>
|
|
35
|
-
<Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
|
|
36
|
-
<Button>Show Details</Button>
|
|
37
|
-
</Link>
|
|
28
|
+
<Container>
|
|
29
|
+
<Main>
|
|
30
|
+
<YStack>
|
|
31
|
+
<Title>Hello World</Title>
|
|
32
|
+
<Subtitle>This is the first page of your app.</Subtitle>
|
|
38
33
|
</YStack>
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
<Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
|
|
35
|
+
<Button><ButtonText>Show Details</ButtonText></Button>
|
|
36
|
+
</Link>
|
|
37
|
+
</Main>
|
|
38
|
+
</Container>
|
|
41
39
|
<% } else { %>
|
|
42
|
-
|
|
43
|
-
<View style={styles.
|
|
44
|
-
<View
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
<Text style={styles.subtitle}>This is the first page of your app.</Text>
|
|
48
|
-
</View>
|
|
49
|
-
<Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
|
|
50
|
-
<TouchableOpacity style={styles.button} >
|
|
51
|
-
<Text style={styles.buttonText}>Show Details</Text>
|
|
52
|
-
</TouchableOpacity>
|
|
53
|
-
</Link>
|
|
40
|
+
<View style={styles.container}>
|
|
41
|
+
<View style={styles.main}>
|
|
42
|
+
<View>
|
|
43
|
+
<Text style={styles.title}>Hello World</Text>
|
|
44
|
+
<Text style={styles.subtitle}>This is the first page of your app.</Text>
|
|
54
45
|
</View>
|
|
46
|
+
<Link href={{ pathname: "/details", params: { name: "Dan" } }} asChild>
|
|
47
|
+
<TouchableOpacity style={styles.button} >
|
|
48
|
+
<Text style={styles.buttonText}>Show Details</Text>
|
|
49
|
+
</TouchableOpacity>
|
|
50
|
+
</Link>
|
|
55
51
|
</View>
|
|
56
|
-
|
|
52
|
+
</View>
|
|
57
53
|
<% } %>
|
|
54
|
+
);
|
|
58
55
|
}
|
|
59
56
|
|
|
60
57
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createInterFont } from
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { createAnimations } from "@tamagui/animations-react-native";
|
|
2
|
+
import { createInterFont } from "@tamagui/font-inter";
|
|
3
|
+
import { createMedia } from "@tamagui/react-native-media-driver";
|
|
4
|
+
import { shorthands } from "@tamagui/shorthands";
|
|
5
|
+
import { themes, tokens } from "@tamagui/themes";
|
|
6
|
+
import { createTamagui, styled, Text, YStack } from "tamagui";
|
|
7
7
|
|
|
8
8
|
export const animations = createAnimations({
|
|
9
9
|
bouncy: {
|
|
@@ -23,54 +23,60 @@ export const animations = createAnimations({
|
|
|
23
23
|
mass: 1.2,
|
|
24
24
|
stiffness: 250,
|
|
25
25
|
},
|
|
26
|
-
})
|
|
26
|
+
});
|
|
27
27
|
|
|
28
|
-
const headingFont = createInterFont(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
28
|
+
const headingFont = createInterFont();
|
|
29
|
+
|
|
30
|
+
const bodyFont = createInterFont();
|
|
31
|
+
|
|
32
|
+
export const Container = styled(YStack, {
|
|
33
|
+
flex: 1,
|
|
34
|
+
padding: 24,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const Main = styled(YStack, {
|
|
38
|
+
flex: 1,
|
|
39
|
+
maxWidth: 960,
|
|
40
|
+
justifyContent: 'space-between',
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
export const Title = styled(Text, {
|
|
44
|
+
fontSize: 64,
|
|
45
|
+
fontWeight: 'bold',
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const Subtitle = styled(Text, {
|
|
49
|
+
color: '#38434D',
|
|
50
|
+
fontSize: 36,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export const Button = styled(YStack, {
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
backgroundColor: '#6366F1',
|
|
56
|
+
borderRadius: 24,
|
|
57
|
+
justifyContent: 'center',
|
|
58
|
+
padding: 16,
|
|
59
|
+
shadowColor: '#000',
|
|
60
|
+
shadowOffset: {
|
|
61
|
+
height: 2,
|
|
62
|
+
width: 0,
|
|
54
63
|
},
|
|
55
|
-
|
|
56
|
-
|
|
64
|
+
shadowOpacity: 0.25,
|
|
65
|
+
shadowRadius: 3.84,
|
|
66
|
+
hoverStyle: {
|
|
67
|
+
backgroundColor: '#5a5fcf',
|
|
57
68
|
},
|
|
58
|
-
})
|
|
69
|
+
});
|
|
59
70
|
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
sizeSize: (size) => Math.round(size * 1.1),
|
|
68
|
-
sizeLineHeight: (size) => Math.round(size * 1.1 + (size > 20 ? 10 : 10)),
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
+
export const ButtonText = styled(Text, {
|
|
72
|
+
color: '#FFFFFF',
|
|
73
|
+
fontSize: 16,
|
|
74
|
+
fontWeight: '600',
|
|
75
|
+
textAlign: 'center',
|
|
76
|
+
});
|
|
71
77
|
|
|
72
78
|
const config = createTamagui({
|
|
73
|
-
defaultFont:
|
|
79
|
+
defaultFont: "body",
|
|
74
80
|
animations,
|
|
75
81
|
shouldAddPrefersColorThemes: true,
|
|
76
82
|
themeClassNameOnRoot: true,
|
|
@@ -94,9 +100,9 @@ const config = createTamagui({
|
|
|
94
100
|
gtLg: { minWidth: 1280 + 1 },
|
|
95
101
|
short: { maxHeight: 820 },
|
|
96
102
|
tall: { minHeight: 820 },
|
|
97
|
-
hoverNone: { hover:
|
|
98
|
-
pointerCoarse: { pointer:
|
|
103
|
+
hoverNone: { hover: "none" },
|
|
104
|
+
pointerCoarse: { pointer: "coarse" },
|
|
99
105
|
}),
|
|
100
|
-
})
|
|
106
|
+
});
|
|
101
107
|
|
|
102
108
|
export default config;
|