create-expo-stack 2.5.0-next.738ca1b → 2.5.0-next.77e2bc3

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.
Files changed (55) hide show
  1. package/build/templates/base/App.tsx.ejs +44 -110
  2. package/build/templates/base/components/BackButton.tsx.ejs +23 -0
  3. package/build/templates/base/components/Button.tsx.ejs +40 -0
  4. package/build/templates/base/components/EditScreenInfo.tsx.ejs +55 -0
  5. package/build/templates/base/components/HeaderButton.tsx.ejs +28 -0
  6. package/build/templates/base/components/ScreenContent.tsx.ejs +38 -0
  7. package/build/templates/base/components/TabBarIcon.tsx.ejs +15 -0
  8. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +1 -13
  9. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/index.tsx.ejs +18 -84
  10. package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/two.tsx.ejs +18 -84
  11. package/build/templates/packages/expo-router/drawer/app/(drawer)/_layout.tsx.ejs +4 -18
  12. package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +12 -98
  13. package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +16 -92
  14. package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +17 -171
  15. package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +20 -202
  16. package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +6 -50
  17. package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +18 -102
  18. package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +18 -83
  19. package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +17 -92
  20. package/build/templates/packages/i18next/components/InternalizationExample.tsx.ejs +1 -1
  21. package/build/templates/packages/i18next/translation/en.json.ejs +3 -3
  22. package/build/templates/packages/i18next/translation/fr.json.ejs +3 -3
  23. package/build/templates/packages/nativewind/components/BackButton.tsx.ejs +18 -0
  24. package/build/templates/packages/nativewind/components/Button.tsx.ejs +14 -0
  25. package/build/templates/packages/nativewind/components/EditScreenInfo.tsx.ejs +40 -0
  26. package/build/templates/packages/nativewind/components/ScreenContent.tsx.ejs +25 -0
  27. package/build/templates/packages/react-navigation/App.tsx.ejs +1 -1
  28. package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +14 -26
  29. package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +2 -101
  30. package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +8 -62
  31. package/build/templates/packages/react-navigation/screens/details.tsx.ejs +22 -108
  32. package/build/templates/packages/react-navigation/screens/home.tsx.ejs +3 -100
  33. package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +16 -104
  34. package/build/templates/packages/react-navigation/screens/one.tsx.ejs +2 -115
  35. package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +37 -199
  36. package/build/templates/packages/react-navigation/screens/two.tsx.ejs +3 -98
  37. package/build/templates/packages/restyle/components/BackButton.tsx.ejs +15 -0
  38. package/build/templates/packages/restyle/components/Button.tsx.ejs +32 -0
  39. package/build/templates/packages/restyle/components/EditScreenInfo.tsx.ejs +29 -0
  40. package/build/templates/packages/restyle/components/ScreenContent.tsx.ejs +20 -0
  41. package/build/templates/packages/tamagui/components/BackButton.tsx.ejs +19 -0
  42. package/build/templates/packages/tamagui/components/Button.tsx.ejs +9 -0
  43. package/build/templates/packages/tamagui/components/EditScreenInfo.tsx.ejs +29 -0
  44. package/build/templates/packages/tamagui/components/ScreenContent.tsx.ejs +22 -0
  45. package/build/templates/packages/unistyles/components/BackButton.tsx.ejs +26 -0
  46. package/build/templates/packages/unistyles/components/Button.tsx.ejs +12 -0
  47. package/build/templates/packages/unistyles/components/EditScreenInfo.tsx.ejs +61 -0
  48. package/build/templates/packages/unistyles/components/ScreenContent.tsx.ejs +24 -0
  49. package/build/templates/packages/unistyles/theme.ts.ejs +30 -46
  50. package/build/utilities/configureProjectFiles.js +68 -10
  51. package/build/utilities/generateProjectFiles.js +2 -2
  52. package/package.json +1 -1
  53. package/build/templates/packages/expo-router/drawer/components/edit-screen-info.tsx.ejs +0 -153
  54. package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +0 -153
  55. package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +0 -180
