create-expo-stack 2.4.3 → 2.5.0-next.160eed8
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 +4 -4
- package/build/commands/create-expo-stack.js +12 -4
- package/build/templates/base/App.tsx.ejs +51 -91
- package/build/templates/base/app.json.ejs +6 -0
- package/build/templates/base/components/BackButton.tsx.ejs +23 -0
- package/build/templates/base/components/Button.tsx.ejs +40 -0
- package/build/templates/base/components/EditScreenInfo.tsx.ejs +55 -0
- package/build/templates/base/components/HeaderButton.tsx.ejs +28 -0
- package/build/templates/base/components/ScreenContent.tsx.ejs +38 -0
- package/build/templates/base/components/TabBarIcon.tsx.ejs +15 -0
- package/build/templates/base/package.json.ejs +16 -6
- package/build/templates/base/prettier.config.js.ejs +11 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +1 -13
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/index.tsx.ejs +18 -84
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/two.tsx.ejs +18 -84
- package/build/templates/packages/expo-router/drawer/app/(drawer)/_layout.tsx.ejs +4 -18
- package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +12 -80
- package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +4 -0
- package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +16 -92
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +3 -0
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +17 -171
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +23 -187
- package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +6 -50
- package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +18 -84
- package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +18 -83
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +3 -0
- package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +17 -92
- package/build/templates/packages/i18next/components/InternalizationExample.tsx.ejs +23 -0
- package/build/templates/packages/i18next/core/i18n/fallbackChecker.ts.ejs +13 -0
- package/build/templates/packages/i18next/core/i18n/init.ts.ejs +24 -0
- package/build/templates/packages/i18next/core/i18n/languageDetector.ts.ejs +13 -0
- package/build/templates/packages/i18next/translation/en.json.ejs +8 -0
- package/build/templates/packages/i18next/translation/fr.json.ejs +8 -0
- package/build/templates/packages/i18next/translation/index.ts.ejs +20 -0
- package/build/templates/packages/nativewind/components/BackButton.tsx.ejs +18 -0
- package/build/templates/packages/nativewind/components/Button.tsx.ejs +14 -0
- package/build/templates/packages/nativewind/components/EditScreenInfo.tsx.ejs +40 -0
- package/build/templates/packages/nativewind/components/ScreenContent.tsx.ejs +25 -0
- package/build/templates/packages/react-navigation/App.tsx.ejs +4 -1
- package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +14 -26
- package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +2 -101
- package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +8 -62
- package/build/templates/packages/react-navigation/screens/details.tsx.ejs +22 -108
- package/build/templates/packages/react-navigation/screens/home.tsx.ejs +3 -82
- package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +16 -104
- package/build/templates/packages/react-navigation/screens/one.tsx.ejs +2 -97
- package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +37 -182
- package/build/templates/packages/react-navigation/screens/two.tsx.ejs +3 -98
- package/build/templates/packages/restyle/components/BackButton.tsx.ejs +15 -0
- package/build/templates/packages/restyle/components/Button.tsx.ejs +32 -0
- package/build/templates/packages/restyle/components/EditScreenInfo.tsx.ejs +29 -0
- package/build/templates/packages/restyle/components/ScreenContent.tsx.ejs +20 -0
- package/build/templates/packages/tamagui/components/BackButton.tsx.ejs +19 -0
- package/build/templates/packages/tamagui/components/Button.tsx.ejs +9 -0
- package/build/templates/packages/tamagui/components/EditScreenInfo.tsx.ejs +29 -0
- package/build/templates/packages/tamagui/components/ScreenContent.tsx.ejs +22 -0
- package/build/templates/packages/unistyles/components/BackButton.tsx.ejs +26 -0
- package/build/templates/packages/unistyles/components/Button.tsx.ejs +12 -0
- package/build/templates/packages/unistyles/components/EditScreenInfo.tsx.ejs +61 -0
- package/build/templates/packages/unistyles/components/ScreenContent.tsx.ejs +24 -0
- package/build/templates/packages/unistyles/theme.ts.ejs +30 -46
- package/build/types/types.d.ts +3 -2
- package/build/types/utilities/configureProjectFiles.d.ts +1 -1
- package/build/types/utilities/generateProjectFiles.d.ts +1 -1
- package/build/types.js +3 -2
- package/build/utilities/configureProjectFiles.js +86 -19
- package/build/utilities/generateProjectFiles.js +8 -4
- package/build/utilities/runCLI.js +24 -8
- package/build/utilities/showHelp.js +4 -1
- package/package.json +66 -66
- package/build/templates/base/.prettierrc +0 -7
- package/build/templates/packages/expo-router/drawer/components/edit-screen-info.tsx.ejs +0 -153
- package/build/templates/packages/expo-router/index.js +0 -4
- package/build/templates/packages/expo-router/index.ts +0 -1
- package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +0 -153
- package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +0 -180
- package/build/types/templates/packages/expo-router/index.d.ts +0 -1
- /package/build/templates/packages/expo-router/drawer/app/{[...unmatched].tsx.ejs → +not-found.tsx.ejs} +0 -0
- /package/build/templates/packages/expo-router/stack/app/{[...unmatched].tsx.ejs → +not-found.tsx.ejs} +0 -0
- /package/build/templates/packages/expo-router/tabs/app/{[...unmatched].tsx.ejs → +not-found.tsx.ejs} +0 -0
|
@@ -1,188 +1,43 @@
|
|
|
1
|
-
import { useNavigation } from
|
|
2
|
-
import { StackNavigationProp } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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";
|
|
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
|
+
|
|
6
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
7
|
+
import { InternalizationExample } from 'components/InternalizationExample';
|
|
16
8
|
<% } %>
|
|
17
|
-
import { RootStackParamList } from "../navigation";
|
|
18
9
|
|
|
19
|
-
|
|
10
|
+
import { Button } from '../components/Button';
|
|
11
|
+
import { RootStackParamList } from '../navigation';
|
|
12
|
+
|
|
13
|
+
type OverviewScreenNavigationProps = StackNavigationProp<RootStackParamList, 'Overview'>;
|
|
20
14
|
|
|
21
15
|
export default function Overview() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<YStack>
|
|
42
|
-
<Title>Hello World</Title>
|
|
43
|
-
<Subtitle>This is the first page of your app.</Subtitle>
|
|
44
|
-
</YStack>
|
|
45
|
-
<Button onPress={() => navigation.navigate("Details", { name: "Dan" })}>
|
|
46
|
-
<ButtonText>Show Details</ButtonText>
|
|
47
|
-
</Button>
|
|
48
|
-
</Main>
|
|
49
|
-
</Container>
|
|
50
|
-
);
|
|
51
|
-
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
52
|
-
const styles = useStyles();
|
|
53
|
-
return (
|
|
54
|
-
<Box flex={1} padding="ml_24">
|
|
55
|
-
<Box flex={1} maxWidth={960} justifyContent="space-between">
|
|
56
|
-
<Box>
|
|
57
|
-
<Text variant="extra_large">Hello World</Text>
|
|
58
|
-
<Text variant="large" color="darkGray">
|
|
59
|
-
This is the first page of your app.
|
|
60
|
-
</Text>
|
|
61
|
-
</Box>
|
|
62
|
-
<TouchableOpacity
|
|
63
|
-
style={styles.button}
|
|
64
|
-
onPress={() => navigation.navigate('Details', { name: 'Dan' })}>
|
|
65
|
-
<Text variant="body" textAlign="center" color="white" fontWeight="600">
|
|
66
|
-
Show Details
|
|
67
|
-
</Text>
|
|
68
|
-
</TouchableOpacity>
|
|
69
|
-
</Box>
|
|
70
|
-
</Box>
|
|
71
|
-
);
|
|
72
|
-
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
73
|
-
const { styles, theme } = useStyles(stylesheet)
|
|
74
|
-
return (
|
|
75
|
-
<View style={styles.container}>
|
|
76
|
-
<View style={styles.main}>
|
|
77
|
-
<View>
|
|
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
|
-
</View>
|
|
81
|
-
<TouchableOpacity style={theme.components.button} onPress={() => navigation.navigate('Details', { name: 'Dan' })}>
|
|
82
|
-
<Text style={theme.components.buttonText}>Show Details</Text>
|
|
83
|
-
</TouchableOpacity>
|
|
84
|
-
</View>
|
|
85
|
-
</View>
|
|
86
|
-
);
|
|
87
|
-
<% } else { %>
|
|
88
|
-
return (
|
|
89
|
-
<View style={styles.container}>
|
|
90
|
-
<View style={styles.main}>
|
|
91
|
-
<View>
|
|
92
|
-
<Text style={styles.title}>Hello World</Text>
|
|
93
|
-
<Text style={styles.subtitle}>This is the first page of your app.</Text>
|
|
94
|
-
</View>
|
|
95
|
-
<TouchableOpacity style={styles.button} onPress={() => navigation.navigate("Details", { name: "Dan" })}>
|
|
96
|
-
<Text style={styles.buttonText}>Show Details</Text>
|
|
97
|
-
</TouchableOpacity>
|
|
98
|
-
</View>
|
|
99
|
-
</View>
|
|
100
|
-
);
|
|
101
|
-
<% } %>
|
|
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
|
+
);
|
|
102
35
|
}
|
|
103
36
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
subtitle: "text-4xl text-gray-700",
|
|
112
|
-
};
|
|
113
|
-
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
114
|
-
const useStyles = makeStyles((theme) => ({
|
|
115
|
-
button: {
|
|
116
|
-
alignItems: 'center',
|
|
117
|
-
backgroundColor: theme.colors.purple,
|
|
118
|
-
borderRadius: theme.borderRadii.xl_24,
|
|
119
|
-
elevation: 5,
|
|
120
|
-
flexDirection: 'row',
|
|
121
|
-
justifyContent: 'center',
|
|
122
|
-
padding: theme.spacing.m_16,
|
|
123
|
-
shadowColor: theme.colors.black,
|
|
124
|
-
shadowOffset: {
|
|
125
|
-
height: 2,
|
|
126
|
-
width: 0,
|
|
127
|
-
},
|
|
128
|
-
shadowOpacity: 0.25,
|
|
129
|
-
shadowRadius: 3.84,
|
|
130
|
-
},
|
|
131
|
-
}));
|
|
132
|
-
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
133
|
-
const stylesheet = createStyleSheet({
|
|
134
|
-
container: {
|
|
135
|
-
flex: 1,
|
|
136
|
-
padding: 24,
|
|
137
|
-
},
|
|
138
|
-
main: {
|
|
139
|
-
flex: 1,
|
|
140
|
-
maxWidth: 960,
|
|
141
|
-
marginHorizontal: 'auto',
|
|
142
|
-
justifyContent: 'space-between',
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
146
|
-
const styles = StyleSheet.create({
|
|
147
|
-
button: {
|
|
148
|
-
alignItems: "center",
|
|
149
|
-
backgroundColor: "#6366F1",
|
|
150
|
-
borderRadius: 24,
|
|
151
|
-
elevation: 5,
|
|
152
|
-
flexDirection: "row",
|
|
153
|
-
justifyContent: "center",
|
|
154
|
-
padding: 16,
|
|
155
|
-
shadowColor: "#000",
|
|
156
|
-
shadowOffset: {
|
|
157
|
-
height: 2,
|
|
158
|
-
width: 0
|
|
159
|
-
},
|
|
160
|
-
shadowOpacity: 0.25,
|
|
161
|
-
shadowRadius: 3.84
|
|
162
|
-
},
|
|
163
|
-
buttonText: {
|
|
164
|
-
color: "#FFFFFF",
|
|
165
|
-
fontSize: 16,
|
|
166
|
-
fontWeight: "600",
|
|
167
|
-
textAlign: "center",
|
|
168
|
-
},
|
|
169
|
-
container: {
|
|
170
|
-
flex: 1,
|
|
171
|
-
padding: 24,
|
|
172
|
-
},
|
|
173
|
-
main: {
|
|
174
|
-
flex: 1,
|
|
175
|
-
maxWidth: 960,
|
|
176
|
-
marginHorizontal: "auto",
|
|
177
|
-
justifyContent: "space-between",
|
|
178
|
-
},
|
|
179
|
-
title: {
|
|
180
|
-
fontSize: 64,
|
|
181
|
-
fontWeight: "bold",
|
|
182
|
-
},
|
|
183
|
-
subtitle: {
|
|
184
|
-
color: "#38434D",
|
|
185
|
-
fontSize: 36,
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
<% } %>
|
|
37
|
+
|
|
38
|
+
export const styles = StyleSheet.create({
|
|
39
|
+
container: {
|
|
40
|
+
flex: 1,
|
|
41
|
+
padding: 24,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
@@ -1,100 +1,5 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
18
|
-
|
|
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,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
|
+
}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Text, TouchableOpacity } from 'react-native';
|
|
2
|
+
import { useStyles } from 'react-native-unistyles';
|
|
3
|
+
|
|
4
|
+
export const Button = ({ onPress, title }: { onPress: () => void; title: string }) => {
|
|
5
|
+
const { theme } = useStyles();
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<TouchableOpacity style={theme.components.button} onPress={onPress}>
|
|
9
|
+
<Text style={theme.components.buttonText}>{title}</Text>
|
|
10
|
+
</TouchableOpacity>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Text, View } from 'react-native';
|
|
2
|
+
import { createStyleSheet, useStyles } from 'react-native-unistyles';
|
|
3
|
+
|
|
4
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
<% } %>
|
|
7
|
+
|
|
8
|
+
export const EditScreenInfo = ({ path }: { path: string }) => {
|
|
9
|
+
const { styles } = useStyles(stylesheet);
|
|
10
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
11
|
+
const { t } = useTranslation();
|
|
12
|
+
const title = t('getStarted');
|
|
13
|
+
const description = t('changeCode')
|
|
14
|
+
<% } else { %>
|
|
15
|
+
const title = "Open up the code for this screen:"
|
|
16
|
+
const description = "Change any of the text, save the file, and your app will automatically update."
|
|
17
|
+
<% } %>
|
|
18
|
+
return (
|
|
19
|
+
<View>
|
|
20
|
+
<View style={styles.getStartedContainer}>
|
|
21
|
+
<Text style={styles.getStartedText}>{title}</Text>
|
|
22
|
+
<View style={[styles.codeHighlightContainer, styles.homeScreenFilename]}>
|
|
23
|
+
<Text>{path}</Text>
|
|
24
|
+
</View>
|
|
25
|
+
<Text style={styles.getStartedText}>
|
|
26
|
+
{description}
|
|
27
|
+
</Text>
|
|
28
|
+
</View>
|
|
29
|
+
</View>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const stylesheet = createStyleSheet({
|
|
34
|
+
codeHighlightContainer: {
|
|
35
|
+
borderRadius: 3,
|
|
36
|
+
paddingHorizontal: 4,
|
|
37
|
+
},
|
|
38
|
+
getStartedContainer: {
|
|
39
|
+
alignItems: 'center',
|
|
40
|
+
marginHorizontal: 50,
|
|
41
|
+
},
|
|
42
|
+
getStartedText: {
|
|
43
|
+
fontSize: 17,
|
|
44
|
+
lineHeight: 24,
|
|
45
|
+
textAlign: 'center',
|
|
46
|
+
},
|
|
47
|
+
helpContainer: {
|
|
48
|
+
alignItems: 'center',
|
|
49
|
+
marginHorizontal: 20,
|
|
50
|
+
marginTop: 15,
|
|
51
|
+
},
|
|
52
|
+
helpLink: {
|
|
53
|
+
paddingVertical: 15,
|
|
54
|
+
},
|
|
55
|
+
helpLinkText: {
|
|
56
|
+
textAlign: 'center',
|
|
57
|
+
},
|
|
58
|
+
homeScreenFilename: {
|
|
59
|
+
marginVertical: 7,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Text, View } from 'react-native';
|
|
2
|
+
import { useStyles } from 'react-native-unistyles';
|
|
3
|
+
|
|
4
|
+
import { EditScreenInfo } from './EditScreenInfo';
|
|
5
|
+
|
|
6
|
+
type ScreenContentProps = {
|
|
7
|
+
title: string;
|
|
8
|
+
path: string;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export const ScreenContent = ({ title, path, children } : ScreenContentProps) => {
|
|
14
|
+
const { theme } = useStyles();
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<View style={theme.components.container}>
|
|
18
|
+
<Text style={theme.components.title}>{title}</Text>
|
|
19
|
+
<View style={theme.components.separator} />
|
|
20
|
+
<EditScreenInfo path={path} />
|
|
21
|
+
{children}
|
|
22
|
+
</View>
|
|
23
|
+
);
|
|
24
|
+
};
|