create-expo-stack 2.10.0-next.14c795f → 2.10.0-next.4433ac0
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.
|
@@ -1,73 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import '../global.css';
|
|
2
|
+
import 'expo-dev-client';
|
|
3
|
+
import { ThemeProvider as NavThemeProvider } from '@react-navigation/native';
|
|
4
|
+
import { Icon } from '@roninoss/icons';
|
|
5
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
6
|
+
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
|
|
6
7
|
<% } %>
|
|
7
|
-
<% if (props.stylingPackage?.
|
|
8
|
-
import '
|
|
8
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
9
|
+
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
9
10
|
<% } %>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<%
|
|
14
|
-
|
|
15
|
-
import 'react-native-gesture-handler';
|
|
11
|
+
import { Link, Stack } from 'expo-router';
|
|
12
|
+
import { StatusBar } from 'expo-status-bar';
|
|
13
|
+
import { Pressable, View } from 'react-native';
|
|
14
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
16
15
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
17
|
-
|
|
16
|
+
<% } %>
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import { useFonts } from "expo-font";
|
|
18
|
+
import { ThemeToggle } from '~/components/nativewindui/ThemeToggle';
|
|
19
|
+
import { cn } from '~/lib/cn';
|
|
20
|
+
import { useColorScheme, useInitialAndroidBarSync } from '~/lib/useColorScheme';
|
|
21
|
+
import { NAV_THEME } from '~/theme';
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
export {
|
|
24
|
+
// Catch any errors thrown by the Layout component.
|
|
25
|
+
ErrorBoundary,
|
|
26
|
+
} from 'expo-router';
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
import { theme } from '../theme';
|
|
32
|
-
<% } %>
|
|
28
|
+
export default function RootLayout() {
|
|
29
|
+
useInitialAndroidBarSync();
|
|
30
|
+
const { colorScheme, isDarkColorScheme } = useColorScheme();
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
<StatusBar
|
|
35
|
+
key={`root-status-bar-${isDarkColorScheme ? 'light' : 'dark'}`}
|
|
36
|
+
style={isDarkColorScheme ? 'light' : 'dark'}
|
|
37
|
+
/>
|
|
38
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
39
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
40
|
+
<BottomSheetModalProvider>
|
|
41
|
+
<% } %>
|
|
42
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
43
|
+
<ActionSheetProvider>
|
|
44
|
+
<% } %>
|
|
45
|
+
<NavThemeProvider value={NAV_THEME[colorScheme]}>
|
|
46
|
+
<Stack screenOptions={SCREEN_OPTIONS}>
|
|
47
|
+
<Stack.Screen name="(tabs)" options={DRAWER_OPTIONS} />
|
|
48
|
+
<Stack.Screen name="modal" options={MODAL_OPTIONS} />
|
|
49
|
+
</Stack>
|
|
50
|
+
</NavThemeProvider>
|
|
51
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
52
|
+
</ActionSheetProvider>
|
|
53
|
+
<% } %>
|
|
54
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
55
|
+
</BottomSheetModalProvider>
|
|
56
|
+
</GestureHandlerRootView>
|
|
57
|
+
<% } %>
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
38
61
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Inter: require("@tamagui/font-inter/otf/Inter-Medium.otf"),
|
|
43
|
-
InterBold: require("@tamagui/font-inter/otf/Inter-Bold.otf")
|
|
44
|
-
});
|
|
62
|
+
const SCREEN_OPTIONS = {
|
|
63
|
+
animation: 'ios', // for android
|
|
64
|
+
} as const;
|
|
45
65
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
}, [loaded]);
|
|
66
|
+
const DRAWER_OPTIONS = {
|
|
67
|
+
headerShown: false,
|
|
68
|
+
} as const;
|
|
51
69
|
|
|
52
|
-
|
|
53
|
-
|
|
70
|
+
const INDEX_OPTIONS = {
|
|
71
|
+
headerLargeTitle: true,
|
|
72
|
+
title: 'NativeWindUI',
|
|
73
|
+
headerRight: () => <SettingsIcon />,
|
|
74
|
+
} as const;
|
|
54
75
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<% if (props.stylingPackage?.name === "tamagui") { %>
|
|
68
|
-
</TamaguiProvider>
|
|
69
|
-
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
70
|
-
</ThemeProvider>
|
|
71
|
-
<% } %>
|
|
76
|
+
function SettingsIcon() {
|
|
77
|
+
const { colors } = useColorScheme();
|
|
78
|
+
return (
|
|
79
|
+
<Link href="/modal" asChild>
|
|
80
|
+
<Pressable className="opacity-80">
|
|
81
|
+
{({ pressed }) => (
|
|
82
|
+
<View className={cn(pressed ? 'opacity-50' : 'opacity-90')}>
|
|
83
|
+
<Icon name="cog-outline" color={colors.foreground} />
|
|
84
|
+
</View>
|
|
85
|
+
)}
|
|
86
|
+
</Pressable>
|
|
87
|
+
</Link>
|
|
72
88
|
);
|
|
73
|
-
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const MODAL_OPTIONS = {
|
|
92
|
+
presentation: 'modal',
|
|
93
|
+
animation: 'fade_from_bottom', // for android
|
|
94
|
+
title: 'Settings',
|
|
95
|
+
headerRight: () => <ThemeToggle />,
|
|
96
|
+
} as const;
|
|
@@ -1,68 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import '../global.css';
|
|
2
|
+
import 'expo-dev-client';
|
|
3
|
+
import { ThemeProvider as NavThemeProvider } from '@react-navigation/native';
|
|
4
|
+
import { Icon } from '@roninoss/icons';
|
|
5
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
6
|
+
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
|
|
6
7
|
<% } %>
|
|
7
|
-
<% if (props.stylingPackage?.
|
|
8
|
-
import '
|
|
8
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
9
|
+
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
9
10
|
<% } %>
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
import { Link, Stack } from 'expo-router';
|
|
12
|
+
import { StatusBar } from 'expo-status-bar';
|
|
13
|
+
import { Pressable, View } from 'react-native';
|
|
14
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
15
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
12
16
|
<% } %>
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
import { useFonts } from "expo-font";
|
|
18
|
+
import { ThemeToggle } from '~/components/nativewindui/ThemeToggle';
|
|
19
|
+
import { cn } from '~/lib/cn';
|
|
20
|
+
import { useColorScheme, useInitialAndroidBarSync } from '~/lib/useColorScheme';
|
|
21
|
+
import { NAV_THEME } from '~/theme';
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
export {
|
|
24
|
+
// Catch any errors thrown by the Layout component.
|
|
25
|
+
ErrorBoundary,
|
|
26
|
+
} from 'expo-router';
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
import { Stack } from 'expo-router';
|
|
26
|
-
import { theme } from 'theme';
|
|
27
|
-
<% } else { %>
|
|
28
|
-
import { Stack } from "expo-router";
|
|
29
|
-
<% } %>
|
|
28
|
+
export default function RootLayout() {
|
|
29
|
+
useInitialAndroidBarSync();
|
|
30
|
+
const { colorScheme, isDarkColorScheme } = useColorScheme();
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
<StatusBar
|
|
35
|
+
key={`root-status-bar-${isDarkColorScheme ? 'light' : 'dark'}`}
|
|
36
|
+
style={isDarkColorScheme ? 'light' : 'dark'}
|
|
37
|
+
/>
|
|
38
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
39
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
40
|
+
<BottomSheetModalProvider>
|
|
41
|
+
<% } %>
|
|
42
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
43
|
+
<ActionSheetProvider>
|
|
44
|
+
<% } %>
|
|
45
|
+
<NavThemeProvider value={NAV_THEME[colorScheme]}>
|
|
46
|
+
<Stack screenOptions={SCREEN_OPTIONS}>
|
|
47
|
+
<Stack.Screen name="(tabs)" options={TABS_OPTIONS} />
|
|
48
|
+
<Stack.Screen name="modal" options={MODAL_OPTIONS} />
|
|
49
|
+
</Stack>
|
|
50
|
+
</NavThemeProvider>
|
|
51
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
52
|
+
</ActionSheetProvider>
|
|
53
|
+
<% } %>
|
|
54
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
55
|
+
</BottomSheetModalProvider>
|
|
56
|
+
</GestureHandlerRootView>
|
|
57
|
+
<% } %>
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
35
61
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
62
|
+
const SCREEN_OPTIONS = {
|
|
63
|
+
animation: 'ios', // for android
|
|
64
|
+
} as const;
|
|
65
|
+
|
|
66
|
+
const TABS_OPTIONS = {
|
|
67
|
+
headerShown: false,
|
|
68
|
+
} as const;
|
|
42
69
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
70
|
+
const INDEX_OPTIONS = {
|
|
71
|
+
headerLargeTitle: true,
|
|
72
|
+
title: 'NativeWindUI',
|
|
73
|
+
headerRight: () => <SettingsIcon />,
|
|
74
|
+
} as const;
|
|
48
75
|
|
|
49
|
-
|
|
50
|
-
|
|
76
|
+
function SettingsIcon() {
|
|
77
|
+
const { colors } = useColorScheme();
|
|
78
|
+
return (
|
|
79
|
+
<Link href="/modal" asChild>
|
|
80
|
+
<Pressable className="opacity-80">
|
|
81
|
+
{({ pressed }) => (
|
|
82
|
+
<View className={cn(pressed ? 'opacity-50' : 'opacity-90')}>
|
|
83
|
+
<Icon name="cog-outline" color={colors.foreground} />
|
|
84
|
+
</View>
|
|
85
|
+
)}
|
|
86
|
+
</Pressable>
|
|
87
|
+
</Link>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
51
90
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<Stack>
|
|
59
|
-
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
60
|
-
<Stack.Screen name="modal" options={{ presentation: "modal" }} />
|
|
61
|
-
</Stack>
|
|
62
|
-
<% if (props.stylingPackage?.name === "tamagui") { %>
|
|
63
|
-
</TamaguiProvider>
|
|
64
|
-
<% } else if (props.stylingPackage?.name === "restyle") { %>
|
|
65
|
-
</ThemeProvider>
|
|
66
|
-
<% } %>
|
|
67
|
-
);
|
|
68
|
-
}
|
|
91
|
+
const MODAL_OPTIONS = {
|
|
92
|
+
presentation: 'modal',
|
|
93
|
+
animation: 'fade_from_bottom', // for android
|
|
94
|
+
title: 'Settings',
|
|
95
|
+
headerRight: () => <ThemeToggle />,
|
|
96
|
+
} as const;
|