@@ -1,118 +1,5 @@
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, makeStyles } 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
- <% } %>
13
- <% if (props.internalizationPackage?.name === "i18next") { %>
14
- import { InternalizationExample } from '../../components/InternalizationExample';
15
- <% } %>
16
-
17
- import EditScreenInfo from "../components/edit-screen-info";
1
+ import { ScreenContent } from 'components/ScreenContent';
18
2
 
19
3
  export default function TabOneScreen() {
20
- <% if (props.stylingPackage?.name === "nativewind") { %>
21
- return (
22
- <View className={styles.container}>
23
- <Text className={styles.title}>Tab One</Text>
24
- <% if (props.internalizationPackage?.name === "i18next") { %>
25
- <InternalizationExample />
26
- <% } %>
27
- <View className={styles.separator} />
28
- <EditScreenInfo path="src/screens/one.tsx" />
29
- </View>
30
- );
31
- <% } else if (props.stylingPackage?.name === "tamagui") { %>
32
- return (
33
- <Theme name="light">
34
- <YStack flex={1} alignItems="center" justifyContent="center">
35
- <H2>Tab One</H2>
36
- <% if (props.internalizationPackage?.name === "i18next") { %>
37
- <InternalizationExample />
38
- <% } %>
39
- <Separator />
40
- <EditScreenInfo path="src/screens/one.tsx" />
41
- </YStack>
42
- </Theme>
43
- );
44
- <% } else if (props.stylingPackage?.name === "restyle") { %>
45
- const styles = useStyles();
46
-
47
- return (
48
- <Box flex={1} alignItems="center" justifyContent="center">
49
- <Text variant="title">Tab One</Text>
50
- <% if (props.internalizationPackage?.name === "i18next") { %>
51
- <InternalizationExample />
52
- <% } %>
53
- <Box style={styles.separator} />
54
- <EditScreenInfo path="src/screens/one.tsx" />
55
- </Box>
56
- );
57
- <% } else if (props.stylingPackage?.name === "unistyles") { %>
58
- const { theme } = useStyles()
59
- return (
60
- <View style={theme.components.container}>
61
- <Text style={theme.components.title}>Tab One</Text>
62
- <% if (props.internalizationPackage?.name === "i18next") { %>
63
- <InternalizationExample />
64
- <% } %>
65
- <View style={theme.components.separator} />
66
- <EditScreenInfo path='src/screens/one.tsx' />
67
- </View>
68
- );
69
- <% } else { %>
70
- return (
71
- <View style={styles.container}>
72
- <Text style={styles.title}>Tab One</Text>
73
- <% if (props.internalizationPackage?.name === "i18next") { %>
74
- <InternalizationExample />
75
- <% } %>
76
- <View style={styles.separator} />
77
- <EditScreenInfo path="src/screens/one.tsx" />
78
- </View>
79
- );
80
- <% } %>
4
+ return <ScreenContent path="screens/one.tsx" title="Tab One" />;
81
5
  }
