create-expo-stack 2.5.0-next.738ca1b → 2.5.0-next.8d1b140

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 (56) 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/build/utilities/showHelp.js +3 -3
  53. package/package.json +1 -1
  54. package/build/templates/packages/expo-router/drawer/components/edit-screen-info.tsx.ejs +0 -153
  55. package/build/templates/packages/expo-router/tabs/components/edit-screen-info.tsx.ejs +0 -153
  56. package/build/templates/packages/react-navigation/components/edit-screen-info.tsx.ejs +0 -180
@@ -1,127 +1,61 @@
1
- <% if (props.stylingPackage?.name === "nativewind") { %>
2
- import './global.css';
3
- <% } %>
4
- import React from 'react';
5
-
6
- <% if (props.stylingPackage?.name === "nativewind") {%>
7
- import { Text, View } from 'react-native';
8
- <% } else if (props.stylingPackage?.name === "tamagui") {%>
9
- import { View } from 'react-native';
10
- import { TamaguiProvider, Text, styled } from 'tamagui';
11
- import config from './tamagui.config'
12
- <% } else if (props.stylingPackage?.name === "restyle") {%>
13
- import { ThemeProvider } from '@shopify/restyle';
14
- import {theme, Text} from './theme';
15
- <% } else if (props.stylingPackage?.name === "unistyles") {%>
16
- import { createStyleSheet, useStyles } from 'react-native-unistyles'
17
- import { Text, View } from 'react-native';
18
- <% } else {%>
19
- import { StyleSheet, Text, View } from 'react-native';
20
- <% } %>
1
+ import { ScreenContent } from 'components/ScreenContent';
2
+ import { StatusBar } from 'expo-status-bar';
21
3
 
22
4
  <% if (props.internalizationPackage?.name === "i18next") { %>
23
- import { InternalizationExample } from 'components/InternalizationExample';
24
-
25
5
  import './translation';
6
+ import { InternalizationExample } from 'components/InternalizationExample';
26
7
  <% } %>
27
8
 
9
+ <% if (props.stylingPackage?.name === "nativewind") { %>
10
+ import './global.css';
11
+ <% } else if (props.stylingPackage?.name === "restyle") { %>
12
+ import { ThemeProvider } from '@shopify/restyle';
13
+ import { theme } from 'theme';
14
+ <% } else if (props.stylingPackage?.name === "tamagui") { %>
15
+ import { TamaguiProvider } from 'tamagui';
16
+ import config from './tamagui.config';
17
+ <% } %>
28
18
 
