create-expo-stack 2.22.0 → 2.24.0-next.163e6ee
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 +30 -30
- package/build/commands/create-expo-stack.js +17 -6
- package/build/templates/base/App.tsx.ejs +1 -1
- package/build/templates/base/babel.config.js.ejs +1 -8
- package/build/templates/base/components/TabBarIcon.tsx.ejs +2 -2
- package/build/templates/base/package.json.ejs +35 -3
- package/build/templates/packages/expo-router/drawer/app/_layout.tsx.ejs +10 -6
- package/build/templates/packages/expo-router/drawer/app/modal.tsx.ejs +1 -1
- package/build/templates/packages/expo-router/metro.config.js.ejs +3 -3
- package/build/templates/packages/expo-router/stack/app/+not-found.tsx.ejs +13 -7
- package/build/templates/packages/expo-router/stack/app/_layout.tsx.ejs +4 -1
- package/build/templates/packages/expo-router/stack/app/details.tsx.ejs +12 -13
- package/build/templates/packages/expo-router/stack/app/index.tsx.ejs +39 -18
- package/build/templates/packages/expo-router/tabs/app/_layout.tsx.ejs +11 -7
- package/build/templates/packages/expo-router/tabs/app/modal.tsx.ejs +1 -1
- package/build/templates/packages/firebase/metro.config.js.ejs +3 -3
- package/build/templates/packages/i18next/translation/index.ts.ejs +3 -3
- package/build/templates/packages/nativewind/components/BackButton.tsx.ejs +1 -0
- package/build/templates/packages/nativewind/components/Button.tsx.ejs +1 -1
- package/build/templates/packages/nativewind/components/EditScreenInfo.tsx.ejs +1 -0
- package/build/templates/packages/nativewind/components/ScreenContent.tsx.ejs +2 -2
- package/build/templates/packages/nativewind/global.css +5 -3
- package/build/templates/packages/nativewind/metro.config.js +4 -3
- package/build/templates/packages/nativewind/nativewind-env.d.ts +3 -1
- package/build/templates/packages/nativewind/postcss.config.mjs +5 -0
- package/build/templates/packages/nativewind/prettier.config.js +10 -0
- package/build/templates/packages/nativewindui/components/TabBarIcon.tsx.ejs +2 -2
- package/build/templates/packages/nativewindui/drawer/app/(drawer)/index.tsx.ejs +7 -7
- package/build/templates/packages/nativewindui/drawer/app/_layout.tsx.ejs +4 -5
- package/build/templates/packages/nativewindui/drawer/app/modal.tsx.ejs +2 -2
- package/build/templates/packages/nativewindui/lib/useHeaderSearchBar.tsx.ejs +33 -0
- package/build/templates/packages/nativewindui/stack/app/_layout.tsx.ejs +1 -1
- package/build/templates/packages/nativewindui/stack/app/index.tsx.ejs +9 -39
- package/build/templates/packages/nativewindui/tabs/app/(tabs)/index.tsx.ejs +10 -13
- package/build/templates/packages/nativewindui/tabs/app/_layout.tsx.ejs +5 -9
- package/build/templates/packages/nativewindui/tabs/app/modal.tsx.ejs +1 -1
- package/build/templates/packages/nativewindui/theme/index.ts.ejs +1 -1
- package/build/templates/packages/react-navigation/screens/modal.tsx.ejs +1 -1
- package/build/templates/packages/react-navigation/screens/overview.tsx.ejs +1 -1
- package/build/types/types.d.ts +3 -2
- package/build/types/utilities/softwareMansion.d.ts +13 -0
- package/build/types.js +10 -2
- package/build/utilities/configureProjectFiles.js +5 -3
- package/build/utilities/generateNWUI.js +105 -1
- package/build/utilities/runCLI.js +68 -14
- package/build/utilities/showHelp.js +8 -2
- package/build/utilities/softwareMansion.js +48 -0
- package/package.json +74 -74
- package/build/templates/packages/nativewind/tailwind.config.js.ejs +0 -15
|
@@ -1,51 +1,72 @@
|
|
|
1
|
-
import { Stack, Link } from 'expo-router';
|
|
2
1
|
<% if (props.stylingPackage?.name === "stylesheet") { %>
|
|
3
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { Stack, Link } from 'expo-router';
|
|
4
4
|
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
5
5
|
import { StyleSheet } from 'react-native-unistyles';
|
|
6
|
+
import { Stack, Link } from 'expo-router';
|
|
6
7
|
import { View } from 'react-native';
|
|
7
8
|
<% } else { %>
|
|
8
9
|
import { View } from 'react-native';
|
|
10
|
+
import { router } from 'expo-router';
|
|
9
11
|
<% } %>
|
|
10
12
|
|
|
11
13
|
import { Button } from '@/components/Button';
|
|
14
|
+
<% if (props.stylingPackage?.name !== "nativewind") { %>
|
|
12
15
|
import { Container } from '@/components/Container';
|
|
16
|
+
<% } %>
|
|
13
17
|
import { ScreenContent } from '@/components/ScreenContent';
|
|
14
18
|
|
|
15
19
|
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
16
|
-
import { InternalizationExample } from 'components/InternalizationExample';
|
|
20
|
+
import { InternalizationExample } from '../components/InternalizationExample';
|
|
17
21
|
<% } %>
|
|
18
22
|
|
|
19
23
|
export default function Home() {
|
|
20
24
|
return (
|
|
21
25
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
22
26
|
<View className={styles.container}>
|
|
23
|
-
|
|
24
|
-
<View style={styles.container}>
|
|
25
|
-
<% } %>
|
|
26
|
-
<Stack.Screen options={{ title: 'Home' }} />
|
|
27
|
-
<Container>
|
|
27
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
28
28
|
<ScreenContent path="app/index.tsx" title="Home">
|
|
29
|
-
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
30
29
|
<InternalizationExample />
|
|
31
|
-
<% } %>
|
|
32
30
|
</ScreenContent>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
<% } else { %>
|
|
32
|
+
<ScreenContent path="app/index.tsx" title="Home" />
|
|
33
|
+
<% } %>
|
|
34
|
+
<View className={styles.buttonWrapper}>
|
|
35
|
+
<Button
|
|
36
|
+
title="Show Details"
|
|
37
|
+
onPress={() => router.push({ pathname: '/details', params: { name: 'Dan' } })}
|
|
38
|
+
/>
|
|
39
|
+
</View>
|
|
40
|
+
</View>
|
|
41
|
+
<% } else { %>
|
|
42
|
+
<View style={styles.container}>
|
|
43
|
+
<Stack.Screen options={{ title: 'Home' }} />
|
|
44
|
+
<Container>
|
|
45
|
+
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
46
|
+
<ScreenContent path="app/index.tsx" title="Home">
|
|
47
|
+
<InternalizationExample />
|
|
48
|
+
</ScreenContent>
|
|
36
49
|
<% } else { %>
|
|
37
|
-
|
|
50
|
+
<ScreenContent path="app/index.tsx" title="Home" />
|
|
38
51
|
<% } %>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
<Link href={{ pathname: '/details', params: { name: 'Dan' } }} asChild>
|
|
53
|
+
<% if (props.stylingPackage?.name === "unistyles") { %>
|
|
54
|
+
<Button title="Show Details" style={styles.button} />
|
|
55
|
+
<% } else { %>
|
|
56
|
+
<Button title="Show Details" />
|
|
57
|
+
<% } %>
|
|
58
|
+
</Link>
|
|
59
|
+
</Container>
|
|
60
|
+
</View>
|
|
61
|
+
<% } %>
|
|
42
62
|
);
|
|
43
63
|
}
|
|
44
64
|
|
|
45
65
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
46
66
|
const styles = {
|
|
47
|
-
container: "flex flex-1 bg-white",
|
|
48
|
-
|
|
67
|
+
container: "flex flex-1 p-safe bg-white",
|
|
68
|
+
buttonWrapper: "w-full pb-safe",
|
|
69
|
+
};
|
|
49
70
|
<% } else if (props.stylingPackage?.name === "stylesheet") { %>
|
|
50
71
|
const styles = StyleSheet.create({
|
|
51
72
|
container: {
|
|
@@ -32,9 +32,13 @@ export default function RootLayout() {
|
|
|
32
32
|
|
|
33
33
|
return (
|
|
34
34
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
<SafeAreaProvider>
|
|
36
|
+
<Stack>
|
|
37
|
+
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
38
|
+
<Stack.Screen name="modal" options={{ presentation: "modal" }} />
|
|
39
|
+
</Stack>
|
|
40
|
+
</SafeAreaProvider>
|
|
41
|
+
<% } else if (props.stylingPackage?.name === "unistyles") { %>
|
|
38
42
|
<Stack
|
|
39
43
|
screenOptions={{
|
|
40
44
|
headerStyle: {
|
|
@@ -46,14 +50,14 @@ export default function RootLayout() {
|
|
|
46
50
|
headerTintColor: theme.colors.typography
|
|
47
51
|
}}
|
|
48
52
|
>
|
|
49
|
-
|
|
53
|
+
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
54
|
+
<Stack.Screen name="modal" options={{ presentation: "modal" }} />
|
|
55
|
+
</Stack>
|
|
56
|
+
<% } else { %>
|
|
50
57
|
<Stack>
|
|
51
|
-
<% } %>
|
|
52
58
|
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
53
59
|
<Stack.Screen name="modal" options={{ presentation: "modal" }} />
|
|
54
60
|
</Stack>
|
|
55
|
-
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
56
|
-
</SafeAreaProvider>
|
|
57
61
|
<% } %>
|
|
58
62
|
);
|
|
59
63
|
}
|
|
@@ -4,7 +4,7 @@ import { Platform } from 'react-native';
|
|
|
4
4
|
import { ScreenContent } from '@/components/ScreenContent';
|
|
5
5
|
|
|
6
6
|
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
7
|
-
import { InternalizationExample } from 'components/InternalizationExample';
|
|
7
|
+
import { InternalizationExample } from '../components/InternalizationExample';
|
|
8
8
|
<% } %>
|
|
9
9
|
|
|
10
10
|
export default function Modal() {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
// Learn more https://docs.expo.io/guides/customizing-metro
|
|
1
2
|
const { getDefaultConfig } = require('expo/metro-config');
|
|
2
3
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
3
|
-
const {
|
|
4
|
+
const { withNativewind } = require("nativewind/metro");
|
|
4
5
|
<% } %>
|
|
5
6
|
|
|
6
7
|
/** @type {import('expo/metro-config').MetroConfig} */
|
|
7
|
-
// eslint-disable-next-line no-undef
|
|
8
8
|
const config = getDefaultConfig(__dirname);
|
|
9
9
|
|
|
10
10
|
<% if (props.stylingPackage?.name === "nativewind") { %>
|
|
11
|
-
module.exports =
|
|
11
|
+
module.exports = withNativewind(config);
|
|
12
12
|
<% } else { %>
|
|
13
13
|
module.exports = config;
|
|
14
14
|
<% } %>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { init18n } from 'core/i18n/init';
|
|
2
|
-
import en from '
|
|
3
|
-
import fr from '
|
|
1
|
+
import { init18n } from '../core/i18n/init';
|
|
2
|
+
import en from './en.json';
|
|
3
|
+
import fr from './fr.json';
|
|
4
4
|
|
|
5
5
|
export const resources = {
|
|
6
6
|
en: {
|
|
@@ -16,6 +16,6 @@ export const Button = forwardRef<View, ButtonProps>(({ title, ...touchableProps
|
|
|
16
16
|
Button.displayName = 'Button';
|
|
17
17
|
|
|
18
18
|
const styles = {
|
|
19
|
-
button: 'items-center bg-indigo-500 rounded-[28px] shadow-md p-4',
|
|
19
|
+
button: 'items-center bg-indigo-500 rounded-[28px] shadow-md p-4 w-full',
|
|
20
20
|
buttonText: 'text-white text-lg font-semibold text-center',
|
|
21
21
|
};
|
|
@@ -21,7 +21,7 @@ export const ScreenContent: React.FC<ScreenContentProps> = ({ title, path, child
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const styles = {
|
|
24
|
-
container: `
|
|
25
|
-
separator: `h-
|
|
24
|
+
container: `flex flex-1 px-4 bg-white items-center justify-center`,
|
|
25
|
+
separator: `h-px w-[300px] bg-gray-200 my-7`,
|
|
26
26
|
title: `text-xl font-bold`,
|
|
27
27
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
// Learn more https://docs.expo.io/guides/customizing-metro
|
|
1
2
|
const { getDefaultConfig } = require('expo/metro-config');
|
|
2
|
-
const {
|
|
3
|
+
const { withNativewind } = require('nativewind/metro');
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
/** @type {import('expo/metro-config').MetroConfig} */
|
|
5
6
|
const config = getDefaultConfig(__dirname);
|
|
6
7
|
|
|
7
|
-
module.exports =
|
|
8
|
+
module.exports = withNativewind(config);
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
|
-
/// <reference types="
|
|
2
|
+
/// <reference types="react-native-css/types" />
|
|
3
|
+
|
|
4
|
+
// NOTE: This file should not be edited and should be committed with your source code. It is generated by react-native-css. If you need to move or disable this file, please see the documentation.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import FontAwesome from '@expo/vector-icons/FontAwesome';
|
|
2
|
-
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { ColorValue, StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
4
|
export const TabBarIcon = (props: {
|
|
5
5
|
name: React.ComponentProps<typeof FontAwesome>['name'];
|
|
6
|
-
color:
|
|
6
|
+
color: ColorValue;
|
|
7
7
|
}) => {
|
|
8
8
|
return <FontAwesome size={28} style={styles.tabBarIcon} {...props} />;
|
|
9
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stack } from 'expo-router';
|
|
2
|
-
import { useHeaderHeight } from '
|
|
2
|
+
import { useHeaderHeight } from 'expo-router/react-navigation';
|
|
3
3
|
import { FlashList } from '@shopify/flash-list';
|
|
4
4
|
import { cssInterop } from 'nativewind';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -27,12 +27,12 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
27
27
|
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
28
28
|
import { useActionSheet } from '@expo/react-native-action-sheet';
|
|
29
29
|
<% } %>
|
|
30
|
-
import { Icon } from '@roninoss/icons';
|
|
31
30
|
<% if (props.stylingPackage?.options.selectedComponents.includes('ratings-indicator')) { %>
|
|
32
31
|
import * as StoreReview from 'expo-store-review';
|
|
33
32
|
<% } %>
|
|
34
33
|
|
|
35
34
|
import { Container } from '@/components/Container';
|
|
35
|
+
import { Icon } from '@/components/nativewindui/Icon';
|
|
36
36
|
<% if (props.stylingPackage?.options.selectedComponents.includes('activity-indicator')) { %>
|
|
37
37
|
import { ActivityIndicator } from '@/components/nativewindui/ActivityIndicator';
|
|
38
38
|
<% } %>
|
|
@@ -59,6 +59,7 @@ import { Text } from '@/components/nativewindui/Text';
|
|
|
59
59
|
import { Toggle } from '@/components/nativewindui/Toggle';
|
|
60
60
|
<% } %>
|
|
61
61
|
import { useColorScheme } from '@/lib/useColorScheme';
|
|
62
|
+
import { useHeaderSearchBar } from '@/lib/useHeaderSearchBar';
|
|
62
63
|
|
|
63
64
|
export default function Home() {
|
|
64
65
|
const searchValue = useHeaderSearchBar({ hideWhenScrolling: COMPONENTS.length === 0 });
|
|
@@ -75,7 +76,6 @@ export default function Home() {
|
|
|
75
76
|
contentInsetAdjustmentBehavior="automatic"
|
|
76
77
|
keyboardShouldPersistTaps="handled"
|
|
77
78
|
data={data}
|
|
78
|
-
estimatedItemSize={200}
|
|
79
79
|
contentContainerClassName="py-4 android:pb-12"
|
|
80
80
|
extraData={searchValue}
|
|
81
81
|
keyExtractor={keyExtractor}
|
|
@@ -112,7 +112,7 @@ function ListEmptyComponent() {
|
|
|
112
112
|
|
|
113
113
|
return (
|
|
114
114
|
<View style={{ height }} className="flex-1 items-center justify-center gap-1 px-12">
|
|
115
|
-
<Icon name="
|
|
115
|
+
<Icon name="doc.badge.plus" size={42} color={colors.grey} />
|
|
116
116
|
<Text variant='title3' className='pb-1 text-center font-semibold'>
|
|
117
117
|
No Components Installed
|
|
118
118
|
</Text>
|
|
@@ -226,8 +226,8 @@ const COMPONENTS: ComponentItem[] = [
|
|
|
226
226
|
<DatePicker
|
|
227
227
|
value={date}
|
|
228
228
|
mode='datetime'
|
|
229
|
-
|
|
230
|
-
setDate(
|
|
229
|
+
onValueChange={(_event, selectedDate) => {
|
|
230
|
+
setDate(selectedDate);
|
|
231
231
|
}}
|
|
232
232
|
/>
|
|
233
233
|
</View>
|
|
@@ -532,4 +532,4 @@ const COMPONENTS: ComponentItem[] = [
|
|
|
532
532
|
},
|
|
533
533
|
},
|
|
534
534
|
<% } %>
|
|
535
|
-
];
|
|
535
|
+
];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../global.css';
|
|
2
2
|
import 'expo-dev-client';
|
|
3
|
-
import { ThemeProvider as NavThemeProvider } from '
|
|
3
|
+
import { ThemeProvider as NavThemeProvider } from 'expo-router/react-navigation';
|
|
4
4
|
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
5
5
|
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
|
|
6
6
|
<% } %>
|
|
@@ -13,8 +13,8 @@ import { StatusBar } from 'expo-status-bar';
|
|
|
13
13
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
14
14
|
<% } %>
|
|
15
15
|
|
|
16
|
-
import { ThemeToggle } from '@/components/ThemeToggle';
|
|
17
|
-
import { useColorScheme
|
|
16
|
+
import { ThemeToggle } from '@/components/nativewindui/ThemeToggle';
|
|
17
|
+
import { useColorScheme } from '@/lib/useColorScheme';
|
|
18
18
|
import { NAV_THEME } from '@/theme';
|
|
19
19
|
|
|
20
20
|
export {
|
|
@@ -23,7 +23,6 @@ export {
|
|
|
23
23
|
} from 'expo-router';
|
|
24
24
|
|
|
25
25
|
export default function RootLayout() {
|
|
26
|
-
useInitialAndroidBarSync();
|
|
27
26
|
const { colorScheme, isDarkColorScheme } = useColorScheme();
|
|
28
27
|
|
|
29
28
|
return (
|
|
@@ -72,4 +71,4 @@ const MODAL_OPTIONS = {
|
|
|
72
71
|
animation: 'fade_from_bottom', // for android
|
|
73
72
|
title: 'Settings',
|
|
74
73
|
headerRight: () => <ThemeToggle />,
|
|
75
|
-
} as const;
|
|
74
|
+
} as const;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Icon } from '@roninoss/icons';
|
|
2
1
|
import { StatusBar } from 'expo-status-bar';
|
|
3
2
|
import { Linking, Platform, View } from 'react-native';
|
|
4
3
|
|
|
4
|
+
import { Icon } from '@/components/nativewindui/Icon';
|
|
5
5
|
import { Text } from '@/components/nativewindui/Text';
|
|
6
6
|
import { useColorScheme } from '@/lib/useColorScheme';
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ export default function ModalScreen() {
|
|
|
13
13
|
style={Platform.OS === 'ios' ? 'light' : colorScheme === 'dark' ? 'light' : 'dark'}
|
|
14
14
|
/>
|
|
15
15
|
<View className="flex-1 items-center justify-center gap-1 px-12">
|
|
16
|
-
<Icon name="
|
|
16
|
+
<Icon name="doc.badge.plus" size={42} color={colors.grey} />
|
|
17
17
|
<Text variant="title3" className="pb-1 text-center font-semibold">
|
|
18
18
|
NativewindUI
|
|
19
19
|
</Text>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useNavigation } from 'expo-router/react-navigation';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { SearchBarProps } from 'react-native-screens';
|
|
4
|
+
|
|
5
|
+
import { useColorScheme } from './useColorScheme';
|
|
6
|
+
|
|
7
|
+
function useHeaderSearchBar(props: SearchBarProps = {}) {
|
|
8
|
+
const { colorScheme, colors } = useColorScheme();
|
|
9
|
+
const navigation = useNavigation();
|
|
10
|
+
const [search, setSearch] = React.useState('');
|
|
11
|
+
|
|
12
|
+
React.useLayoutEffect(() => {
|
|
13
|
+
navigation.setOptions({
|
|
14
|
+
headerSearchBarOptions: {
|
|
15
|
+
placeholder: 'Search...',
|
|
16
|
+
textColor: colors.foreground,
|
|
17
|
+
tintColor: colors.primary,
|
|
18
|
+
headerIconColor: colors.foreground,
|
|
19
|
+
hintTextColor: colors.grey,
|
|
20
|
+
hideWhenScrolling: false,
|
|
21
|
+
onChangeText(event) {
|
|
22
|
+
setSearch(event.nativeEvent.text);
|
|
23
|
+
},
|
|
24
|
+
...props,
|
|
25
|
+
} satisfies SearchBarProps,
|
|
26
|
+
});
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
}, [navigation, colorScheme]);
|
|
29
|
+
|
|
30
|
+
return search;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { useHeaderSearchBar };
|
|
@@ -3,7 +3,7 @@ import '@/global.css';
|
|
|
3
3
|
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
4
4
|
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
|
|
5
5
|
<% } %>
|
|
6
|
-
import { ThemeProvider as NavThemeProvider } from '
|
|
6
|
+
import { ThemeProvider as NavThemeProvider } from 'expo-router/react-navigation';
|
|
7
7
|
import * as Device from 'expo-device';
|
|
8
8
|
import { Link, Stack } from 'expo-router';
|
|
9
9
|
import { StatusBar } from 'expo-status-bar';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useHeaderHeight } from '
|
|
1
|
+
import { useHeaderHeight } from 'expo-router/react-navigation';
|
|
2
2
|
import { FlashList } from '@shopify/flash-list';
|
|
3
3
|
import { cssInterop } from 'nativewind';
|
|
4
4
|
import * as React from 'react';
|
|
@@ -21,11 +21,9 @@ import {
|
|
|
21
21
|
View,
|
|
22
22
|
} from 'react-native';
|
|
23
23
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
24
|
-
import { SearchBarProps } from 'react-native-screens';
|
|
25
24
|
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
26
25
|
import { useActionSheet } from '@expo/react-native-action-sheet';
|
|
27
26
|
<% } %>
|
|
28
|
-
import { useNavigation } from '@react-navigation/native';
|
|
29
27
|
<% if (props.stylingPackage?.options.selectedComponents.includes('button')) { %>
|
|
30
28
|
import * as Haptics from 'expo-haptics';
|
|
31
29
|
<% } else { %>
|
|
@@ -64,6 +62,7 @@ import { Text } from '@/components/nativewindui/Text';
|
|
|
64
62
|
<% if (props.stylingPackage?.options.selectedComponents.includes('toggle')) { %>
|
|
65
63
|
import { Toggle } from '@/components/nativewindui/Toggle';
|
|
66
64
|
<% } %>
|
|
65
|
+
import { useHeaderSearchBar } from '@/lib/useHeaderSearchBar';
|
|
67
66
|
import { useColorScheme } from '@/lib/useColorScheme';
|
|
68
67
|
import { COLORS } from '@/theme/colors';
|
|
69
68
|
|
|
@@ -95,32 +94,6 @@ export default function Screen() {
|
|
|
95
94
|
);
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
function useHeaderSearchBar(props: SearchBarProps = {}) {
|
|
99
|
-
const { colorScheme, colors } = useColorScheme();
|
|
100
|
-
const navigation = useNavigation();
|
|
101
|
-
const [search, setSearch] = React.useState('');
|
|
102
|
-
|
|
103
|
-
React.useLayoutEffect(() => {
|
|
104
|
-
navigation.setOptions({
|
|
105
|
-
headerSearchBarOptions: {
|
|
106
|
-
placeholder: 'Search...',
|
|
107
|
-
textColor: colors.foreground,
|
|
108
|
-
tintColor: colors.primary,
|
|
109
|
-
headerIconColor: colors.foreground,
|
|
110
|
-
hintTextColor: colors.grey,
|
|
111
|
-
hideWhenScrolling: false,
|
|
112
|
-
onChangeText(ev) {
|
|
113
|
-
setSearch(ev.nativeEvent.text);
|
|
114
|
-
},
|
|
115
|
-
...props,
|
|
116
|
-
} satisfies SearchBarProps,
|
|
117
|
-
});
|
|
118
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
119
|
-
}, [navigation, colorScheme]);
|
|
120
|
-
|
|
121
|
-
return search;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
97
|
function ListEmptyComponent() {
|
|
125
98
|
const insets = useSafeAreaInsets();
|
|
126
99
|
const dimensions = useWindowDimensions();
|
|
@@ -315,16 +288,13 @@ const COMPONENTS: ComponentItem[] = [
|
|
|
315
288
|
name: 'Progress Indicator',
|
|
316
289
|
component: function ProgressIndicatorExample() {
|
|
317
290
|
const [progress, setProgress] = React.useState(13);
|
|
291
|
+
React.useEffect(() => {
|
|
292
|
+
const intervalId = setInterval(() => {
|
|
293
|
+
setProgress((prev) => (prev >= 99 ? 0 : prev + 5));
|
|
294
|
+
}, 1000);
|
|
318
295
|
|
|
319
|
-
React.useEffect(() => {
|
|
320
|
-
let id: ReturnType<typeof setInterval> | null = null;
|
|
321
|
-
if (!id) {
|
|
322
|
-
id = setInterval(() => {
|
|
323
|
-
setProgress((prev) => (prev >= 99 ? 0 : prev + 5));
|
|
324
|
-
}, 1000);
|
|
325
|
-
}
|
|
326
296
|
return () => {
|
|
327
|
-
|
|
297
|
+
clearInterval(intervalId);
|
|
328
298
|
};
|
|
329
299
|
}, []);
|
|
330
300
|
return (
|
|
@@ -378,8 +348,8 @@ const COMPONENTS: ComponentItem[] = [
|
|
|
378
348
|
<DatePicker
|
|
379
349
|
value={date}
|
|
380
350
|
mode='datetime'
|
|
381
|
-
|
|
382
|
-
setDate(
|
|
351
|
+
onValueChange={(_event, selectedDate) => {
|
|
352
|
+
setDate(selectedDate);
|
|
383
353
|
}}
|
|
384
354
|
/>
|
|
385
355
|
</View>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Stack } from 'expo-router';
|
|
2
|
-
import { useHeaderHeight } from '
|
|
2
|
+
import { useHeaderHeight } from 'expo-router/react-navigation';
|
|
3
3
|
import { FlashList } from '@shopify/flash-list';
|
|
4
4
|
import { cssInterop } from 'nativewind';
|
|
5
5
|
import * as React from 'react';
|
|
@@ -27,12 +27,12 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
27
27
|
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
28
28
|
import { useActionSheet } from '@expo/react-native-action-sheet';
|
|
29
29
|
<% } %>
|
|
30
|
-
import { Icon } from '@roninoss/icons';
|
|
31
30
|
<% if (props.stylingPackage?.options.selectedComponents.includes('ratings-indicator')) { %>
|
|
32
31
|
import * as StoreReview from 'expo-store-review';
|
|
33
32
|
<% } %>
|
|
34
33
|
|
|
35
34
|
import { Container } from '@/components/Container';
|
|
35
|
+
import { Icon } from '@/components/nativewindui/Icon';
|
|
36
36
|
<% if (props.stylingPackage?.options.selectedComponents.includes('activity-indicator')) { %>
|
|
37
37
|
import { ActivityIndicator } from '@/components/nativewindui/ActivityIndicator';
|
|
38
38
|
<% } %>
|
|
@@ -76,7 +76,6 @@ export default function Home() {
|
|
|
76
76
|
contentInsetAdjustmentBehavior="automatic"
|
|
77
77
|
keyboardShouldPersistTaps="handled"
|
|
78
78
|
data={data}
|
|
79
|
-
estimatedItemSize={200}
|
|
80
79
|
contentContainerClassName="py-4 android:pb-12"
|
|
81
80
|
extraData={searchValue}
|
|
82
81
|
keyExtractor={keyExtractor}
|
|
@@ -113,7 +112,7 @@ function ListEmptyComponent() {
|
|
|
113
112
|
|
|
114
113
|
return (
|
|
115
114
|
<View style={{ height }} className="flex-1 items-center justify-center gap-1 px-12">
|
|
116
|
-
<Icon name="
|
|
115
|
+
<Icon name="doc.badge.plus" size={42} color={colors.grey} />
|
|
117
116
|
<Text variant='title3' className='pb-1 text-center font-semibold'>
|
|
118
117
|
No Components Installed
|
|
119
118
|
</Text>
|
|
@@ -227,8 +226,8 @@ const COMPONENTS: ComponentItem[] = [
|
|
|
227
226
|
<DatePicker
|
|
228
227
|
value={date}
|
|
229
228
|
mode='datetime'
|
|
230
|
-
|
|
231
|
-
setDate(
|
|
229
|
+
onValueChange={(_event, selectedDate) => {
|
|
230
|
+
setDate(selectedDate);
|
|
232
231
|
}}
|
|
233
232
|
/>
|
|
234
233
|
</View>
|
|
@@ -263,15 +262,13 @@ const COMPONENTS: ComponentItem[] = [
|
|
|
263
262
|
name: 'Progress Indicator',
|
|
264
263
|
component: function ProgressIndicatorExample() {
|
|
265
264
|
const [progress, setProgress] = React.useState(13);
|
|
266
|
-
let id: ReturnType<typeof setInterval> | null = null;
|
|
267
265
|
React.useEffect(() => {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
266
|
+
const intervalId = setInterval(() => {
|
|
267
|
+
setProgress((prev) => (prev >= 99 ? 0 : prev + 5));
|
|
268
|
+
}, 1000);
|
|
269
|
+
|
|
273
270
|
return () => {
|
|
274
|
-
|
|
271
|
+
clearInterval(intervalId);
|
|
275
272
|
};
|
|
276
273
|
}, []);
|
|
277
274
|
return (
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import '../global.css';
|
|
2
2
|
import 'expo-dev-client';
|
|
3
|
-
import { ThemeProvider as NavThemeProvider } from '
|
|
4
|
-
import { Icon } from '@roninoss/icons';
|
|
3
|
+
import { ThemeProvider as NavThemeProvider } from 'expo-router/react-navigation';
|
|
5
4
|
<% if (props.stylingPackage?.options.selectedComponents.includes('action-sheet')) { %>
|
|
6
5
|
import { ActionSheetProvider } from '@expo/react-native-action-sheet';
|
|
7
6
|
<% } %>
|
|
8
7
|
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
9
8
|
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
10
9
|
<% } %>
|
|
11
|
-
import {
|
|
10
|
+
import { Stack } from 'expo-router';
|
|
12
11
|
import { StatusBar } from 'expo-status-bar';
|
|
13
|
-
import { Pressable, View } from 'react-native';
|
|
14
12
|
<% if (props.stylingPackage?.options.selectedComponents.includes('bottom-sheet')) { %>
|
|
15
13
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
16
14
|
<% } %>
|
|
17
15
|
|
|
18
|
-
import { ThemeToggle } from '@/components/ThemeToggle';
|
|
19
|
-
import {
|
|
20
|
-
import { useColorScheme, useInitialAndroidBarSync } from '@/lib/useColorScheme';
|
|
16
|
+
import { ThemeToggle } from '@/components/nativewindui/ThemeToggle';
|
|
17
|
+
import { useColorScheme } from '@/lib/useColorScheme';
|
|
21
18
|
import { NAV_THEME } from '@/theme';
|
|
22
19
|
|
|
23
20
|
export {
|
|
@@ -26,7 +23,6 @@ export {
|
|
|
26
23
|
} from 'expo-router';
|
|
27
24
|
|
|
28
25
|
export default function RootLayout() {
|
|
29
|
-
useInitialAndroidBarSync();
|
|
30
26
|
const { colorScheme, isDarkColorScheme } = useColorScheme();
|
|
31
27
|
|
|
32
28
|
return (
|
|
@@ -75,4 +71,4 @@ const MODAL_OPTIONS = {
|
|
|
75
71
|
animation: 'fade_from_bottom', // for android
|
|
76
72
|
title: 'Settings',
|
|
77
73
|
headerRight: () => <ThemeToggle />,
|
|
78
|
-
} as const;
|
|
74
|
+
} as const;
|
|
@@ -4,7 +4,7 @@ import { Platform } from 'react-native';
|
|
|
4
4
|
import { ScreenContent } from '@/components/ScreenContent';
|
|
5
5
|
|
|
6
6
|
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
7
|
-
import { InternalizationExample } from 'components/InternalizationExample';
|
|
7
|
+
import { InternalizationExample } from '../components/InternalizationExample';
|
|
8
8
|
<% } %>
|
|
9
9
|
|
|
10
10
|
export default function Modal() {
|
|
@@ -3,7 +3,7 @@ import { StatusBar } from 'expo-status-bar';
|
|
|
3
3
|
import { Platform } from 'react-native';
|
|
4
4
|
|
|
5
5
|
<% if (props.internalizationPackage?.name === "i18next") { %>
|
|
6
|
-
import { InternalizationExample } from 'components/InternalizationExample';
|
|
6
|
+
import { InternalizationExample } from '../components/InternalizationExample';
|
|
7
7
|
<% } %>
|
|
8
8
|
|
|
9
9
|
export default function Modal() {
|