82
-
83
- <% if (props.stylingPackage?.name === "nativewind") { %>
84
- const styles = {
85
- container: "items-center flex-1 justify-center",
86
- separator: "h-[1px] my-7 w-4/5 bg-gray-200",
87
- title: "text-xl font-bold"
88
- };
89
- <% } else if (props.stylingPackage?.name === "restyle") { %>
90
- const useStyles = makeStyles((theme) => ({
91
- separator: {
92
- backgroundColor: theme.colors.gray,
93
- height: 1,
94
- marginVertical: theme.spacing.l_32,
95
- opacity: 0.25,
96
- width: '80%',
97
- },
98
- }));
99
- <% } else if (props.stylingPackage?.name === "stylesheet") { %>
100
- const styles = StyleSheet.create({
101
- container: {
102
- alignItems: "center",
103
- flex: 1,
104
- justifyContent: "center",
105
- },
106
- separator: {
107
- backgroundColor: "gray",
108
- height: 1,
109
- marginVertical: 30,
110
- opacity: 0.25,
111
- width: "80%",
112
- },
113
- title: {
114
- fontSize: 20,
115
- fontWeight: "bold",
116
- }
117
- });
118
- <% } %>
@@ -1,205 +1,43 @@
1
- import { useNavigation } from "@react-navigation/native";
2
- import { StackNavigationProp } from "@react-navigation/stack";
3
- <% if (props.stylingPackage?.name === "nativewind") { %>
4
- import { Text, TouchableOpacity, View } from "react-native";
5
- <% } else if (props.stylingPackage?.name === "tamagui") { %>
6
- import { YStack } from "tamagui";
7
- import { Container, Main, Title, Subtitle, Button, ButtonText } from '../../tamagui.config';
8
- <% } else if (props.stylingPackage?.name === "restyle") { %>
9
- import { TouchableOpacity } from 'react-native';
10
- import { Box, Text, makeStyles } from 'theme';
11
- <% } else if (props.stylingPackage?.name === "unistyles") { %>
12
- import { createStyleSheet, useStyles } from 'react-native-unistyles'
13
- import { Text, TouchableOpacity, View } from 'react-native';
14
- <% } else { %>
15
- import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
16
- <% } %>
17
- import { RootStackParamList } from "../navigation";
1
+ import { useNavigation } from '@react-navigation/native';
2
+ import { StackNavigationProp } from '@react-navigation/stack';
3
+ import { ScreenContent } from 'components/ScreenContent';
4
+ import { StyleSheet, View } from 'react-native';
5
+
18
6
  <% if (props.internalizationPackage?.name === "i18next") { %>
19
- import { InternalizationExample } from '../../components/InternalizationExample';
7
+ import { InternalizationExample } from 'components/InternalizationExample';
20
8
  <% } %>
21
- type OverviewScreenNavigationProps = StackNavigationProp<RootStackParamList, "Overview">;
9
+
10
+ import { Button } from '../components/Button';
11
+ import { RootStackParamList } from '../navigation';
12
+
13
+ type OverviewScreenNavigationProps = StackNavigationProp<RootStackParamList, 'Overview'>;
22
14
 