29
- import { StatusBar } from 'expo-status-bar';
30
-
31
- <% if (props.stylingPackage?.name === "nativewind") {%>
32
- export default function App() {
33
- return (
34
- <View className={styles.container}>
35
- <% if (props.internalizationPackage?.name === "i18next") { %>
36
- <InternalizationExample />
37
- <% } else { %>
38
- <Text>Open up App.tsx to start working on your app!</Text>
39
- <% } %>
40
- <StatusBar style="auto" />
41
- </View >
42
- );
43
- }
44
-
45
- const styles = {
46
- container: 'flex flex-1 items-center justify-center bg-white',
47
- };
48
- <% } else if (props.stylingPackage?.name === "tamagui") {%>
49
- const MyView = styled(View, {
50
- name: "MyView",
51
- flex: 1,
52
- alignItems: 'center',
53
- justifyContent: 'center',
54
- });
55
-
56
- export default function App() {
57
- return (
58
- <TamaguiProvider config={config}>
59
- <MyView>
60
- <Text>Open up App.tsx to start working on your app!</Text>
19
+ <% if (props.stylingPackage?.name === "restyle") {%>
20
+ export default function App() {
21
+ return (
22
+ <ThemeProvider theme={theme}>
23
+ <ScreenContent title="Home" path="App.tsx">
61
24
  <% if (props.internalizationPackage?.name === "i18next") { %>
62
25
  <InternalizationExample />
63
26
  <% } %>
64
- <StatusBar style="auto" />
65
- </MyView>
66
- </TamaguiProvider >
67
- );
68
- }
69
- <% } else if (props.stylingPackage?.name === "restyle") {%>
70
- export default function App() {
71
- return (
72
- <ThemeProvider theme={theme}>
27
+ </ScreenContent>
28
+ <StatusBar style="auto" />
29
+ </ThemeProvider>
30
+ );
31
+ }
32
+ <% } else if (props.stylingPackage?.name === "tamagui") {%>
33
+ export default function App() {
34
+ return (
35
+ <TamaguiProvider config={config}>
36
+ <ScreenContent title="Home" path="App.tsx">
73
37
  <% if (props.internalizationPackage?.name === "i18next") { %>
74
38
  <InternalizationExample />
75
39
  <% } else { %>
76
- <Text>Open up App.tsx to start working on your app!</Text>
40
+ <Text>Open up App.tsx to start working on your app!</Text>
77
41
  <% } %>
78
- <StatusBar style="auto" />
79
- </ThemeProvider>
80
- );
81
- }
82
- <% } else if (props.stylingPackage?.name === "unistyles") {%>
83
- export default function App() {
84
- const {styles} = useStyles(stylesheet)
85
- return (
86
- <View style={styles.container}>
87
- <% if (props.internalizationPackage?.name === "i18next") { %>
88
- <InternalizationExample />
89
- <% } else { %>
90
- <Text>Open up App.tsx to start working on your app!</Text>
91
- <% } %>
92
- <StatusBar style="auto" />
93
- </View >
94
- );
95
- }
96
-
97
- const stylesheet = createStyleSheet({
98
- container: {
99
- flex: 1,
100
- backgroundColor: '#fff',
101
- alignItems: 'center',
102
- justifyContent: 'center',
103
- },
104
- });
105
- <% } else {%>
106
- export default function App() {
107
- return (
108
- <View style={styles.container}>
42
+ </ScreenContent>
43
+ <StatusBar style="auto" />
44
+ </TamaguiProvider>
45
+ );
46
+ }
47
+ <% } else { %>
48
+ export default function App() {
49
+ return (
50
+ <>
51
+ <ScreenContent title="Home" path="App.tsx">
109
52
  <% if (props.internalizationPackage?.name === "i18next") { %>
110
53
  <InternalizationExample />
111
- <% } else { %>
112
- <Text>Open up App.tsx to start working on your app!</Text>
113
54
  <% } %>
114
- <StatusBar style="auto" />
115
- </View >
116
- );
117
- }
55
+ </ScreenContent>
56
+ <StatusBar style="auto" />
57
+ </>
58
+ );
59
+ }
60
+ <% } %>
118
61
 
119
- const styles = StyleSheet.create({
120
- container: {
121
- flex: 1,
122
- backgroundColor: '#fff',
123
- alignItems: 'center',
124
- justifyContent: 'center',
125
- },
126
- });
127
- <% } %>
@@ -0,0 +1,23 @@
1
+ import { Feather } from '@expo/vector-icons';
2
+ import { Text, View, StyleSheet } from 'react-native';
3
+
4
+ export const BackButton = ({ onPress }: { onPress: () => void }) => {
5
+ return (
6
+ <View style={styles.backButton}>
7
+ <Feather name="chevron-left" size={16} color="#007AFF" />
8
+ <Text style={styles.backButtonText} onPress={onPress}>
9
+ Back
10
+ </Text>
11
+ </View>
12
+ );
13
+ };
14
+ const styles = StyleSheet.create({
15
+ backButton: {
16
+ flexDirection: 'row',
17
+ paddingLeft: 20,
18
+ },
19
+ backButtonText: {
20
+ color: '#007AFF',
21
+ marginLeft: 4,
22
+ },
23
+ });
@@ -0,0 +1,40 @@
1
+ import { forwardRef } from 'react';
2
+ import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProps } from 'react-native';
3
+
4
+ type ButtonProps = {
5
+ onPress?: TouchableOpacityProps['onPress'];
6
+ title?: string;
7
+ } & TouchableOpacityProps;
8
+
9
+ export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ onPress, title }, ref) => {
10
+ return (
11
+ <TouchableOpacity ref={ref} style={styles.button} onPress={onPress}>
12
+ <Text style={styles.buttonText}>{title}</Text>
13
+ </TouchableOpacity>
14
+ );
15
+ });
16
+
17
+ const styles = StyleSheet.create({
18
+ button: {
19
+ alignItems: 'center',
20
+ backgroundColor: '#6366F1',
21
+ borderRadius: 24,
22
+ elevation: 5,
23
+ flexDirection: 'row',
24
+ justifyContent: 'center',
25
+ padding: 16,
26
+ shadowColor: '#000',
27
+ shadowOffset: {
28
+ height: 2,
29
+ width: 0,
30
+ },
31
+ shadowOpacity: 0.25,
32
+ shadowRadius: 3.84,
33
+ },
34
+ buttonText: {
35
+ color: '#FFFFFF',
36
+ fontSize: 16,
37
+ fontWeight: '600',
38
+ textAlign: 'center',
39
+ },
40
+ });
@@ -0,0 +1,55 @@
1
+ import { StyleSheet, Text, View } from 'react-native';
2
+
3
+ <% if (props.internalizationPackage?.name === "i18next") { %>
4
+ import { useTranslation } from 'react-i18next';
5
+ <% } %>
6
+
7
+ export default function 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
+ <View style={styles.getStartedContainer}>
18
+ <Text style={styles.getStartedText}>{title}</Text>
19
+ <View style={[styles.codeHighlightContainer, styles.homeScreenFilename]}>
20
+ <Text>{path}</Text>
21
+ </View>
22
+ <Text style={styles.getStartedText}>{description}</Text>
23
+ </View>
24
+ );
25
+ }
26
+
27
+ const styles = StyleSheet.create({
28
+ codeHighlightContainer: {
29
+ borderRadius: 3,
30
+ paddingHorizontal: 4,
31
+ },
32
+ getStartedContainer: {
33
+ alignItems: 'center',
34
+ marginHorizontal: 50,
35
+ },
36
+ getStartedText: {
37
+ fontSize: 17,
38
+ lineHeight: 24,
39
+ textAlign: 'center',
40
+ },
41
+ helpContainer: {
42
+ alignItems: 'center',
43
+ marginHorizontal: 20,
44
+ marginTop: 15,
45
+ },
46
+ helpLink: {
47
+ paddingVertical: 15,
48
+ },
49
+ helpLinkText: {
50
+ textAlign: 'center',
51
+ },
52
+ homeScreenFilename: {
53
+ marginVertical: 7,
54
+ },
55
+ });
@@ -0,0 +1,28 @@
1
+ import FontAwesome from '@expo/vector-icons/FontAwesome';
2
+ import { Pressable, StyleSheet } from 'react-native';
3
+
4
+ export const HeaderButton = ({ onPress }: { onPress?: () => void }) => {
5
+ return (
6
+ <Pressable onPress={onPress}>
7
+ {({ pressed }) => (
8
+ <FontAwesome
9
+ name="info-circle"
10
+ size={25}
11
+ color="gray"
12
+ style={[
13
+ styles.headerRight,
14
+ {
15
+ opacity: pressed ? 0.5 : 1,
16
+ },
17
+ ]}
18
+ />
19
+ )}
20
+ </Pressable>
21
+ );
22
+ };
23
+
24
+ export const styles = StyleSheet.create({
25
+ headerRight: {
26
+ marginRight: 15,
27
+ },
28
+ });
@@ -0,0 +1,38 @@
1
+ import { StyleSheet, Text, View } from 'react-native';
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
+ <View style={styles.container}>
14
+ <Text style={styles.title}>{title}</Text>
15
+ <View style={styles.separator} />
16
+ <EditScreenInfo path={path} />
17
+ {children}
18
+ </View>
19
+ );
20
+ };
21
+
22
+ const styles = StyleSheet.create({
23
+ container: {
24
+ alignItems: 'center',
25
+ flex: 1,
26
+ justifyContent: 'center',
27
+ },
28
+ separator: {
29
+ backgroundColor: '#d1d5db',
30
+ height: 1,
31
+ marginVertical: 30,
32
+ width: '80%',
33
+ },
34
+ title: {
35
+ fontSize: 20,
36
+ fontWeight: 'bold',
37
+ },
38
+ });
@@ -0,0 +1,15 @@
1
+ import FontAwesome from '@expo/vector-icons/FontAwesome';
2
+ import { StyleSheet } from 'react-native';
3
+
4
+ export const TabBarIcon = (props: {
5
+ name: React.ComponentProps<typeof FontAwesome>['name'];
6
+ color: string;
7
+ }) => {
8
+ return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
9
+ };
10
+
11
+ export const styles = StyleSheet.create({
12
+ tabBarIcon: {
13
+ marginBottom: -3,
14
+ },
15
+ });
@@ -1,13 +1,7 @@
1
- import FontAwesome from '@expo/vector-icons/FontAwesome';
2
1
  import { Tabs } from 'expo-router';
