create-expo-stack 2.10.0-next.8907a81 → 2.10.0-next.aa45674

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,96 +1,68 @@
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';
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';
7
6
  <% } %>
8
- <% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
9
- import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
7
+ <% if (props.stylingPackage?.name === "unistyles") { %>
8
+ import '../unistyles';
10
9
  <% } %>
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';
10
+ <% if (props.internalizationPackage?.name === "i18next") { %>
11
+ import '../translation';
16
12
  <% } %>
17
13
 
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';
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";
22
19
 
23
- export {
24
- // Catch any errors thrown by the Layout component.
25
- ErrorBoundary,
26
- } from 'expo-router';
20
+ import config from '../tamagui.config'
27
21
 
28
- export default function RootLayout() {
29
- useInitialAndroidBarSync();
30
- const { colorScheme, isDarkColorScheme } = useColorScheme();
31
-
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
- }
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
+ <% } %>
61
30
 
62
- const SCREEN_OPTIONS = {
63
- animation: 'ios', // for android
64
- } as const;
31
+ export const unstable_settings = {
32
+ // Ensure that reloading on `/modal` keeps a back button present.
33
+ initialRouteName: "(tabs)",
34
+ };
65
35
 
66
- const TABS_OPTIONS = {
67
- headerShown: false,
68
- } as const;
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
+ });
69
42
 
70
- const INDEX_OPTIONS = {
71
- headerLargeTitle: true,
72
- title: 'NativeWindUI',
73
- headerRight: () => <SettingsIcon />,
74
- } as const;
43
+ useEffect(() => {
44
+ if (loaded) {
45
+ SplashScreen.hideAsync();
46
+ }
47
+ }, [loaded]);
75
48
 
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
- }
49
+ if (!loaded) return null;
50
+ <% } %>
90
51
 
91
- const MODAL_OPTIONS = {
92
- presentation: 'modal',
93
- animation: 'fade_from_bottom', // for android
94
- title: 'Settings',
95
- headerRight: () => <ThemeToggle />,
96
- } as const;
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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-expo-stack",
3
- "version": "2.10.0-next.8907a81",
3
+ "version": "2.10.0-next.aa45674",
4
4
  "description": "CLI tool to initialize a React Native application with Expo",
5
5
  "repository": {
6
6
  "type": "git",