23
15
  export default function Overview() {
24
- const navigation = useNavigation<OverviewScreenNavigationProps>();
25
- <% if (props.stylingPackage?.name === "nativewind") { %>
26
- return (
27
- <View className={styles.container}>
28
- <View className={styles.main}>
29
- <View>
30
- <Text className={styles.title}>Hello World</Text>
31
- <Text className={styles.subtitle}>This is the first page of your app.</Text>
32
- <% if (props.internalizationPackage?.name === "i18next") { %>
33
- <InternalizationExample />
34
- <% } %>
35
- </View>
36
- <TouchableOpacity className={styles.button} onPress={() => navigation.navigate("Details", { name: "Dan" })}>
37
- <Text className={styles.buttonText}>Show Details</Text>
38
- </TouchableOpacity>
39
- </View>
40
- </View>
41
- );
42
- <% } else if (props.stylingPackage?.name === "tamagui") { %>
43
- return (
44
- <Container>
45
- <Main>
46
- <YStack>
47
- <Title>Hello World</Title>
48
- <Subtitle>This is the first page of your app.</Subtitle>
49
- <% if (props.internalizationPackage?.name === "i18next") { %>
50
- <InternalizationExample />
51
- <% } %>
52
- </YStack>
53
- <Button onPress={() => navigation.navigate("Details", { name: "Dan" })}>
54
- <ButtonText>Show Details</ButtonText>
55
- </Button>
56
- </Main>
57
- </Container>
58
- );
59
- <% } else if (props.stylingPackage?.name === "restyle") { %>
60
- const styles = useStyles();
61
- return (
62
- <Box flex={1} padding="ml_24">
63
- <Box flex={1} maxWidth={960} justifyContent="space-between">
64
- <Box>
65
- <Text variant="extra_large">Hello World</Text>
66
- <Text variant="large" color="darkGray">
67
- This is the first page of your app.
68
- </Text>
69
- <% if (props.internalizationPackage?.name === "i18next") { %>
70
- <InternalizationExample />
71
- <% } %>
72
- </Box>
73
- <TouchableOpacity
74
- style={styles.button}
75
- onPress={() => navigation.navigate('Details', { name: 'Dan' })}>
76
- <Text variant="body" textAlign="center" color="white" fontWeight="600">
77
- Show Details
78
- </Text>
79
- </TouchableOpacity>
80
- </Box>
81
- </Box>
82
- );
83
- <% } else if (props.stylingPackage?.name === "unistyles") { %>
84
- const { styles, theme } = useStyles(stylesheet)
85
- return (
86
- <View style={styles.container}>
87
- <View style={styles.main}>
88
- <View>
89
- <Text style={theme.components.title}>Hello World</Text>
90
- <Text style={theme.components.subtitle}>This is the first page of your app.</Text>
91
- <% if (props.internalizationPackage?.name === "i18next") { %>
92
- <InternalizationExample />
93
- <% } %>
94
- </View>
95
- <TouchableOpacity style={theme.components.button} onPress={() => navigation.navigate('Details', { name: 'Dan' })}>
96
- <Text style={theme.components.buttonText}>Show Details</Text>
97
- </TouchableOpacity>
98
- </View>
99
- </View>
100
- );
101
- <% } else { %>
102
- return (
103
- <View style={styles.container}>
104
- <View style={styles.main}>
105
- <View>
106
- <Text style={styles.title}>Hello World</Text>
107
- <Text style={styles.subtitle}>This is the first page of your app.</Text>
108
- <% if (props.internalizationPackage?.name === "i18next") { %>
109
- <InternalizationExample />
110
- <% } %>
111
- </View>
112
- <TouchableOpacity style={styles.button} onPress={() => navigation.navigate("Details", { name: "Dan" })}>
113
- <Text style={styles.buttonText}>Show Details</Text>
114
- </TouchableOpacity>
115
- </View>
116
- </View>
117
- );
118
- <% } %>
16
+ const navigation = useNavigation<OverviewScreenNavigationProps>();
17
+
18
+ return (
19
+ <View style={styles.container}>
20
+ <ScreenContent path="screens/overview.tsx" title="Overview">
21
+ <% if (props.internalizationPackage?.name === "i18next") { %>
22
+ <InternalizationExample />
23
+ <% } %>
24
+ </ScreenContent>
25
+ <Button
26
+ onPress={() =>
27
+ navigation.navigate('Details', {
28
+ name: 'Dan',
29
+ })
30
+ }
31
+ title="Show Details"
32
+ />
33
+ </View>
34
+ );
119
35
  }
120
36
 