3
2
  import { StyleSheet } from 'react-native';
3
+ import { TabBarIcon } from '~/components/TabBarIcon';
4
4
 
5
- function TabBarIcon(props: {
6
- name: React.ComponentProps<typeof FontAwesome>['name'];
7
- color: string;
8
- }) {
9
- return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
10
- }
11
5
 
12
6
  export default function TabLayout() {
13
7
  return (
@@ -33,9 +27,3 @@ export default function TabLayout() {
33
27
  </Tabs>
34
28
  );
35
29
  }
36
-
37
- const styles = StyleSheet.create({
38
- tabBarIcon: {
39
- marginBottom: -3,
40
- },
41
- });
@@ -1,88 +1,22 @@
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 { %>
11
- import { StyleSheet, Text, View } from 'react-native';
12
- <% } %>
1
+ import { Stack } from 'expo-router';
2
+ import { StyleSheet, View } from 'react-native';
13
3
 
14
- import EditScreenInfo from '../../../components/edit-screen-info';
4
+ import { ScreenContent } from '~/components/ScreenContent';
15
5
 
16
- export default function TabOneScreen() {
17
- <% if (props.stylingPackage?.name === 'unistyles') { %>
18
- const { theme } = useStyles()
19
-
20
- return (
21
- <View style={theme.components.container}>
22
- <Text style={theme.components.title}>Tab One</Text>
23
- <View style={theme.components.separator} />
24
- <EditScreenInfo path='app/(drawer)/(tabs)/index.tsx' />
25
- </View>
26
- );
27
- <% } else if (props.stylingPackage?.name === 'nativewind') { %>
28
- return (
29
- <View className={styles.container}>
30
- <Text className={styles.title}>Tab One</Text>
31
- <View className={styles.separator} />
32
- <EditScreenInfo path='app/(drawer)/(tabs)/index.tsx' />
33
- </View>
34
- );
35
- <% } else if (props.stylingPackage?.name === 'tamagui') { %>
36
- return (
37
- <Theme name='light'>
38
- <YStack flex={1} alignItems='center' justifyContent='center'>
39
- <H2>Tab One</H2>
40
- <Separator />
41
- <EditScreenInfo path='app/(drawer)/(tabs)/index.tsx' />
42
- </YStack>
43
- </Theme>
44
- );
45
- <% } else if (props.stylingPackage?.name === 'restyle') { %>
46
- return (
47
- <Box flex={1} alignItems='center' justifyContent='center'>
48
- <Text variant='title'>Tab One</Text>
49
- <Box height={1} marginVertical='l_32' width='80%' />
50
- <EditScreenInfo path='app/(drawer)/(tabs)/index.tsx' />
51
- </Box>
52
- );
53
- <% } else { %>
54
- return (
55
- <View style={styles.container}>
56
- <Text style={styles.title}>Tab One</Text>
57
- <View style={styles.separator} />
58
- <EditScreenInfo path='app/(drawer)/(tabs)/index.tsx' />
59
- </View>
60
- );
61
- <% } %>
6
+ export default function Home() {
7
+ return (
8
+ <>
9
+ <Stack.Screen options={{ title: 'Tab One' }} />
10
+ <View style={styles.container}>
11
+ <ScreenContent path="app/(drawer)/(tabs)/index.tsx" title="Tab One" />
12
+ </View>
13
+ </>
14
+ );
62
15
  }
63
16
 
64
- <% if (props.stylingPackage?.name === 'nativewind') { %>
65
- const styles = {
66
- container: `items-center flex-1 justify-center`,
67
- separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
68
- title: `text-xl font-bold`
69
- };
70
- <% } else if (props.stylingPackage?.name === 'stylesheet') { %>
71
- const styles = StyleSheet.create({
72
- container: {
73
- alignItems: 'center',
74
- flex: 1,
75
- justifyContent: 'center',
76
- },
77
- separator: {
78
- backgroundColor: '#d1d5db',
79
- height: 1,
80
- marginVertical: 30,
81
- width: '80%',
82
- },
83
- title: {
84
- fontSize: 20,
85
- fontWeight: 'bold',
86
- }
87
- });
88
- <% } %>
17
+ const styles = StyleSheet.create({
18
+ container: {
19
+ flex: 1,
20
+ padding: 24,
21
+ },
22
+ });
@@ -1,88 +1,22 @@
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 { %>
11
- import { StyleSheet, Text, View } from 'react-native';
12
- <% } %>
1
+ import { Stack } from 'expo-router';
2
+ import { StyleSheet, View } from 'react-native';
13
3
 
14
- import EditScreenInfo from '../../../components/edit-screen-info';
4
+ import { ScreenContent } from '~/components/ScreenContent';
15
5
 
16
- export default function TabTwoScreen() {
17
- <% if (props.stylingPackage?.name === 'unistyles') { %>
18
- const { theme } = useStyles()
19
-
20
- return (
21
- <View style={theme.components.container}>
22
- <Text style={theme.components.title}>Tab Two</Text>
23
- <View style={theme.components.separator} />
24
- <EditScreenInfo path='app/(drawer)/(tabs)/two.tsx' />
25
- </View>
26
- );
27
- <% } else if (props.stylingPackage?.name === 'nativewind') { %>
28
- return (
29
- <View className={styles.container}>
30
- <Text className={styles.title}>Tab Two</Text>
31
- <View className={styles.separator} />
32
- <EditScreenInfo path='app/(drawer)/(tabs)/two.tsx' />
33
- </View>
34
- );
35
- <% } else if (props.stylingPackage?.name === 'tamagui') { %>
36
- return (
37
- <Theme name='light'>
38
- <YStack flex={1} alignItems='center' justifyContent='center'>
39
- <H2>Tab Two</H2>
40
- <Separator />
41
- <EditScreenInfo path='app/(drawer)/(tabs)/two.tsx' />
42
- </YStack>
43
- </Theme>
44
- );
45
- <% } else if (props.stylingPackage?.name === 'restyle') { %>
46
- return (
47
- <Box flex={1} alignItems='center' justifyContent='center'>
48
- <Text variant='title'>Tab Two</Text>
49
- <Box height={1} marginVertical='l_32' width='80%' />
50
- <EditScreenInfo path='app/(drawer)/(tabs)/two.tsx' />
51
- </Box>
52
- );
53
- <% } else { %>
54
- return (
55
- <View style={styles.container}>
56
- <Text style={styles.title}>Tab Two</Text>
57
- <View style={styles.separator} />
58
- <EditScreenInfo path='app/(drawer)/(tabs)/two.tsx' />
59
- </View>
60
- );
61
- <% } %>
6
+ export default function Home() {
7
+ return (
8
+ <>
9
+ <Stack.Screen options={{ title: 'Tab Two' }} />
10
+ <View style={styles.container}>
11
+ <ScreenContent path="app/(drawer)/(tabs)/two.tsx" title="Tab Two" />
12
+ </View>
13
+ </>
14
+ );
62
15
  }
63
16
 
64
- <% if (props.stylingPackage?.name === 'nativewind') { %>
65
- const styles = {
66
- container: `items-center flex-1 justify-center`,
67
- separator: `h-[1px] my-7 w-4/5 bg-gray-200`,
68
- title: `text-xl font-bold`
69
- };
70
- <% } else if (props.stylingPackage?.name === 'stylesheet') { %>
71
- const styles = StyleSheet.create({
72
- container: {
73
- alignItems: 'center',
74
- flex: 1,
75
- justifyContent: 'center',
76
- },
77
- separator: {
78
- backgroundColor: '#d1d5db',
79
- height: 1,
80
- marginVertical: 30,
81
- width: '80%',
82
- },
83
- title: {
84
- fontSize: 20,
85
- fontWeight: 'bold',
86
- }
87
- });
88
- <% } %>
17
+ const styles = StyleSheet.create({
18
+ container: {
19
+ flex: 1,
20
+ padding: 24,
21
+ },
22
+ });
@@ -1,7 +1,8 @@
1
- import { FontAwesome, Ionicons, MaterialIcons } from '@expo/vector-icons';
1
+ import { Ionicons, MaterialIcons } from '@expo/vector-icons';
2
2
  import { Link } from 'expo-router';
3
3
  import { Drawer } from 'expo-router/drawer';
4
- import { Pressable, StyleSheet } from 'react-native';
4
+
5
+ import { HeaderButton } from '../../components/HeaderButton';
5
6
 
6
7
  const DrawerLayout = () => (
7
8
  <Drawer>
@@ -23,16 +24,7 @@ const DrawerLayout = () => (
23
24
  ),
24
25
  headerRight: () => (
25
26
  <Link href="/modal" asChild>
26
- <Pressable>
27
- {({ pressed }) => (
28
- <FontAwesome
29
- name="info-circle"
30
- size={25}
31
- color="gray"
32
- style={[styles.headerRight, { opacity: pressed ? 0.5 : 1 }]}
33
- />
34
- )}
35
- </Pressable>
27
+ <HeaderButton />
36
28
  </Link>
37
29
  ),
38
30
  }}
@@ -40,10 +32,4 @@ const DrawerLayout = () => (
40
32
  </Drawer>
41
33
  );
42
34
 
43
- const styles = StyleSheet.create({
44
- headerRight: {
45
- marginRight: 15,
46
- },
47
- });
48
-
49
35
  export default DrawerLayout;