@mr.dj2u/create-expo-stack 2.21.3-mrdj.0
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 +435 -0
- package/bin/create-expo-stack.js +2 -0
- package/build/cli.js +49 -0
- package/build/commands/create-expo-stack.js +471 -0
- package/build/constants.js +39 -0
- package/build/templates/base/.gitignore.ejs +26 -0
- package/build/templates/base/.npmrc.ejs +1 -0
- package/build/templates/base/App.tsx.ejs +66 -0
- package/build/templates/base/app.json.ejs +69 -0
- package/build/templates/base/assets/adaptive-icon.png +0 -0
- package/build/templates/base/assets/favicon.png +0 -0
- package/build/templates/base/assets/icon.png +0 -0
- package/build/templates/base/assets/splash.png +0 -0
- package/build/templates/base/babel.config.js.ejs +38 -0
- package/build/templates/base/components/BackButton.tsx.ejs +23 -0
- package/build/templates/base/components/Button.tsx.ejs +42 -0
- package/build/templates/base/components/Container.tsx.ejs +14 -0
- package/build/templates/base/components/EditScreenInfo.tsx.ejs +44 -0
- package/build/templates/base/components/HeaderButton.tsx.ejs +31 -0
- package/build/templates/base/components/ScreenContent.tsx.ejs +40 -0
- package/build/templates/base/components/TabBarIcon.tsx.ejs +15 -0
- package/build/templates/base/eslint.config.js.ejs +15 -0
- package/build/templates/base/package.json.ejs +191 -0
- package/build/templates/base/prettier.config.js.ejs +11 -0
- package/build/templates/base/tsconfig.json.ejs +39 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +40 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/index.tsx.ejs +15 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/(tabs)/two.tsx.ejs +15 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/_layout.tsx.ejs +65 -0
- package/build/templates/packages/expo-router/drawer/app/(drawer)/index.tsx.ejs +15 -0
- package/build/templates/packages/expo-router/drawer/app/+html.tsx.ejs +49 -0
- package/build/templates/packages/expo-router/drawer/app/+not-found.tsx.ejs +100 -0
- package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +91 -0
- package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +21 -0
- package/build/templates/packages/expo-router/expo-env.d.ts +4 -0
- package/build/templates/packages/expo-router/index.js.ejs +4 -0
- package/build/templates/packages/expo-router/metro.config.js.ejs +24 -0
- package/build/templates/packages/expo-router/stack/app/+html.tsx.ejs +49 -0
- package/build/templates/packages/expo-router/stack/app/+not-found.tsx.ejs +113 -0
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +63 -0
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +56 -0
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +73 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/_layout.tsx.ejs +52 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/index.tsx.ejs +37 -0
- package/build/templates/packages/expo-router/tabs/app/(tabs)/two.tsx.ejs +37 -0
- package/build/templates/packages/expo-router/tabs/app/+html.tsx.ejs +49 -0
- package/build/templates/packages/expo-router/tabs/app/+not-found.tsx.ejs +110 -0
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +84 -0
- package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +21 -0
- package/build/templates/packages/firebase/.env.ejs +8 -0
- package/build/templates/packages/firebase/metro.config.js.ejs +14 -0
- package/build/templates/packages/firebase/utils/firebase.ts.ejs +26 -0
- 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 +22 -0
- package/build/templates/packages/nativewind/components/Button.tsx.ejs +21 -0
- package/build/templates/packages/nativewind/components/Container.tsx.ejs +13 -0
- package/build/templates/packages/nativewind/components/EditScreenInfo.tsx.ejs +40 -0
- package/build/templates/packages/nativewind/components/ScreenContent.tsx.ejs +27 -0
- package/build/templates/packages/nativewind/global.css +3 -0
- package/build/templates/packages/nativewind/metro.config.js +7 -0
- package/build/templates/packages/nativewind/nativewind-env.d.ts +2 -0
- package/build/templates/packages/nativewind/tailwind.config.js.ejs +15 -0
- package/build/templates/packages/nativewindui/components/Container.tsx.ejs +14 -0
- package/build/templates/packages/nativewindui/components/EditScreenInfo.tsx.ejs +45 -0
- package/build/templates/packages/nativewindui/components/HeaderButton.tsx.ejs +31 -0
- package/build/templates/packages/nativewindui/components/ScreenContent.tsx.ejs +40 -0
- package/build/templates/packages/nativewindui/components/TabBarIcon.tsx.ejs +15 -0
- package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.ios.tsx.ejs +52 -0
- package/build/templates/packages/nativewindui/components/nativewindui/Icon/Icon.tsx.ejs +58 -0
- package/build/templates/packages/nativewindui/components/nativewindui/Icon/index.ts.ejs +16 -0
- package/build/templates/packages/nativewindui/components/nativewindui/Icon/types.ts.ejs +18 -0
- package/build/templates/packages/nativewindui/components/nativewindui/ThemeToggle.tsx.ejs +33 -0
- package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/_layout.tsx.ejs +28 -0
- package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/index.tsx.ejs +15 -0
- package/build/templates/packages/nativewindui/drawer/app/(drawer)/(tabs)/two.tsx.ejs +15 -0
- package/build/templates/packages/nativewindui/drawer/app/(drawer)/_layout.tsx.ejs +35 -0
- package/build/templates/packages/nativewindui/drawer/app/(drawer)/index.tsx.ejs +535 -0
- package/build/templates/packages/nativewindui/drawer/app/+html.tsx.ejs +46 -0
- package/build/templates/packages/nativewindui/drawer/app/+not-found.tsx.ejs +83 -0
- package/build/templates/packages/nativewindui/drawer/app/_layout.tsx.ejs +75 -0
- package/build/templates/packages/nativewindui/drawer/app/modal.tsx.ejs +33 -0
- package/build/templates/packages/nativewindui/global.css.ejs +91 -0
- package/build/templates/packages/nativewindui/lib/cn.ts.ejs +6 -0
- package/build/templates/packages/nativewindui/lib/useColorScheme.tsx.ejs +21 -0
- package/build/templates/packages/nativewindui/nativewind-env.d.ts.ejs +1 -0
- package/build/templates/packages/nativewindui/stack/app/+html.tsx.ejs +46 -0
- package/build/templates/packages/nativewindui/stack/app/+not-found.tsx.ejs +18 -0
- package/build/templates/packages/nativewindui/stack/app/_layout.tsx.ejs +78 -0
- package/build/templates/packages/nativewindui/stack/app/index.tsx.ejs +487 -0
- package/build/templates/packages/nativewindui/stack/app/modal.tsx.ejs +33 -0
- package/build/templates/packages/nativewindui/tabs/app/(tabs)/_layout.tsx.ejs +35 -0
- package/build/templates/packages/nativewindui/tabs/app/(tabs)/index.tsx.ejs +537 -0
- package/build/templates/packages/nativewindui/tabs/app/(tabs)/two.tsx.ejs +22 -0
- package/build/templates/packages/nativewindui/tabs/app/+html.tsx.ejs +46 -0
- package/build/templates/packages/nativewindui/tabs/app/+not-found.tsx.ejs +90 -0
- package/build/templates/packages/nativewindui/tabs/app/_layout.tsx.ejs +78 -0
- package/build/templates/packages/nativewindui/tabs/app/modal.tsx.ejs +21 -0
- package/build/templates/packages/nativewindui/tailwind.config.js.ejs +67 -0
- package/build/templates/packages/nativewindui/theme/colors.ts.ejs +123 -0
- package/build/templates/packages/nativewindui/theme/index.ts.ejs +32 -0
- package/build/templates/packages/nativewindui/theme/with-opacity.ts.ejs +155 -0
- package/build/templates/packages/react-navigation/App.tsx.ejs +73 -0
- package/build/templates/packages/react-navigation/navigation/drawer-navigator.tsx.ejs +31 -0
- package/build/templates/packages/react-navigation/navigation/index.tsx.ejs +108 -0
- package/build/templates/packages/react-navigation/navigation/tab-navigator.tsx.ejs +38 -0
- package/build/templates/packages/react-navigation/screens/details.tsx.ejs +41 -0
- package/build/templates/packages/react-navigation/screens/home.tsx.ejs +5 -0
- package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +20 -0
- package/build/templates/packages/react-navigation/screens/one.tsx.ejs +5 -0
- package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +54 -0
- package/build/templates/packages/react-navigation/screens/two.tsx.ejs +5 -0
- package/build/templates/packages/restyle/components/BackButton.tsx.ejs +19 -0
- package/build/templates/packages/restyle/components/Button.tsx.ejs +32 -0
- package/build/templates/packages/restyle/components/Container.tsx.ejs +16 -0
- package/build/templates/packages/restyle/components/EditScreenInfo.tsx.ejs +38 -0
- package/build/templates/packages/restyle/components/ScreenContent.tsx.ejs +30 -0
- package/build/templates/packages/restyle/theme.ts.ejs +51 -0
- package/build/templates/packages/supabase/.env.ejs +2 -0
- package/build/templates/packages/supabase/utils/supabase.ts.ejs +14 -0
- package/build/templates/packages/tamagui/components/BackButton.tsx.ejs +12 -0
- package/build/templates/packages/tamagui/components/Button.tsx.ejs +17 -0
- package/build/templates/packages/tamagui/components/Container.tsx.ejs +12 -0
- package/build/templates/packages/tamagui/components/EditScreenInfo.tsx.ejs +27 -0
- package/build/templates/packages/tamagui/components/ScreenContent.tsx.ejs +23 -0
- package/build/templates/packages/tamagui/tamagui.config.ts.ejs +14 -0
- package/build/templates/packages/unistyles/breakpoints.ts.ejs +9 -0
- package/build/templates/packages/unistyles/components/BackButton.tsx.ejs +28 -0
- package/build/templates/packages/unistyles/components/Button.tsx.ejs +42 -0
- package/build/templates/packages/unistyles/components/Container.tsx.ejs +17 -0
- package/build/templates/packages/unistyles/components/EditScreenInfo.tsx.ejs +53 -0
- package/build/templates/packages/unistyles/components/ScreenContent.tsx.ejs +43 -0
- package/build/templates/packages/unistyles/theme.ts.ejs +34 -0
- package/build/templates/packages/unistyles/unistyles.ts.ejs +27 -0
- package/build/templates/packages/uniwind/global.css +2 -0
- package/build/templates/packages/uniwind/metro.config.js.ejs +10 -0
- package/build/templates/packages/vexo-analytics/.env.ejs +7 -0
- package/build/templates/packages/zustand/store/store.ts.ejs +15 -0
- package/build/types/cli.d.ts +4 -0
- package/build/types/commands/create-expo-stack.d.ts +3 -0
- package/build/types/constants.d.ts +10 -0
- package/build/types/types.d.ts +33 -0
- package/build/types/utilities/bumpVersion.d.ts +1 -0
- package/build/types/utilities/clearNavigationPackages.d.ts +2 -0
- package/build/types/utilities/clearStylingPackages.d.ts +2 -0
- package/build/types/utilities/configAnalytics.d.ts +18 -0
- package/build/types/utilities/configStorage.d.ts +8 -0
- package/build/types/utilities/configureProjectFiles.d.ts +3 -0
- package/build/types/utilities/copyBaseAssets.d.ts +2 -0
- package/build/types/utilities/generateNWUI.d.ts +3 -0
- package/build/types/utilities/generateProjectFiles.d.ts +5 -0
- package/build/types/utilities/getPackageManager.d.ts +8 -0
- package/build/types/utilities/index.d.ts +10 -0
- package/build/types/utilities/printOutput.d.ts +3 -0
- package/build/types/utilities/publishToGitHub.d.ts +2 -0
- package/build/types/utilities/renderTitle.d.ts +2 -0
- package/build/types/utilities/runCLI.d.ts +3 -0
- package/build/types/utilities/runEasConfigure.d.ts +3 -0
- package/build/types/utilities/runIgnite.d.ts +3 -0
- package/build/types/utilities/showHelp.d.ts +1 -0
- package/build/types/utilities/systemCommand.d.ts +14 -0
- package/build/types/utilities/usePackage.d.ts +2 -0
- package/build/types/utilities/validateProjectName.d.ts +4 -0
- package/build/types.js +39 -0
- package/build/utilities/bumpVersion.js +21 -0
- package/build/utilities/clearNavigationPackages.js +11 -0
- package/build/utilities/clearStylingPackages.js +11 -0
- package/build/utilities/configAnalytics.js +70 -0
- package/build/utilities/configStorage.js +50 -0
- package/build/utilities/configureProjectFiles.js +380 -0
- package/build/utilities/copyBaseAssets.js +21 -0
- package/build/utilities/generateNWUI.js +54 -0
- package/build/utilities/generateProjectFiles.js +106 -0
- package/build/utilities/getPackageManager.js +103 -0
- package/build/utilities/index.js +27 -0
- package/build/utilities/printOutput.js +251 -0
- package/build/utilities/publishToGitHub.js +173 -0
- package/build/utilities/renderTitle.js +55 -0
- package/build/utilities/runCLI.js +437 -0
- package/build/utilities/runEasConfigure.js +83 -0
- package/build/utilities/runIgnite.js +26 -0
- package/build/utilities/showHelp.js +85 -0
- package/build/utilities/systemCommand.js +40 -0
- package/build/utilities/usePackage.js +8 -0
- package/build/utilities/validateProjectName.js +42 -0
- package/package.json +77 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import '../global.css';
|
|
2
|
+
import 'expo-dev-client';
|
|
3
|
+
import { ThemeProvider as NavThemeProvider } from '@react-navigation/native';
|
|
4
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
5
|
+
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
|
|
6
|
+
<% } %>
|
|
7
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
8
|
+
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
9
|
+
<% } %>
|
|
10
|
+
import { Stack } from 'expo-router';
|
|
11
|
+
import { StatusBar } from 'expo-status-bar';
|
|
12
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
13
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
14
|
+
<% } %>
|
|
15
|
+
|
|
16
|
+
import { ThemeToggle } from '@/components/ThemeToggle';
|
|
17
|
+
import { useColorScheme, useInitialAndroidBarSync } from '@/lib/useColorScheme';
|
|
18
|
+
import { NAV_THEME } from '@/theme';
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
// Catch any errors thrown by the Layout component.
|
|
22
|
+
ErrorBoundary,
|
|
23
|
+
} from 'expo-router';
|
|
24
|
+
|
|
25
|
+
export default function RootLayout() {
|
|
26
|
+
useInitialAndroidBarSync();
|
|
27
|
+
const { colorScheme, isDarkColorScheme } = useColorScheme();
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
<StatusBar
|
|
32
|
+
key={`root-status-bar-${isDarkColorScheme ? 'light' : 'dark'}`}
|
|
33
|
+
style={isDarkColorScheme ? 'light' : 'dark'}
|
|
34
|
+
/>
|
|
35
|
+
{/* WRAP YOUR APP WITH ANY ADDITIONAL PROVIDERS HERE */}
|
|
36
|
+
{/* <ExampleProvider> */}
|
|
37
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
38
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
39
|
+
<BottomSheetModalProvider>
|
|
40
|
+
<% } %>
|
|
41
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
42
|
+
<ActionSheetProvider>
|
|
43
|
+
<% } %>
|
|
44
|
+
<NavThemeProvider value={NAV_THEME[colorScheme]}>
|
|
45
|
+
<Stack screenOptions={SCREEN_OPTIONS}>
|
|
46
|
+
<Stack.Screen name="(drawer)" options={DRAWER_OPTIONS} />
|
|
47
|
+
<Stack.Screen name="modal" options={MODAL_OPTIONS} />
|
|
48
|
+
</Stack>
|
|
49
|
+
</NavThemeProvider>
|
|
50
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
51
|
+
</ActionSheetProvider>
|
|
52
|
+
<% } %>
|
|
53
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
54
|
+
</BottomSheetModalProvider>
|
|
55
|
+
</GestureHandlerRootView>
|
|
56
|
+
<% } %>
|
|
57
|
+
{/* </ExampleProvider> */}
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const SCREEN_OPTIONS = {
|
|
63
|
+
animation: 'ios_from_right', // for android
|
|
64
|
+
} as const;
|
|
65
|
+
|
|
66
|
+
const DRAWER_OPTIONS = {
|
|
67
|
+
headerShown: false,
|
|
68
|
+
} as const;
|
|
69
|
+
|
|
70
|
+
const MODAL_OPTIONS = {
|
|
71
|
+
presentation: 'modal',
|
|
72
|
+
animation: 'fade_from_bottom', // for android
|
|
73
|
+
title: 'Settings',
|
|
74
|
+
headerRight: () => <ThemeToggle />,
|
|
75
|
+
} as const;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Icon } from '@roninoss/icons';
|
|
2
|
+
import { StatusBar } from 'expo-status-bar';
|
|
3
|
+
import { Linking, Platform, View } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { Text } from '@/components/nativewindui/Text';
|
|
6
|
+
import { useColorScheme } from '@/lib/useColorScheme';
|
|
7
|
+
|
|
8
|
+
export default function ModalScreen() {
|
|
9
|
+
const { colors, colorScheme } = useColorScheme();
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<StatusBar
|
|
13
|
+
style={Platform.OS === 'ios' ? 'light' : colorScheme === 'dark' ? 'light' : 'dark'}
|
|
14
|
+
/>
|
|
15
|
+
<View className="flex-1 items-center justify-center gap-1 px-12">
|
|
16
|
+
<Icon name="file-plus-outline" size={42} color={colors.grey} />
|
|
17
|
+
<Text variant="title3" className="pb-1 text-center font-semibold">
|
|
18
|
+
NativewindUI
|
|
19
|
+
</Text>
|
|
20
|
+
<Text color="tertiary" variant="subhead" className="pb-4 text-center">
|
|
21
|
+
You can install any of the free components from the{' '}
|
|
22
|
+
<Text
|
|
23
|
+
onPress={() => Linking.openURL('https://nativewindui.com')}
|
|
24
|
+
variant="subhead"
|
|
25
|
+
className="text-primary">
|
|
26
|
+
NativewindUI
|
|
27
|
+
</Text>
|
|
28
|
+
{' website.'}
|
|
29
|
+
</Text>
|
|
30
|
+
</View>
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
@layer base {
|
|
6
|
+
:root {
|
|
7
|
+
--background: 242 242 247;
|
|
8
|
+
--foreground: 0 0 0;
|
|
9
|
+
--card: 255 255 255;
|
|
10
|
+
--card-foreground: 8 28 30;
|
|
11
|
+
--popover: 230 230 235;
|
|
12
|
+
--popover-foreground: 0 0 0;
|
|
13
|
+
--primary: 0 123 254;
|
|
14
|
+
--primary-foreground: 255 255 255;
|
|
15
|
+
--secondary: 45 175 231;
|
|
16
|
+
--secondary-foreground: 255 255 255;
|
|
17
|
+
--muted: 175 176 180;
|
|
18
|
+
--muted-foreground: 142 142 147;
|
|
19
|
+
--accent: 255 40 84;
|
|
20
|
+
--accent-foreground: 255 255 255;
|
|
21
|
+
--destructive: 255 56 43;
|
|
22
|
+
--destructive-foreground: 255 255 255;
|
|
23
|
+
--border: 230 230 235;
|
|
24
|
+
--input: 210 210 215;
|
|
25
|
+
--ring: 230 230 235;
|
|
26
|
+
|
|
27
|
+
--android-background: 249 249 255;
|
|
28
|
+
--android-foreground: 0 0 0;
|
|
29
|
+
--android-card: 255 255 255;
|
|
30
|
+
--android-card-foreground: 24 28 35;
|
|
31
|
+
--android-popover: 215 217 228;
|
|
32
|
+
--android-popover-foreground: 0 0 0;
|
|
33
|
+
--android-primary: 0 112 233;
|
|
34
|
+
--android-primary-foreground: 255 255 255;
|
|
35
|
+
--android-secondary: 176 201 255;
|
|
36
|
+
--android-secondary-foreground: 20 55 108;
|
|
37
|
+
--android-muted: 193 198 215;
|
|
38
|
+
--android-muted-foreground: 65 71 84;
|
|
39
|
+
--android-accent: 169 73 204;
|
|
40
|
+
--android-accent-foreground: 255 255 255;
|
|
41
|
+
--android-destructive: 186 26 26;
|
|
42
|
+
--android-destructive-foreground: 255 255 255;
|
|
43
|
+
--android-border: 215 217 228;
|
|
44
|
+
--android-input: 210 210 215;
|
|
45
|
+
--android-ring: 215 217 228;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media (prefers-color-scheme: dark) {
|
|
49
|
+
:root {
|
|
50
|
+
--background: 0 0 0;
|
|
51
|
+
--foreground: 255 255 255;
|
|
52
|
+
--card: 21 21 24;
|
|
53
|
+
--card-foreground: 255 255 255;
|
|
54
|
+
--popover: 40 40 42;
|
|
55
|
+
--popover-foreground: 255 255 255;
|
|
56
|
+
--primary: 3 133 255;
|
|
57
|
+
--primary-foreground: 255 255 255;
|
|
58
|
+
--secondary: 100 211 254;
|
|
59
|
+
--secondary-foreground: 255 255 255;
|
|
60
|
+
--muted: 70 70 73;
|
|
61
|
+
--muted-foreground: 142 142 147;
|
|
62
|
+
--accent: 255 52 95;
|
|
63
|
+
--accent-foreground: 255 255 255;
|
|
64
|
+
--destructive: 254 67 54;
|
|
65
|
+
--destructive-foreground: 255 255 255;
|
|
66
|
+
--border: 40 40 42;
|
|
67
|
+
--input: 55 55 57;
|
|
68
|
+
--ring: 40 40 42;
|
|
69
|
+
|
|
70
|
+
--android-background: 0 0 0;
|
|
71
|
+
--android-foreground: 255 255 255;
|
|
72
|
+
--android-card: 16 19 27;
|
|
73
|
+
--android-card-foreground: 224 226 237;
|
|
74
|
+
--android-popover: 39 42 50;
|
|
75
|
+
--android-popover-foreground: 224 226 237;
|
|
76
|
+
--android-primary: 3 133 255;
|
|
77
|
+
--android-primary-foreground: 255 255 255;
|
|
78
|
+
--android-secondary: 28 60 114;
|
|
79
|
+
--android-secondary-foreground: 189 209 255;
|
|
80
|
+
--android-muted: 216 226 255;
|
|
81
|
+
--android-muted-foreground: 139 144 160;
|
|
82
|
+
--android-accent: 83 0 111;
|
|
83
|
+
--android-accent-foreground: 238 177 255;
|
|
84
|
+
--android-destructive: 147 0 10;
|
|
85
|
+
--android-destructive-foreground: 255 255 255;
|
|
86
|
+
--android-border: 39 42 50;
|
|
87
|
+
--android-input: 55 55 57;
|
|
88
|
+
--android-ring: 39 42 50;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useColorScheme as useNativewindColorScheme } from 'nativewind';
|
|
2
|
+
|
|
3
|
+
import { COLORS } from '@/theme/colors';
|
|
4
|
+
|
|
5
|
+
function useColorScheme() {
|
|
6
|
+
const { colorScheme, setColorScheme } = useNativewindColorScheme();
|
|
7
|
+
|
|
8
|
+
function toggleColorScheme() {
|
|
9
|
+
return setColorScheme(colorScheme === 'light' ? 'dark' : 'light');
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
colorScheme: colorScheme ?? 'light',
|
|
14
|
+
isDarkColorScheme: colorScheme === 'dark',
|
|
15
|
+
setColorScheme,
|
|
16
|
+
toggleColorScheme,
|
|
17
|
+
colors: COLORS[colorScheme ?? 'light'],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { useColorScheme };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="nativewind/types" />
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ScrollViewStyleReset } from 'expo-router/html';
|
|
2
|
+
|
|
3
|
+
// This file is web-only and used to configure the root HTML for every
|
|
4
|
+
// web page during static rendering.
|
|
5
|
+
// The contents of this function only run in Node.js environments and
|
|
6
|
+
// do not have access to the DOM or browser APIs.
|
|
7
|
+
export default function Root({ children }: { children: React.ReactNode }) {
|
|
8
|
+
return (
|
|
9
|
+
<html lang="en">
|
|
10
|
+
<head>
|
|
11
|
+
<meta charSet="utf-8" />
|
|
12
|
+
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
|
|
13
|
+
|
|
14
|
+
{/*
|
|
15
|
+
This viewport disables scaling which makes the mobile website act more like a native app.
|
|
16
|
+
However this does reduce built-in accessibility. If you want to enable scaling, use this instead:
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
18
|
+
*/}
|
|
19
|
+
<meta
|
|
20
|
+
name="viewport"
|
|
21
|
+
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1.00001,viewport-fit=cover"
|
|
22
|
+
/>
|
|
23
|
+
{/*
|
|
24
|
+
Disable body scrolling on web. This makes ScrollView components work closer to how they do on native.
|
|
25
|
+
However, body scrolling is often nice to have for mobile web. If you want to enable it, remove this line.
|
|
26
|
+
*/}
|
|
27
|
+
<ScrollViewStyleReset />
|
|
28
|
+
|
|
29
|
+
{/* Using raw CSS styles as an escape-hatch to ensure the background color never flickers in dark-mode. */}
|
|
30
|
+
<style dangerouslySetInnerHTML={{ __html: responsiveBackground }} />
|
|
31
|
+
{/* Add any additional <head> elements that you want globally available on web... */}
|
|
32
|
+
</head>
|
|
33
|
+
<body>{children}</body>
|
|
34
|
+
</html>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const responsiveBackground = `
|
|
39
|
+
body {
|
|
40
|
+
background-color: #fff;
|
|
41
|
+
}
|
|
42
|
+
@media (prefers-color-scheme: dark) {
|
|
43
|
+
body {
|
|
44
|
+
background-color: #000;
|
|
45
|
+
}
|
|
46
|
+
}`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Link, Stack } from 'expo-router';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { Text } from '@/components/nativewindui/Text';
|
|
4
|
+
|
|
5
|
+
export default function NotFoundScreen() {
|
|
6
|
+
return (
|
|
7
|
+
<>
|
|
8
|
+
<Stack.Screen options={{ title: 'Oops!' }} />
|
|
9
|
+
<View className='flex-1 items-center justify-center p-5 bg-background'>
|
|
10
|
+
<Text variant='largeTitle'>{"This screen doesn't exist."}</Text>
|
|
11
|
+
|
|
12
|
+
<Link href='/' className='m-4 py-4'>
|
|
13
|
+
<Text>Go to home screen!</Text>
|
|
14
|
+
</Link>
|
|
15
|
+
</View>
|
|
16
|
+
</>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import '@/global.css';
|
|
2
|
+
|
|
3
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
4
|
+
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
|
|
5
|
+
<% } %>
|
|
6
|
+
import { ThemeProvider as NavThemeProvider } from '@react-navigation/native';
|
|
7
|
+
import * as Device from 'expo-device';
|
|
8
|
+
import { Link, Stack } from 'expo-router';
|
|
9
|
+
import { StatusBar } from 'expo-status-bar';
|
|
10
|
+
import { Platform, Pressable } from 'react-native';
|
|
11
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
12
|
+
|
|
13
|
+
import { Icon } from '@/components/nativewindui/Icon';
|
|
14
|
+
import { ThemeToggle } from '@/components/nativewindui/ThemeToggle';
|
|
15
|
+
import { cn } from '@/lib/cn';
|
|
16
|
+
import { useColorScheme } from '@/lib/useColorScheme';
|
|
17
|
+
import { NAV_THEME } from '@/theme';
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
// Catch any errors thrown by the Layout component.
|
|
21
|
+
ErrorBoundary,
|
|
22
|
+
} from 'expo-router';
|
|
23
|
+
|
|
24
|
+
const isIos26 = Platform.select({ default: false, ios: Device.osVersion?.startsWith('26.' )});
|
|
25
|
+
|
|
26
|
+
export default function RootLayout() {
|
|
27
|
+
const { colorScheme, isDarkColorScheme } = useColorScheme();
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
<StatusBar
|
|
32
|
+
key={`root-status-bar-${isDarkColorScheme ? 'light' : 'dark'}`}
|
|
33
|
+
style={isDarkColorScheme ? 'light' : 'dark'}
|
|
34
|
+
/>
|
|
35
|
+
{/* WRAP YOUR APP WITH ANY ADDITIONAL PROVIDERS HERE */}
|
|
36
|
+
{/* <ExampleProvider> */}
|
|
37
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
38
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
39
|
+
<ActionSheetProvider>
|
|
40
|
+
<% } %>
|
|
41
|
+
<NavThemeProvider value={NAV_THEME[colorScheme]}>
|
|
42
|
+
<Stack>
|
|
43
|
+
<Stack.Screen name="index" options={INDEX_OPTIONS} />
|
|
44
|
+
<Stack.Screen name="modal" options={MODAL_OPTIONS} />
|
|
45
|
+
</Stack>
|
|
46
|
+
</NavThemeProvider>
|
|
47
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
48
|
+
</ActionSheetProvider>
|
|
49
|
+
<% } %>
|
|
50
|
+
</GestureHandlerRootView>
|
|
51
|
+
{/* </ExampleProvider> */}
|
|
52
|
+
</>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const INDEX_OPTIONS = {
|
|
57
|
+
headerLargeTitle: true,
|
|
58
|
+
headerTransparent: isIos26,
|
|
59
|
+
title: 'NativewindUI',
|
|
60
|
+
headerRight: () => <SettingsIcon />,
|
|
61
|
+
} as const;
|
|
62
|
+
|
|
63
|
+
function SettingsIcon() {
|
|
64
|
+
return (
|
|
65
|
+
<Link href="/modal" asChild>
|
|
66
|
+
<Pressable className={cn('opacity-80 active:opacity-50', isIos26 && 'px-1.5')}>
|
|
67
|
+
<Icon name='gearshape' className='text-foreground' />
|
|
68
|
+
</Pressable>
|
|
69
|
+
</Link>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const MODAL_OPTIONS = {
|
|
74
|
+
presentation: 'modal',
|
|
75
|
+
animation: 'fade_from_bottom', // for android
|
|
76
|
+
title: 'Settings',
|
|
77
|
+
headerRight: () => <ThemeToggle />,
|
|
78
|
+
} as const;
|