121
- <% if (props.stylingPackage?.name === "nativewind") { %>
122
- const styles = {
123
- button: "items-center bg-indigo-500 rounded-[28px] shadow-md p-4",
124
- buttonText: "text-white text-lg font-semibold text-center",
125
- container: "flex-1 p-6",
126
- main: "flex-1 max-w-[960] justify-between",
127
- title: "text-[64px] font-bold",
128
- subtitle: "text-4xl text-gray-700",
129
- };
130
- <% } else if (props.stylingPackage?.name === "restyle") { %>
131
- const useStyles = makeStyles((theme) => ({
132
- button: {
133
- alignItems: 'center',
134
- backgroundColor: theme.colors.purple,
135
- borderRadius: theme.borderRadii.xl_24,
136
- elevation: 5,
137
- flexDirection: 'row',
138
- justifyContent: 'center',
139
- padding: theme.spacing.m_16,
140
- shadowColor: theme.colors.black,
141
- shadowOffset: {
142
- height: 2,
143
- width: 0,
144
- },
145
- shadowOpacity: 0.25,
146
- shadowRadius: 3.84,
147
- },
148
- }));
149
- <% } else if (props.stylingPackage?.name === "unistyles") { %>
150
- const stylesheet = createStyleSheet({
151
- container: {
152
- flex: 1,
153
- padding: 24,
154
- },
155
- main: {
156
- flex: 1,
157
- maxWidth: 960,
158
- marginHorizontal: 'auto',
159
- justifyContent: 'space-between',
160
- },
161
- });
162
- <% } else if (props.stylingPackage?.name === "stylesheet") { %>
163
- const styles = StyleSheet.create({
164
- button: {
165
- alignItems: "center",
166
- backgroundColor: "#6366F1",
167
- borderRadius: 24,
168
- elevation: 5,
169
- flexDirection: "row",
170
- justifyContent: "center",
171
- padding: 16,
172
- shadowColor: "#000",
173
- shadowOffset: {
174
- height: 2,
175
- width: 0
176
- },
177
- shadowOpacity: 0.25,
178
- shadowRadius: 3.84
179
- },
180
- buttonText: {
181
- color: "#FFFFFF",
182
- fontSize: 16,
183
- fontWeight: "600",
184
- textAlign: "center",
185
- },
186
- container: {
187
- flex: 1,
188
- padding: 24,
189
- },
190
- main: {
191
- flex: 1,
192
- maxWidth: 960,
193
- marginHorizontal: "auto",
194
- justifyContent: "space-between",
195
- },
196
- title: {
197
- fontSize: 64,
198
- fontWeight: "bold",
199
- },
200
- subtitle: {
201
- color: "#38434D",
202
- fontSize: 36,
203
- }
204
- });
205
- <% } %>
37
+
38
+ export const styles = StyleSheet.create({
39
+ container: {
40
+ flex: 1,
41
+ padding: 24,
42
+ },
43
+ });
@@ -1,100 +1,5 @@
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, makeStyles } 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
- <% } %>
13
-
14
- import EditScreenInfo from "../components/edit-screen-info";
1
+ import { ScreenContent } from 'components/ScreenContent';
15
2
 
