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
- <% if (props.stylingPackage?.name === "nativewind") { %>
2
- import '../global.css';
3
- <% } else if (props.stylingPackage?.name === "nativewinui") { %>
4
- import '../global.css';
5
- import 'expo-dev-client';
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?.name === "unistyles") { %>
8
- import '../unistyles';
8
+ <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
9
+ import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
9
10
  <% } %>
10
-
11
- <% if (props.internalizationPackage?.name === "i18next") { %>
12
- import '../translation';
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
- import { Stack } from 'expo-router';
16
+ <% } %>
18
17
 
19
- <% if (props.stylingPackage?.name==="tamagui" ) { %>
20
- import React, { useEffect } from "react";
21
- import { TamaguiProvider } from 'tamagui'
22
- import { SplashScreen } from "expo-router";
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
- import config from '../tamagui.config';
23
+ export {
24
+ // Catch any errors thrown by the Layout component.
25
+ ErrorBoundary,
26
+ } from 'expo-router';
26
27
 
27
- SplashScreen.preventAutoHideAsync();
28
- <% } else if (props.stylingPackage?.name === "restyle") { %>
29
- import { ThemeProvider } from '@shopify/restyle';
30
-
31
- import { theme } from '../theme';
32
- <% } %>
28
+ export default function RootLayout() {
29
+ useInitialAndroidBarSync();
30
+ const { colorScheme, isDarkColorScheme } = useColorScheme();
33
31
 
34
- export const unstable_settings = {
35
- // Ensure that reloading on `/modal` keeps a back button present.
36
- initialRouteName: "(drawer)",
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
- export default function RootLayout() {
40
- <% if (props.stylingPackage?.name==="tamagui" ) { %>
41
- const [loaded] = useFonts({
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
- useEffect(() => {
47
- if (loaded) {
48
- SplashScreen.hideAsync();
49
- }
50
- }, [loaded]);
66
+ const DRAWER_OPTIONS = {
67
+ headerShown: false,
68
+ } as const;
51
69
 
52
- if (!loaded) return null;
53
- <% } %>
70
+ const INDEX_OPTIONS = {
71
+ headerLargeTitle: true,
72
+ title: 'NativeWindUI',
73
+ headerRight: () => <SettingsIcon />,
74
+ } as const;
54
75
 
55
- return (
56
- <% if (props.stylingPackage?.name === "tamagui") { %>
57
- <TamaguiProvider config={config}>
58
- <% } else if (props.stylingPackage?.name === "restyle") { %>
59
- <ThemeProvider theme={theme}>
60
- <% } %>
61
- <GestureHandlerRootView style={{ flex: 1 }}>
62
- <Stack>
63
- <Stack.Screen name="(drawer)" options={{ headerShown: false }} />
64
- <Stack.Screen name="modal" options={{ title: 'Modal', presentation: 'modal' }} />
65
- </Stack>
66
- </GestureHandlerRootView>
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
- <% if (props.stylingPackage?.name === "nativewind") { %>
2
- import '../global.css';
3
- <% } else if (props.stylingPackage?.name === "nativewinui") { %>
4
- import '../global.css';
5
- import 'expo-dev-client';
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?.name === "unistyles") { %>
8
- import '../unistyles';
8
+ <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
9
+ import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
9
10
  <% } %>
10
- <% if (props.internalizationPackage?.name === "i18next") { %>
11
- import '../translation';
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
- <% if (props.stylingPackage?.name === "tamagui") { %>
15
- import React, { useEffect } from "react";
16
- import { TamaguiProvider } from 'tamagui'
17
- import { SplashScreen, Stack } from "expo-router";
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
- import config from '../tamagui.config'
23
+ export {
24
+ // Catch any errors thrown by the Layout component.
25
+ ErrorBoundary,
26
+ } from 'expo-router';
21
27
 
22
- SplashScreen.preventAutoHideAsync();
23
- <% } else if (props.stylingPackage?.name === "restyle") { %>
24
- import { ThemeProvider } from '@shopify/restyle';
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
- export const unstable_settings = {
32
- // Ensure that reloading on `/modal` keeps a back button present.
33
- initialRouteName: "(tabs)",
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
- export default function RootLayout() {
37
- <% if (props.stylingPackage?.name === "tamagui") { %>
38
- const [loaded] = useFonts({
39
- Inter: require("@tamagui/font-inter/otf/Inter-Medium.otf"),
40
- InterBold: require("@tamagui/font-inter/otf/Inter-Bold.otf")
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
- useEffect(() => {
44
- if (loaded) {
45
- SplashScreen.hideAsync();
46
- }
47
- }, [loaded]);
70
+ const INDEX_OPTIONS = {
71
+ headerLargeTitle: true,
72
+ title: 'NativeWindUI',
73
+ headerRight: () => <SettingsIcon />,
74
+ } as const;
48
75
 
49
- if (!loaded) return null;
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
- return (
53
- <% if (props.stylingPackage?.name === "tamagui") { %>
54
- <TamaguiProvider config={config}>
55
- <% } else if (props.stylingPackage?.name === "restyle") { %>
56
- <ThemeProvider theme={theme}>
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-expo-stack",
3
- "version": "2.10.0-next.14c795f",
3
+ "version": "2.10.0-next.4433ac0",
4
4
  "description": "CLI tool to initialize a React Native application with Expo",
5
5
  "repository": {
6
6
  "type": "git",