@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,78 @@
|
|
|
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';
|
|
7
|
+
<% } %>
|
|
8
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
9
|
+
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
10
|
+
<% } %>
|
|
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';
|
|
16
|
+
<% } %>
|
|
17
|
+
|
|
18
|
+
import { ThemeToggle } from '@/components/ThemeToggle';
|
|
19
|
+
import { cn } from '@/lib/cn';
|
|
20
|
+
import { useColorScheme, useInitialAndroidBarSync } from '@/lib/useColorScheme';
|
|
21
|
+
import { NAV_THEME } from '@/theme';
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
// Catch any errors thrown by the Layout component.
|
|
25
|
+
ErrorBoundary,
|
|
26
|
+
} from 'expo-router';
|
|
27
|
+
|
|
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
|
+
{/* WRAP YOUR APP WITH ANY ADDITIONAL PROVIDERS HERE */}
|
|
39
|
+
{/* <ExampleProvider> */}
|
|
40
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
41
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
42
|
+
<BottomSheetModalProvider>
|
|
43
|
+
<% } %>
|
|
44
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
45
|
+
<ActionSheetProvider>
|
|
46
|
+
<% } %>
|
|
47
|
+
<NavThemeProvider value={NAV_THEME[colorScheme]}>
|
|
48
|
+
<Stack screenOptions={SCREEN_OPTIONS}>
|
|
49
|
+
<Stack.Screen name="(tabs)" options={TABS_OPTIONS} />
|
|
50
|
+
<Stack.Screen name="modal" options={MODAL_OPTIONS} />
|
|
51
|
+
</Stack>
|
|
52
|
+
</NavThemeProvider>
|
|
53
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
54
|
+
</ActionSheetProvider>
|
|
55
|
+
<% } %>
|
|
56
|
+
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
57
|
+
</BottomSheetModalProvider>
|
|
58
|
+
</GestureHandlerRootView>
|
|
59
|
+
<% } %>
|
|
60
|
+
{/* </ExampleProvider> */}
|
|
61
|
+
</>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const SCREEN_OPTIONS = {
|
|
66
|
+
animation: 'ios_from_right', // for android
|
|
67
|
+
} as const;
|
|
68
|
+
|
|
69
|
+
const TABS_OPTIONS = {
|
|
70
|
+
headerShown: false,
|
|
71
|
+
} as const;
|
|
72
|
+
|
|
73
|
+
const MODAL_OPTIONS = {
|
|
74
|
+
presentation: 'modal',
|
|
75
|
+
animation: 'fade_from_bottom', // for android
|
|
76
|
+
title: 'Settings',
|
|
77
|
+
headerRight: () => <ThemeToggle />,
|
|
78
|
+
} as const;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { StatusBar } from 'expo-status-bar';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { ScreenContent } from '@/components/ScreenContent';
|
|
5
|
+
|
|
6
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
7
|
+
import { InternalizationExample } from 'components/InternalizationExample';
|
|
8
|
+
<% } %>
|
|
9
|
+
|
|
10
|
+
export default function Modal() {
|
|
11
|
+
return (
|
|
12
|
+
<>
|
|
13
|
+
<ScreenContent path="app/modal.tsx" title="Modal">
|
|
14
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
15
|
+
<InternalizationExample />
|
|
16
|
+
<% } %>
|
|
17
|
+
</ScreenContent>
|
|
18
|
+
<StatusBar style={Platform.OS === 'ios' ? 'light' : 'auto'} />
|
|
19
|
+
</>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const { hairlineWidth, platformSelect } = require('nativewind/theme');
|
|
2
|
+
|
|
3
|
+
/** @type {import('tailwindcss').Config} */
|
|
4
|
+
module.exports = {
|
|
5
|
+
// NOTE: Update this to include the paths to all of your component files.
|
|
6
|
+
darkMode: 'class', // Enable manual toggling of dark mode
|
|
7
|
+
content: ['./app/**/*.{js,jsx,ts,tsx}', './components/**/*.{js,jsx,ts,tsx}'],
|
|
8
|
+
presets: [require('nativewind/preset')],
|
|
9
|
+
theme: {
|
|
10
|
+
extend: {
|
|
11
|
+
colors: {
|
|
12
|
+
border: withOpacity('border'),
|
|
13
|
+
input: withOpacity('input'),
|
|
14
|
+
ring: withOpacity('ring'),
|
|
15
|
+
background: withOpacity('background'),
|
|
16
|
+
foreground: withOpacity('foreground'),
|
|
17
|
+
primary: {
|
|
18
|
+
DEFAULT: withOpacity('primary'),
|
|
19
|
+
foreground: withOpacity('primary-foreground'),
|
|
20
|
+
},
|
|
21
|
+
secondary: {
|
|
22
|
+
DEFAULT: withOpacity('secondary'),
|
|
23
|
+
foreground: withOpacity('secondary-foreground'),
|
|
24
|
+
},
|
|
25
|
+
destructive: {
|
|
26
|
+
DEFAULT: withOpacity('destructive'),
|
|
27
|
+
foreground: withOpacity('destructive-foreground'),
|
|
28
|
+
},
|
|
29
|
+
muted: {
|
|
30
|
+
DEFAULT: withOpacity('muted'),
|
|
31
|
+
foreground: withOpacity('muted-foreground'),
|
|
32
|
+
},
|
|
33
|
+
accent: {
|
|
34
|
+
DEFAULT: withOpacity('accent'),
|
|
35
|
+
foreground: withOpacity('accent-foreground'),
|
|
36
|
+
},
|
|
37
|
+
popover: {
|
|
38
|
+
DEFAULT: withOpacity('popover'),
|
|
39
|
+
foreground: withOpacity('popover-foreground'),
|
|
40
|
+
},
|
|
41
|
+
card: {
|
|
42
|
+
DEFAULT: withOpacity('card'),
|
|
43
|
+
foreground: withOpacity('card-foreground'),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
borderWidth: {
|
|
47
|
+
hairline: hairlineWidth(),
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
plugins: [],
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
function withOpacity(variableName) {
|
|
55
|
+
return ({ opacityValue }) => {
|
|
56
|
+
if (opacityValue !== undefined) {
|
|
57
|
+
return platformSelect({
|
|
58
|
+
ios: `rgb(var(--${variableName}) / ${opacityValue})`,
|
|
59
|
+
android: `rgb(var(--android-${variableName}) / ${opacityValue})`,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return platformSelect({
|
|
63
|
+
ios: `rgb(var(--${variableName}))`,
|
|
64
|
+
android: `rgb(var(--android-${variableName}))`,
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const IOS_SYSTEM_COLORS = {
|
|
4
|
+
white: 'rgb(255, 255, 255)',
|
|
5
|
+
black: 'rgb(0, 0, 0)',
|
|
6
|
+
light: {
|
|
7
|
+
grey6: 'rgb(242, 242, 247)',
|
|
8
|
+
grey5: 'rgb(230, 230, 235)',
|
|
9
|
+
grey4: 'rgb(210, 210, 215)',
|
|
10
|
+
grey3: 'rgb(199, 199, 204)',
|
|
11
|
+
grey2: 'rgb(175, 176, 180)',
|
|
12
|
+
grey: 'rgb(142, 142, 147)',
|
|
13
|
+
background: 'rgb(242, 242, 247)',
|
|
14
|
+
foreground: 'rgb(0, 0, 0)',
|
|
15
|
+
root: 'rgb(255, 255, 255)',
|
|
16
|
+
card: 'rgb(255, 255, 255)',
|
|
17
|
+
cardForeground: 'rgb(8, 28, 30)',
|
|
18
|
+
popover: 'rgb(230, 230, 235)',
|
|
19
|
+
popoverForeground: 'rgb(0, 0, 0)',
|
|
20
|
+
destructive: 'rgb(255, 56, 43)',
|
|
21
|
+
primary: 'rgb(0, 123, 254)',
|
|
22
|
+
primaryForeground: 'rgb(255, 255, 255)',
|
|
23
|
+
secondary: 'rgb(45, 175, 231)',
|
|
24
|
+
secondaryForeground: 'rgb(255, 255, 255)',
|
|
25
|
+
muted: 'rgb(175, 176, 180)',
|
|
26
|
+
mutedForeground: 'rgb(142, 142, 147)',
|
|
27
|
+
accent: 'rgb(255, 40, 84)',
|
|
28
|
+
accentForeground: 'rgb(255, 255, 255)',
|
|
29
|
+
border: 'rgb(230, 230, 235)',
|
|
30
|
+
input: 'rgb(210, 210, 215)',
|
|
31
|
+
ring: 'rgb(230, 230, 235)',
|
|
32
|
+
},
|
|
33
|
+
dark: {
|
|
34
|
+
grey6: 'rgb(21, 21, 24)',
|
|
35
|
+
grey5: 'rgb(40, 40, 42)',
|
|
36
|
+
grey4: 'rgb(55, 55, 57)',
|
|
37
|
+
grey3: 'rgb(70, 70, 73)',
|
|
38
|
+
grey2: 'rgb(99, 99, 102)',
|
|
39
|
+
grey: 'rgb(142, 142, 147)',
|
|
40
|
+
background: 'rgb(0, 0, 0)',
|
|
41
|
+
foreground: 'rgb(255, 255, 255)',
|
|
42
|
+
root: 'rgb(0, 0, 0)',
|
|
43
|
+
card: 'rgb(28, 28, 30)',
|
|
44
|
+
cardForeground: 'rgb(255, 255, 255)',
|
|
45
|
+
popover: 'rgb(40, 40, 42)',
|
|
46
|
+
popoverForeground: 'rgb(255, 255, 255)',
|
|
47
|
+
destructive: 'rgb(254, 67, 54)',
|
|
48
|
+
primary: 'rgb(3, 133, 255)',
|
|
49
|
+
primaryForeground: 'rgb(255, 255, 255)',
|
|
50
|
+
secondary: 'rgb(100, 211, 254)',
|
|
51
|
+
secondaryForeground: 'rgb(255, 255, 255)',
|
|
52
|
+
muted: 'rgb(70, 70, 73)',
|
|
53
|
+
mutedForeground: 'rgb(142, 142, 147)',
|
|
54
|
+
accent: 'rgb(255, 52, 95)',
|
|
55
|
+
accentForeground: 'rgb(255, 255, 255)',
|
|
56
|
+
border: 'rgb(40, 40, 42)',
|
|
57
|
+
input: 'rgb(55, 55, 57)',
|
|
58
|
+
ring: 'rgb(40, 40, 42)',
|
|
59
|
+
},
|
|
60
|
+
} as const;
|
|
61
|
+
|
|
62
|
+
const ANDROID_COLORS = {
|
|
63
|
+
white: 'rgb(255, 255, 255)',
|
|
64
|
+
black: 'rgb(0, 0, 0)',
|
|
65
|
+
light: {
|
|
66
|
+
grey6: 'rgb(249, 249, 255)',
|
|
67
|
+
grey5: 'rgb(215, 217, 228)',
|
|
68
|
+
grey4: 'rgb(193, 198, 215)',
|
|
69
|
+
grey3: 'rgb(113, 119, 134)',
|
|
70
|
+
grey2: 'rgb(65, 71, 84)',
|
|
71
|
+
grey: 'rgb(24, 28, 35)',
|
|
72
|
+
background: 'rgb(249, 249, 255)',
|
|
73
|
+
foreground: 'rgb(0, 0, 0)',
|
|
74
|
+
root: 'rgb(255, 255, 255)',
|
|
75
|
+
card: 'rgb(255, 255, 255)',
|
|
76
|
+
cardForeground: 'rgb(24, 28, 35)',
|
|
77
|
+
popover: 'rgb(215, 217, 228)',
|
|
78
|
+
popoverForeground: 'rgb(0, 0, 0)',
|
|
79
|
+
destructive: 'rgb(186, 26, 26)',
|
|
80
|
+
primary: 'rgb(0, 112, 233)',
|
|
81
|
+
primaryForeground: 'rgb(255, 255, 255)',
|
|
82
|
+
secondary: 'rgb(176, 201, 255)',
|
|
83
|
+
secondaryForeground: 'rgb(20, 55, 108)',
|
|
84
|
+
muted: 'rgb(193, 198, 215)',
|
|
85
|
+
mutedForeground: 'rgb(65, 71, 84)',
|
|
86
|
+
accent: 'rgb(169, 73, 204)',
|
|
87
|
+
accentForeground: 'rgb(255, 255, 255)',
|
|
88
|
+
border: 'rgb(215, 217, 228)',
|
|
89
|
+
input: 'rgb(210, 210, 215)',
|
|
90
|
+
ring: 'rgb(215, 217, 228)',
|
|
91
|
+
},
|
|
92
|
+
dark: {
|
|
93
|
+
grey6: 'rgb(16, 19, 27)',
|
|
94
|
+
grey5: 'rgb(39, 42, 50)',
|
|
95
|
+
grey4: 'rgb(49, 53, 61)',
|
|
96
|
+
grey3: 'rgb(54, 57, 66)',
|
|
97
|
+
grey2: 'rgb(139, 144, 160)',
|
|
98
|
+
grey: 'rgb(193, 198, 215)',
|
|
99
|
+
background: 'rgb(0, 0, 0)',
|
|
100
|
+
foreground: 'rgb(255, 255, 255)',
|
|
101
|
+
root: 'rgb(0, 0, 0)',
|
|
102
|
+
card: 'rgb(16, 19, 27)',
|
|
103
|
+
cardForeground: 'rgb(224, 226, 237)',
|
|
104
|
+
popover: 'rgb(39, 42, 50)',
|
|
105
|
+
popoverForeground: 'rgb(224, 226, 237)',
|
|
106
|
+
destructive: 'rgb(147, 0, 10)',
|
|
107
|
+
primary: 'rgb(3, 133, 255)',
|
|
108
|
+
primaryForeground: 'rgb(255, 255, 255)',
|
|
109
|
+
secondary: 'rgb(28, 60, 114)',
|
|
110
|
+
secondaryForeground: 'rgb(189, 209, 255)',
|
|
111
|
+
muted: 'rgb(216, 226, 255)',
|
|
112
|
+
mutedForeground: 'rgb(139, 144, 160)',
|
|
113
|
+
accent: 'rgb(83, 0, 111)',
|
|
114
|
+
accentForeground: 'rgb(238, 177, 255)',
|
|
115
|
+
border: 'rgb(39, 42, 50)',
|
|
116
|
+
input: 'rgb(55, 55, 57)',
|
|
117
|
+
ring: 'rgb(39, 42, 50)',
|
|
118
|
+
},
|
|
119
|
+
} as const;
|
|
120
|
+
|
|
121
|
+
const COLORS = Platform.OS === 'ios' ? IOS_SYSTEM_COLORS : ANDROID_COLORS;
|
|
122
|
+
|
|
123
|
+
export { COLORS };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Theme, DefaultTheme, DarkTheme } from '@react-navigation/native';
|
|
2
|
+
|
|
3
|
+
import { COLORS } from './colors';
|
|
4
|
+
|
|
5
|
+
const NAV_THEME: { light: Theme; dark: Theme } = {
|
|
6
|
+
light: {
|
|
7
|
+
dark: false,
|
|
8
|
+
colors: {
|
|
9
|
+
background: COLORS.light.background,
|
|
10
|
+
border: COLORS.light.grey5,
|
|
11
|
+
card: COLORS.light.card,
|
|
12
|
+
notification: COLORS.light.destructive,
|
|
13
|
+
primary: COLORS.light.primary,
|
|
14
|
+
text: COLORS.black,
|
|
15
|
+
},
|
|
16
|
+
fonts: DefaultTheme.fonts,
|
|
17
|
+
},
|
|
18
|
+
dark: {
|
|
19
|
+
dark: true,
|
|
20
|
+
colors: {
|
|
21
|
+
background: COLORS.dark.background,
|
|
22
|
+
border: COLORS.dark.grey5,
|
|
23
|
+
card: COLORS.dark.grey6,
|
|
24
|
+
notification: COLORS.dark.destructive,
|
|
25
|
+
primary: COLORS.dark.primary,
|
|
26
|
+
text: COLORS.white,
|
|
27
|
+
},
|
|
28
|
+
fonts: DarkTheme.fonts,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { NAV_THEME };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
export function withOpacity(color: string, opacity: number): string {
|
|
2
|
+
if (opacity < 0 || opacity > 1) {
|
|
3
|
+
throw new Error('Opacity should be between 0 and 1.');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// Detect the color format and delegate to the appropriate function
|
|
7
|
+
if (isNamedColor(color)) {
|
|
8
|
+
return withOpacityNamedColor(color, opacity);
|
|
9
|
+
} else if (color.startsWith('#')) {
|
|
10
|
+
return withOpacityHex(color, opacity);
|
|
11
|
+
} else if (color.startsWith('rgba')) {
|
|
12
|
+
return withOpacityRgba(color, opacity);
|
|
13
|
+
} else if (color.startsWith('rgb')) {
|
|
14
|
+
return withOpacityRgb(color, opacity);
|
|
15
|
+
} else if (color.startsWith('hsla')) {
|
|
16
|
+
return withOpacityHsla(color, opacity);
|
|
17
|
+
} else if (color.startsWith('hsl')) {
|
|
18
|
+
return withOpacityHsl(color, opacity);
|
|
19
|
+
} else {
|
|
20
|
+
throw new Error('Unsupported color format');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Helper function for HEX colors
|
|
25
|
+
function withOpacityHex(hex: string, opacity: number): string {
|
|
26
|
+
const hexCode = hex.replace('#', '');
|
|
27
|
+
const expandedHex =
|
|
28
|
+
hexCode.length === 3
|
|
29
|
+
? hexCode
|
|
30
|
+
.split('')
|
|
31
|
+
.map((x) => x + x)
|
|
32
|
+
.join('')
|
|
33
|
+
: hexCode;
|
|
34
|
+
|
|
35
|
+
const r = parseInt(expandedHex.substr(0, 2), 16);
|
|
36
|
+
const g = parseInt(expandedHex.substr(2, 2), 16);
|
|
37
|
+
const b = parseInt(expandedHex.substr(4, 2), 16);
|
|
38
|
+
|
|
39
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Helper function for RGB colors
|
|
43
|
+
function withOpacityRgb(rgb: string, opacity: number): string {
|
|
44
|
+
const match = rgb.match(/^rgb\((\d+), (\d+), (\d+)\)$/);
|
|
45
|
+
if (!match) {
|
|
46
|
+
throw new Error('Invalid RGB color format');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const r = parseInt(match[1], 10);
|
|
50
|
+
const g = parseInt(match[2], 10);
|
|
51
|
+
const b = parseInt(match[3], 10);
|
|
52
|
+
|
|
53
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Helper function for RGBA colors
|
|
57
|
+
function withOpacityRgba(rgba: string, opacity: number): string {
|
|
58
|
+
const match = rgba.match(/^rgba\((\d+), (\d+), (\d+), ([0-1]?(?:\.\d+)?)\)$/);
|
|
59
|
+
if (!match) {
|
|
60
|
+
throw new Error('Invalid RGBA color format');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const r = parseInt(match[1], 10);
|
|
64
|
+
const g = parseInt(match[2], 10);
|
|
65
|
+
const b = parseInt(match[3], 10);
|
|
66
|
+
|
|
67
|
+
return `rgba(${r}, ${g}, ${b}, ${opacity})`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Helper function for HSL colors with opacity
|
|
71
|
+
function withOpacityHsl(hsl: string, opacity: number): string {
|
|
72
|
+
// Updated regex to handle space-separated HSL format with optional decimals
|
|
73
|
+
const match = hsl.match(/^hsl\((\d+(\.\d+)?)(?:\s+)(\d+(\.\d+)?)%\s+(\d+(\.\d+)?)%\)$/);
|
|
74
|
+
|
|
75
|
+
if (!match) {
|
|
76
|
+
throw new Error('Invalid HSL color format');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const h = match[1]; // Hue (can be an integer or decimal)
|
|
80
|
+
const s = match[3]; // Saturation (can be an integer or decimal)
|
|
81
|
+
const l = match[5]; // Lightness (can be an integer or decimal)
|
|
82
|
+
|
|
83
|
+
return `hsla(${h}, ${s}%, ${l}%, ${opacity})`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Helper function for HSLA colors
|
|
87
|
+
function withOpacityHsla(hsla: string, opacity: number): string {
|
|
88
|
+
const match = hsla.match(/^hsla\((\d+), (\d+)%?, (\d+)%?, ([0-1]?(?:\.\d+)?)\)$/);
|
|
89
|
+
if (!match) {
|
|
90
|
+
throw new Error('Invalid HSLA color format');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const h = match[1];
|
|
94
|
+
const s = match[2];
|
|
95
|
+
const l = match[3];
|
|
96
|
+
|
|
97
|
+
return `hsla(${h}, ${s}%, ${l}%, ${opacity})`;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Helper function for named colors (basic implementation)
|
|
101
|
+
function isNamedColor(color: string): boolean {
|
|
102
|
+
const namedColors = new Set([
|
|
103
|
+
'red',
|
|
104
|
+
'green',
|
|
105
|
+
'blue',
|
|
106
|
+
'yellow',
|
|
107
|
+
'black',
|
|
108
|
+
'white',
|
|
109
|
+
'gray',
|
|
110
|
+
'orange',
|
|
111
|
+
'purple',
|
|
112
|
+
'brown',
|
|
113
|
+
'pink',
|
|
114
|
+
'cyan',
|
|
115
|
+
'magenta',
|
|
116
|
+
'lime',
|
|
117
|
+
'teal',
|
|
118
|
+
'indigo',
|
|
119
|
+
'violet',
|
|
120
|
+
'gold',
|
|
121
|
+
'silver',
|
|
122
|
+
]);
|
|
123
|
+
return namedColors.has(color.toLowerCase());
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Helper function for named color opacity
|
|
127
|
+
function withOpacityNamedColor(color: string, opacity: number): string {
|
|
128
|
+
return `rgba(${namedColorToRgb(color)}, ${opacity})`;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Converts a named color to RGB (simplified, basic colors only)
|
|
132
|
+
function namedColorToRgb(color: string): string {
|
|
133
|
+
const colors: { [key: string]: string } = {
|
|
134
|
+
red: '255, 0, 0',
|
|
135
|
+
green: '0, 255, 0',
|
|
136
|
+
blue: '0, 0, 255',
|
|
137
|
+
yellow: '255, 255, 0',
|
|
138
|
+
black: '0, 0, 0',
|
|
139
|
+
white: '255, 255, 255',
|
|
140
|
+
gray: '128, 128, 128',
|
|
141
|
+
orange: '255, 165, 0',
|
|
142
|
+
purple: '128, 0, 128',
|
|
143
|
+
brown: '165, 42, 42',
|
|
144
|
+
pink: '255, 192, 203',
|
|
145
|
+
cyan: '0, 255, 255',
|
|
146
|
+
magenta: '255, 0, 255',
|
|
147
|
+
lime: '0, 255, 0',
|
|
148
|
+
teal: '0, 128, 128',
|
|
149
|
+
indigo: '75, 0, 130',
|
|
150
|
+
violet: '238, 130, 238',
|
|
151
|
+
gold: '255, 215, 0',
|
|
152
|
+
silver: '192, 192, 192',
|
|
153
|
+
};
|
|
154
|
+
return colors[color.toLowerCase()] || '0, 0, 0'; // default to black if color is unknown
|
|
155
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
2
|
+
import './global.css';
|
|
3
|
+
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
|
4
|
+
<% } else if (props.stylingPackage?.name === "nativewinui") { %>
|
|
5
|
+
import './global.css';
|
|
6
|
+
import 'expo-dev-client';
|
|
7
|
+
<% } %>
|
|
8
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
9
|
+
import './unistyles';
|
|
10
|
+
import { DefaultTheme, DarkTheme } from '@react-navigation/native';
|
|
11
|
+
import { useUnistyles } from 'react-native-unistyles';
|
|
12
|
+
import { useMemo } from 'react';
|
|
13
|
+
<% } else if (props.stylingPackage?.name === "nativewind" || props.stylingPackage?.name === "stylesheet") { %>
|
|
14
|
+
import { DefaultTheme, DarkTheme } from '@react-navigation/native';
|
|
15
|
+
import { useColorScheme } from 'react-native';
|
|
16
|
+
import { useMemo } from 'react';
|
|
17
|
+
<% } %>
|
|
18
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
19
|
+
import './translation';
|
|
20
|
+
<% } %>
|
|
21
|
+
import "react-native-gesture-handler";
|
|
22
|
+
|
|
23
|
+
<% if (props.analyticsPackage?.name === "vexo-analytics") { %>
|
|
24
|
+
import { vexo } from 'vexo-analytics';
|
|
25
|
+
|
|
26
|
+
const vexoApiKey = process.env.EXPO_PUBLIC_VEXO_API_KEY || process.env.VEXO_API_KEY;
|
|
27
|
+
if (vexoApiKey) {
|
|
28
|
+
vexo(vexoApiKey); // eslint-disable-line
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
import Navigation from "./navigation"; // eslint-disable-line
|
|
32
|
+
<% } else { %>
|
|
33
|
+
import Navigation from "./navigation";
|
|
34
|
+
<% } %>
|
|
35
|
+
|
|
36
|
+
export default function App() {
|
|
37
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
38
|
+
const { theme, rt } = useUnistyles();
|
|
39
|
+
|
|
40
|
+
const baseTheme = rt.colorScheme === 'dark' ? DarkTheme : DefaultTheme;
|
|
41
|
+
const mergedTheme = useMemo(() => ({
|
|
42
|
+
...baseTheme,
|
|
43
|
+
colors: {
|
|
44
|
+
...baseTheme.colors,
|
|
45
|
+
background: theme.colors.background,
|
|
46
|
+
text: theme.colors.typography,
|
|
47
|
+
primary: theme.colors.astral,
|
|
48
|
+
secondary: theme.colors.cornflowerBlue,
|
|
49
|
+
border: theme.colors.limedSpruce,
|
|
50
|
+
card: theme.colors.background,
|
|
51
|
+
notification: theme.colors.astral,
|
|
52
|
+
},
|
|
53
|
+
}), [baseTheme, theme.colors.background, theme.colors.typography, theme.colors.astral, theme.colors.cornflowerBlue, theme.colors.limedSpruce]);
|
|
54
|
+
|
|
55
|
+
return <Navigation theme={mergedTheme} />;
|
|
56
|
+
<% } else if (props.stylingPackage?.name === "nativewind") { %>
|
|
57
|
+
const colorScheme = useColorScheme();
|
|
58
|
+
const theme = useMemo(() => colorScheme === 'dark' ? DarkTheme : DefaultTheme, [colorScheme]);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<SafeAreaProvider>
|
|
62
|
+
<Navigation theme={theme} />
|
|
63
|
+
</SafeAreaProvider>
|
|
64
|
+
);
|
|
65
|
+
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
66
|
+
const colorScheme = useColorScheme();
|
|
67
|
+
const theme = useMemo(() => colorScheme === 'dark' ? DarkTheme : DefaultTheme, [colorScheme]);
|
|
68
|
+
|
|
69
|
+
return <Navigation theme={theme} />;
|
|
70
|
+
<% } else { %>
|
|
71
|
+
return <Navigation />;
|
|
72
|
+
<% } %>
|
|
73
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Ionicons, MaterialIcons } from '@expo/vector-icons';
|
|
2
|
+
import { createDrawerNavigator } from '@react-navigation/drawer';
|
|
3
|
+
import { HeaderButton } from 'components/HeaderButton';
|
|
4
|
+
import TabNavigator from './tab-navigator';
|
|
5
|
+
import Home from '../screens/home';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
const Drawer = createDrawerNavigator({
|
|
9
|
+
screens: {
|
|
10
|
+
Home: {
|
|
11
|
+
screen: Home,
|
|
12
|
+
options: {
|
|
13
|
+
drawerIcon: ({ size, color }) => (
|
|
14
|
+
<Ionicons name="home-outline" size={size} color={color} />
|
|
15
|
+
),
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
Tabs: {
|
|
19
|
+
screen: TabNavigator,
|
|
20
|
+
options: ({ navigation })=> ({
|
|
21
|
+
headerRight: () => <HeaderButton onPress={() => navigation.navigate('Modal')} />,
|
|
22
|
+
drawerIcon: ({ size, color }) => (
|
|
23
|
+
<MaterialIcons name="border-bottom" size={size} color={color} />
|
|
24
|
+
),
|
|
25
|
+
})
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export default Drawer;
|
|
31
|
+
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<% if (props.navigationPackage?.options.type === 'stack') { %>
|
|
2
|
+
import { createStaticNavigation, StaticParamList } from '@react-navigation/native';
|
|
3
|
+
import { createStackNavigator } from '@react-navigation/stack';
|
|
4
|
+
import Overview from "../screens/overview";
|
|
5
|
+
import Details from "../screens/details";
|
|
6
|
+
import { BackButton } from '../components/BackButton';
|
|
7
|
+
|
|
8
|
+
const Stack = createStackNavigator({
|
|
9
|
+
screens: {
|
|
10
|
+
Overview: {
|
|
11
|
+
screen: Overview,
|
|
12
|
+
},
|
|
13
|
+
Details: {
|
|
14
|
+
screen: Details,
|
|
15
|
+
options: ({ navigation }) => ({
|
|
16
|
+
headerLeft: () => <BackButton onPress={navigation.goBack} />,
|
|
17
|
+
})
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
type RootNavigatorParamList = StaticParamList<typeof Stack>;
|
|
23
|
+
|
|
24
|
+
declare global {
|
|
25
|
+
namespace ReactNavigation {
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
27
|
+
interface RootParamList extends RootNavigatorParamList {}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const Navigation = createStaticNavigation(Stack);
|
|
32
|
+
export default Navigation;
|
|
33
|
+
|
|
34
|
+
<% } else if (props.navigationPackage?.options.type === 'tabs') { %>
|
|
35
|
+
import { createStaticNavigation, StaticParamList } from '@react-navigation/native';
|
|
36
|
+
import { createStackNavigator } from "@react-navigation/stack";
|
|
37
|
+
import Modal from "../screens/modal";
|
|
38
|
+
import TabNavigator from "./tab-navigator";
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
const Stack = createStackNavigator({
|
|
42
|
+
screens: {
|
|
43
|
+
TabNavigator: {
|
|
44
|
+
screen: TabNavigator,
|
|
45
|
+
options: {
|
|
46
|
+
headerShown: false,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
Modal: {
|
|
50
|
+
screen: Modal,
|
|
51
|
+
options: {
|
|
52
|
+
presentation: "modal",
|
|
53
|
+
headerLeft: () => null,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
type RootNavigatorParamList = StaticParamList<typeof Stack>;
|
|
60
|
+
|
|
61
|
+
declare global {
|
|
62
|
+
namespace ReactNavigation {
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
64
|
+
interface RootParamList extends RootNavigatorParamList {}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const Navigation = createStaticNavigation(Stack);
|
|
69
|
+
export default Navigation;
|
|
70
|
+
|
|
71
|
+
<% } else if (props.navigationPackage?.options.type === 'drawer + tabs') { %>
|
|
72
|
+
import { createStaticNavigation, StaticParamList } from '@react-navigation/native';
|
|
73
|
+
import { createStackNavigator } from '@react-navigation/stack';
|
|
74
|
+
import Modal from "../screens/modal";
|
|
75
|
+
import DrawerNavigator from "./drawer-navigator";
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
const Stack = createStackNavigator({
|
|
79
|
+
screens: {
|
|
80
|
+
DrawerNavigator: {
|
|
81
|
+
screen: DrawerNavigator,
|
|
82
|
+
options: {
|
|
83
|
+
headerShown: false,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
Modal: {
|
|
87
|
+
screen: Modal,
|
|
88
|
+
options: {
|
|
89
|
+
presentation: "modal",
|
|
90
|
+
headerLeft: () => null,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
type RootNavigatorParamList = StaticParamList<typeof Stack>;
|
|
97
|
+
|
|
98
|
+
declare global {
|
|
99
|
+
namespace ReactNavigation {
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
101
|
+
interface RootParamList extends RootNavigatorParamList {}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const Navigation = createStaticNavigation(Stack);
|
|
106
|
+
export default Navigation;
|
|
107
|
+
|
|
108
|
+
<% } %>
|