16
3
  export default function TabTwoScreen() {
17
- <% if (props.stylingPackage?.name === "nativewind") { %>
18
- return (
19
- <View className={styles.container}>
20
- <Text className={styles.title}>Tab Two</Text>
21
- <View className={styles.separator} />
22
- <EditScreenInfo path="src/screens/two.tsx" />
23
- </View>
24
- );
25
- <% } else if (props.stylingPackage?.name === "tamagui") { %>
26
- return (
27
- <Theme name="light">
28
- <YStack flex={1} alignItems="center" justifyContent="center">
29
- <H2>Tab Two</H2>
30
- <Separator />
31
- <EditScreenInfo path="src/screens/two.tsx" />
32
- </YStack>
33
- </Theme>
34
- );
35
- <% } else if (props.stylingPackage?.name === "unistyles") { %>
36
- const { theme } = useStyles()
37
- return (
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
- </View>
43
- );
44
- <% } else if (props.stylingPackage?.name === "restyle") { %>
45
- const styles = useStyles();
46
-
47
- return (
48
- <Box flex={1} alignItems="center" justifyContent="center">
49
- <Text variant="title">Tab Two</Text>
50
- <Box style={styles.separator} />
51
- <EditScreenInfo path="src/screens/two.tsx" />
52
- </Box>
53
- );
54
- <% } else { %>
55
- return (
56
- <View style={styles.container}>
57
- <Text style={styles.title}>Tab Two</Text>
58
- <View style={styles.separator} />
59
- <EditScreenInfo path="src/screens/two.tsx" />
60
- </View>
61
- );
62
- <% } %>
63
- }
64
-
65
- <% if (props.stylingPackage?.name === "nativewind") { %>
66
- const styles = {
67
- container: "items-center flex-1 justify-center",
68
- separator: "h-[1px] my-7 w-4/5 bg-gray-200",
69
- title: "text-xl font-bold"
70
- };
71
- <% } else if (props.stylingPackage?.name === "restyle") { %>
72
- const useStyles = makeStyles((theme) => ({
73
- separator: {
74
- backgroundColor: theme.colors.gray,
75
- height: 1,
76
- marginVertical: theme.spacing.l_32,
77
- opacity: 0.25,
78
- width: '80%',
79
- },
80
- }));
81
- <% } else if (props.stylingPackage?.name === "stylesheet") { %>
82
- const styles = StyleSheet.create({
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
- <% } %>
4
+ return <ScreenContent path="screens/two.tsx" title="Tab Two" />;
5
+ }
@@ -0,0 +1,15 @@
1
+ import { Feather } from '@expo/vector-icons';
2
+ import { Box, Text, useTheme } from 'theme';
3
+
4
+ export const BackButton = ({ onPress }: { onPress: () => void }) => {
5
+ const { colors } = useTheme();
6
+
7
+ return (
8
+ <Box flexDirection="row" paddingLeft="m_16">
9
+ <Feather name="chevron-left" size={16} color={colors.blue} />
10
+ <Text marginLeft="xs_4" color="blue" onPress={onPress}>
11
+ Back
12
+ </Text>
13
+ </Box>
14
+ );
15
+ };
@@ -0,0 +1,32 @@
1
+ import { TouchableOpacity } from 'react-native';
2
+ import { Text, makeStyles } from 'theme';
3
+
4
+ export const Button = ({ onPress, title }: { onPress: () => void; title: string }) => {
5
+ const styles = useStyles();
6
+
7
+ return (
8
+ <TouchableOpacity style={styles.button} onPress={onPress}>
9
+ <Text variant="body" textAlign="center" color="white" fontWeight="600">
10
+ {title}
11
+ </Text>
12
+ </TouchableOpacity>
13
+ );
14
+ };
15
+ export const useStyles = makeStyles((theme) => ({
16
+ button: {
17
+ alignItems: 'center',
18
+ backgroundColor: theme.colors.purple,
19
+ borderRadius: theme.borderRadii.xl_24,
20
+ elevation: 5,
21
+ flexDirection: 'row',
22
+ justifyContent: 'center',
23
+ padding: theme.spacing.m_16,
24
+ shadowColor: theme.colors.black,
25
+ shadowOffset: {
26
+ height: 2,
27
+ width: 0,
28
+ },
29
+ shadowOpacity: 0.25,
30
+ shadowRadius: 3.84,
31
+ },
32
+ }));
@@ -0,0 +1,29 @@
1
+ import { Box, Text } from 'theme';
2
+
3
+ <% if (props.internalizationPackage?.name === "i18next") { %>
4
+ import { useTranslation } from 'react-i18next';
5
+ <% } %>
6
+
7
+ export const EditScreenInfo = ({ path }: { path: string }) => {
8
+ <% if (props.internalizationPackage?.name === "i18next") { %>
9
+ const { t } = useTranslation();
10
+ const title = t('getStarted');
11
+ const description = t('changeCode')
12
+ <% } else { %>
13
+ const title = "Open up the code for this screen:"
14
+ const description = "Change any of the text, save the file, and your app will automatically update."
15
+ <% } %>
16
+ return (
17
+ <Box alignItems="center" marginHorizontal="xl_64">
18
+ <Text variant="body" lineHeight={24} textAlign="center">
19
+ {title}
20
+ </Text>
21
+ <Box borderRadius="s_3" paddingHorizontal="xs_4" marginVertical="s_8">
22
+ <Text>{path}</Text>
23
+ </Box>
24
+ <Text variant="body" lineHeight={24} textAlign="center">
25
+ {description}
26
+ </Text>
27
+ </Box>
28
+ );
29
+ };
@@ -0,0 +1,20 @@
1
+ import { Box, Text } from 'theme';
2
+
3
+ import { EditScreenInfo } from './EditScreenInfo';
4
+
5
+ type ScreenContentProps = {
6
+ title: string;
7
+ path: string;
8
+ children?: React.ReactNode;
9
+ };
10
+
11
+ export const ScreenContent = ({ title, path, children }: ScreenContentProps ) => {
12
+ return (
13
+ <Box flex={1} alignItems="center" justifyContent="center">
14
+ <Text variant="title">{title}</Text>
15
+ <Box height={1} marginVertical="l_32" width="80%" backgroundColor="gray" />
16
+ <EditScreenInfo path={path} />
17
+ {children}
18
+ </Box>
19
+ );
20
+ };
@@ -0,0 +1,19 @@
1
+ import { Feather } from '@expo/vector-icons';
2
+ import { Button, Text } from 'tamagui';
3
+
4
+ export const BackButton = ({ onPress }: { onPress: () => void }) => {
5
+ return (
6
+ <Button
7
+ unstyled
8
+ flexDirection="row"
9
+ backgroundColor="transparent"
10
+ pressStyle={{
11
+ opacity: 0.5,
12
+ }}
13
+ paddingLeft={20}
14
+ onPress={onPress}
15
+ icon={<Feather name="chevron-left" size={16} color="#007AFF" />}>
16
+ <Text color="#007AFF">Back</Text>
17
+ </Button>
18
+ );
19
+ };
@@ -0,0 +1,9 @@
1
+ import { Button as TButton, ButtonText } from '../tamagui.config';
2
+
3
+ export const Button = ({ onPress, title }: { onPress: () => void; title: string }) => {
4
+ return (
5
+ <TButton onPress={onPress}>
6
+ <ButtonText>{title}</ButtonText>
7
+ </TButton>
8
+ );
9
+ };
@@ -0,0 +1,29 @@
1
+ import { YStack, H4, Paragraph } from 'tamagui';
2
+
3
+ <% if (props.internalizationPackage?.name === "i18next") { %>
4
+ import { useTranslation } from 'react-i18next';
5
+ <% } %>
6
+
7
+ export const EditScreenInfo = ({ path }: { path: string }) => {
8
+ <% if (props.internalizationPackage?.name === "i18next") { %>
9
+ const { t } = useTranslation();
10
+ const title = t('getStarted');
11
+ const description = t('changeCode')
12
+ <% } else { %>
13
+ const title = "Open up the code for this screen:"
14
+ const description = "Change any of the text, save the file, and your app will automatically update."
15
+ <% } %>
16
+ return (
17
+ <YStack>
18
+ <YStack alignItems="center" marginHorizontal="$6">
19
+ <H4>{title}</H4>
20
+ <YStack borderRadius="$3" marginVertical="$1">
21
+ <Paragraph>{path}</Paragraph>
22
+ </YStack>
23
+ <Paragraph>
24
+ {description}
25
+ </Paragraph>
26
+ </YStack>
27
+ </YStack>
28
+ );
29
+ };
@@ -0,0 +1,22 @@
1
+ import { YStack, H2, Separator, Theme } from 'tamagui';
2
+
3
+ import { EditScreenInfo } from './EditScreenInfo';
4
+
5
+ type ScreenContentProps = {
6
+ title: string;
7
+ path: string;
8
+ children?: React.ReactNode;
9
+ };
10
+
11
+ export const ScreenContent = ({ title, path, children}: ScreenContentProps) => {
12
+ return (
13
+ <Theme name="light">
14
+ <YStack flex={1} alignItems="center" justifyContent="center">
15
+ <H2>{title}</H2>
16
+ <Separator />
17
+ <EditScreenInfo path={path} />
18
+ {children}
19
+ </YStack>
20
+ </Theme>
21
+ );
22
+ };
@@ -0,0 +1,26 @@
1
+ import { Feather } from '@expo/vector-icons';
2
+ import { Text, View } from 'react-native';
3
+ import { createStyleSheet, useStyles } from 'react-native-unistyles';
4
+
5
+ export const BackButton = ({ onPress }: { onPress: () => void; }) => {
6
+ const { styles, theme } = useStyles(stylesheet);
7
+
8
+ return (
9
+ <View style={styles.backButton}>
10
+ <Feather name="chevron-left" size={16} color={theme.colors.azureRadiance} />
11
+ <Text style={styles.backButtonText} onPress={onPress}>
12
+ Back
13
+ </Text>
14
+ </View>
15
+ );
16
+ };
17
+ const stylesheet = createStyleSheet((theme) => ({
18
+ backButton: {
19
+ flexDirection: 'row',
20
+ paddingLeft: 20,
21
+ },
22
+ backButtonText: {
23
+ color: theme.colors.azureRadiance,
24
+ marginLeft: 4,
25
+ },
26
+ }));