create-expo-stack 2.7.0-next.997d3bf → 2.7.0-next.a59a8d8
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 +9 -9
- package/build/templates/base/package.json.ejs +0 -2
- package/build/templates/packages/nativewindui/app/index.tsx.ejs +29 -23
- package/build/templates/packages/nativewindui/lib/useHeaderSearchBar.tsx.ejs +1 -1
- package/package.json +1 -1
- package/build/templates/packages/nativewindui/app/bottom-tabs/_layout.tsx.ejs +0 -34
- package/build/templates/packages/nativewindui/app/bottom-tabs/index.tsx.ejs +0 -11
- package/build/templates/packages/nativewindui/app/bottom-tabs/profile.tsx.ejs +0 -11
- package/build/templates/packages/nativewindui/app/drawer/_layout.tsx.ejs +0 -29
- package/build/templates/packages/nativewindui/app/drawer/index.tsx.ejs +0 -11
- package/build/templates/packages/nativewindui/app/top-tabs/_layout.tsx.ejs +0 -71
- package/build/templates/packages/nativewindui/app/top-tabs/following.tsx.ejs +0 -13
- package/build/templates/packages/nativewindui/app/top-tabs/index.tsx.ejs +0 -13
- package/build/templates/packages/nativewindui/app/top-tabs/my-group.tsx.ejs +0 -13
package/README.md
CHANGED
|
@@ -157,6 +157,13 @@ Thanks go to these wonderful people:
|
|
|
157
157
|
<sub><b>Finn Bayer</b></sub>
|
|
158
158
|
</a>
|
|
159
159
|
</td>
|
|
160
|
+
<td align="center">
|
|
161
|
+
<a href="https://github.com/mrzachnugent">
|
|
162
|
+
<img src="https://avatars.githubusercontent.com/u/63797719?v=4" width="100;" alt="mrzachnugent"/>
|
|
163
|
+
<br />
|
|
164
|
+
<sub><b>Zach Nugent</b></sub>
|
|
165
|
+
</a>
|
|
166
|
+
</td>
|
|
160
167
|
<td align="center">
|
|
161
168
|
<a href="https://github.com/saimon24">
|
|
162
169
|
<img src="https://avatars.githubusercontent.com/u/2514208?v=4" width="100;" alt="saimon24"/>
|
|
@@ -170,21 +177,14 @@ Thanks go to these wonderful people:
|
|
|
170
177
|
<br />
|
|
171
178
|
<sub><b>Daniel Williams</b></sub>
|
|
172
179
|
</a>
|
|
173
|
-
</td>
|
|
180
|
+
</td></tr>
|
|
181
|
+
<tr>
|
|
174
182
|
<td align="center">
|
|
175
183
|
<a href="https://github.com/todevmilen">
|
|
176
184
|
<img src="https://avatars.githubusercontent.com/u/78319110?v=4" width="100;" alt="todevmilen"/>
|
|
177
185
|
<br />
|
|
178
186
|
<sub><b>Milen Todev</b></sub>
|
|
179
187
|
</a>
|
|
180
|
-
</td></tr>
|
|
181
|
-
<tr>
|
|
182
|
-
<td align="center">
|
|
183
|
-
<a href="https://github.com/mrzachnugent">
|
|
184
|
-
<img src="https://avatars.githubusercontent.com/u/63797719?v=4" width="100;" alt="mrzachnugent"/>
|
|
185
|
-
<br />
|
|
186
|
-
<sub><b>Zach Nugent</b></sub>
|
|
187
|
-
</a>
|
|
188
188
|
</td>
|
|
189
189
|
<td align="center">
|
|
190
190
|
<a href="https://github.com/alitnk">
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"nativewind": "^4.0.1",
|
|
21
21
|
<% } %>
|
|
22
22
|
<% if (props.stylingPackage?.name === "nativewindui") { %>
|
|
23
|
-
"@react-navigation/material-top-tabs": "^6.6.13",
|
|
24
23
|
"@roninoss/icons": "^0.0.3",
|
|
25
24
|
"@shopify/flash-list": "1.6.3",
|
|
26
25
|
"class-variance-authority": "^0.7.0",
|
|
@@ -29,7 +28,6 @@
|
|
|
29
28
|
"tailwind-merge": "^2.2.1",
|
|
30
29
|
"react-native-uitextview": "^1.1.4",
|
|
31
30
|
"react-native-pager-view": "6.2.3",
|
|
32
|
-
"react-native-tab-view": "^3.5.2",
|
|
33
31
|
<% } %>
|
|
34
32
|
|
|
35
33
|
<% if (props.stylingPackage?.name === "restyle") { %>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { useHeaderHeight } from '@react-navigation/elements';
|
|
1
2
|
import { FlashList } from '@shopify/flash-list';
|
|
2
3
|
import { cssInterop } from 'nativewind';
|
|
3
4
|
import * as React from 'react';
|
|
4
|
-
import { Button as RNButton, ButtonProps, Linking, View } from 'react-native';
|
|
5
|
+
import { Button as RNButton, ButtonProps, Linking, View, Platform } from 'react-native';
|
|
5
6
|
|
|
6
7
|
import { Text } from '~/components/nativewind-ui/Text';
|
|
7
8
|
import { useColorScheme } from '~/lib/useColorScheme';
|
|
@@ -24,26 +25,6 @@ export default function Screen() {
|
|
|
24
25
|
? COMPONENTS.filter((c) => c.name.toLowerCase().includes(searchValue.toLowerCase()))
|
|
25
26
|
: COMPONENTS;
|
|
26
27
|
|
|
27
|
-
if (data.length === 0) {
|
|
28
|
-
return (
|
|
29
|
-
<View className='flex-1 justify-center items-center px-4'>
|
|
30
|
-
<Text variant='title3' className='text-center font-bold pb-1'>
|
|
31
|
-
{searchValue.length === 0
|
|
32
|
-
? 'No Components Installed'
|
|
33
|
-
: 'No Components Found'}
|
|
34
|
-
</Text>
|
|
35
|
-
<Text color='tertiary' variant='body' className='text-center pb-4'>
|
|
36
|
-
You can install any of the free components from the NativeWindUI
|
|
37
|
-
website.
|
|
38
|
-
</Text>
|
|
39
|
-
<DefaultButton
|
|
40
|
-
title='Open NativeWindUI'
|
|
41
|
-
onPress={() => Linking.openURL('https://nativewindui.com')}
|
|
42
|
-
/>
|
|
43
|
-
</View>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
28
|
return (
|
|
48
29
|
<FlashList
|
|
49
30
|
contentInsetAdjustmentBehavior="automatic"
|
|
@@ -51,15 +32,40 @@ export default function Screen() {
|
|
|
51
32
|
data={data}
|
|
52
33
|
estimatedItemSize={200}
|
|
53
34
|
contentContainerClassName="py-4"
|
|
35
|
+
centerContent={data.length === 0}
|
|
54
36
|
extraData={searchValue}
|
|
55
37
|
removeClippedSubviews={false} // used for selecting text on android
|
|
56
38
|
keyExtractor={keyExtractor}
|
|
57
39
|
ItemSeparatorComponent={renderItemSeparator}
|
|
58
40
|
renderItem={renderItem}
|
|
41
|
+
ListEmptyComponent={ListEmptyComponent}
|
|
59
42
|
/>
|
|
60
43
|
);
|
|
61
44
|
}
|
|
62
45
|
|
|
46
|
+
const SEARCH_BAR_HEIGHT = 52;
|
|
47
|
+
|
|
48
|
+
function ListEmptyComponent() {
|
|
49
|
+
const headerHeight = useHeaderHeight();
|
|
50
|
+
return (
|
|
51
|
+
<>
|
|
52
|
+
{Platform.OS === 'ios' && <View style={{ height: headerHeight + SEARCH_BAR_HEIGHT }} />}
|
|
53
|
+
<View className="flex-1 items-center justify-center px-8">
|
|
54
|
+
<Text variant="title3" className="pb-1 text-center font-bold">
|
|
55
|
+
No Components Installed
|
|
56
|
+
</Text>
|
|
57
|
+
<Text color="tertiary" variant="body" className="pb-4 text-center">
|
|
58
|
+
You can install any of the free components from the NativeWindUI website.
|
|
59
|
+
</Text>
|
|
60
|
+
<DefaultButton
|
|
61
|
+
title="Open NativeWindUI"
|
|
62
|
+
onPress={() => Linking.openURL('https://nativewindui.com')}
|
|
63
|
+
/>
|
|
64
|
+
</View>
|
|
65
|
+
</>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
63
69
|
type ComponentItem = { name: string; component: () => React.JSX.Element };
|
|
64
70
|
|
|
65
71
|
function keyExtractor(item: ComponentItem) {
|
|
@@ -67,7 +73,7 @@ function keyExtractor(item: ComponentItem) {
|
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
function renderItemSeparator() {
|
|
70
|
-
return <View className=
|
|
76
|
+
return <View className="p-2" />;
|
|
71
77
|
}
|
|
72
78
|
|
|
73
79
|
function renderItem({ item }: { item: ComponentItem }) {
|
|
@@ -81,7 +87,7 @@ function renderItem({ item }: { item: ComponentItem }) {
|
|
|
81
87
|
function Card({ children, title }: { children: React.ReactNode; title: string }) {
|
|
82
88
|
return (
|
|
83
89
|
<View className="px-4">
|
|
84
|
-
<View className="
|
|
90
|
+
<View className="gap-4 rounded-xl border border-border bg-card p-4 pb-6 shadow-sm shadow-black/10 dark:shadow-none">
|
|
85
91
|
<Text className="text-center text-sm font-medium tracking-wider opacity-60">{title}</Text>
|
|
86
92
|
{children}
|
|
87
93
|
</View>
|
|
@@ -18,7 +18,7 @@ export function useHeaderSearchBar(props: SearchBarProps = {}) {
|
|
|
18
18
|
tintColor: colors.primary,
|
|
19
19
|
headerIconColor: colors.foreground,
|
|
20
20
|
hintTextColor: colors.grey,
|
|
21
|
-
hideWhenScrolling:
|
|
21
|
+
hideWhenScrolling: true,
|
|
22
22
|
onChangeText(ev) {
|
|
23
23
|
setSearch(ev.nativeEvent.text);
|
|
24
24
|
},
|
package/package.json
CHANGED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ThemeToggle } from '~/components/ThemeToggle';
|
|
2
|
-
import { Icon } from '@roninoss/icons';
|
|
3
|
-
import { Tabs } from 'expo-router';
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
export default function TabsLayout() {
|
|
7
|
-
return (
|
|
8
|
-
<Tabs screenOptions={SCREEN_OPTIONS}>
|
|
9
|
-
<Tabs.Screen name='index' options={INDEX_OPTIONS} />
|
|
10
|
-
<Tabs.Screen name='profile' options={PROFILE_OPTIONS} />
|
|
11
|
-
</Tabs>
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
const SCREEN_OPTIONS = {
|
|
15
|
-
headerRight: () => (
|
|
16
|
-
<View className='px-4'>
|
|
17
|
-
<ThemeToggle />
|
|
18
|
-
</View>
|
|
19
|
-
),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const INDEX_OPTIONS = {
|
|
23
|
-
title: 'Home',
|
|
24
|
-
tabBarIcon({ color, size }: { color: string; size: number }) {
|
|
25
|
-
return <Icon name='home' color={color} size={size} />;
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const PROFILE_OPTIONS = {
|
|
30
|
-
title: 'Profile',
|
|
31
|
-
tabBarIcon({ color, size }: { color: string; size: number }) {
|
|
32
|
-
return <Icon name='person' color={color} size={size} />;
|
|
33
|
-
},
|
|
34
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { router } from 'expo-router';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Button, View } from 'react-native';
|
|
4
|
-
|
|
5
|
-
export default function HomeScreen() {
|
|
6
|
-
return (
|
|
7
|
-
<View className='flex-1 justify-center items-center'>
|
|
8
|
-
<Button title='Go back' onPress={router.back} />
|
|
9
|
-
</View>
|
|
10
|
-
);
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { router } from 'expo-router';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Button, View } from 'react-native';
|
|
4
|
-
|
|
5
|
-
export default function ProfileScreen() {
|
|
6
|
-
return (
|
|
7
|
-
<View className='flex-1 justify-center items-center'>
|
|
8
|
-
<Button color={'orange'} title='Go to home tab' onPress={router.back} />
|
|
9
|
-
</View>
|
|
10
|
-
);
|
|
11
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ThemeToggle } from '~/components/ThemeToggle';
|
|
2
|
-
import { useColorScheme } from '~/lib/useColorScheme';
|
|
3
|
-
import { Drawer } from 'expo-router/drawer';
|
|
4
|
-
import { View } from 'react-native';
|
|
5
|
-
|
|
6
|
-
export default function DrawerLayout() {
|
|
7
|
-
const { colors } = useColorScheme();
|
|
8
|
-
return (
|
|
9
|
-
<Drawer
|
|
10
|
-
screenOptions={{
|
|
11
|
-
headerTintColor: colors.foreground,
|
|
12
|
-
headerRight,
|
|
13
|
-
}}
|
|
14
|
-
>
|
|
15
|
-
<Drawer.Screen name='index' options={EXPLORE_OPTIONS} />
|
|
16
|
-
</Drawer>
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function headerRight() {
|
|
21
|
-
return (
|
|
22
|
-
<View className='px-4'>
|
|
23
|
-
<ThemeToggle />
|
|
24
|
-
</View>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
const EXPLORE_OPTIONS = {
|
|
28
|
-
title: 'Explore',
|
|
29
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { router } from 'expo-router';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { Button, View } from 'react-native';
|
|
4
|
-
|
|
5
|
-
export default function ExploreScreen() {
|
|
6
|
-
return (
|
|
7
|
-
<View className='flex-1 justify-center items-center'>
|
|
8
|
-
<Button title='Go back' onPress={router.back} />
|
|
9
|
-
</View>
|
|
10
|
-
);
|
|
11
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { useColorScheme } from '~/lib/useColorScheme';
|
|
2
|
-
import type {
|
|
3
|
-
MaterialTopTabNavigationEventMap,
|
|
4
|
-
MaterialTopTabNavigationOptions,
|
|
5
|
-
} from '@react-navigation/material-top-tabs';
|
|
6
|
-
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
|
|
7
|
-
import {
|
|
8
|
-
type ParamListBase,
|
|
9
|
-
type TabNavigationState,
|
|
10
|
-
} from '@react-navigation/native';
|
|
11
|
-
import { withLayoutContext } from 'expo-router';
|
|
12
|
-
import { Dimensions } from 'react-native';
|
|
13
|
-
|
|
14
|
-
const { width } = Dimensions.get('screen');
|
|
15
|
-
|
|
16
|
-
const { Navigator } = createMaterialTopTabNavigator();
|
|
17
|
-
|
|
18
|
-
const TopTabs = withLayoutContext<
|
|
19
|
-
MaterialTopTabNavigationOptions,
|
|
20
|
-
typeof Navigator,
|
|
21
|
-
TabNavigationState<ParamListBase>,
|
|
22
|
-
MaterialTopTabNavigationEventMap
|
|
23
|
-
>(Navigator);
|
|
24
|
-
|
|
25
|
-
const SCREENS = [
|
|
26
|
-
{
|
|
27
|
-
name: 'index',
|
|
28
|
-
title: 'For You',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'following',
|
|
32
|
-
title: 'Following',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'my-group',
|
|
36
|
-
title: 'My Group',
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
|
|
40
|
-
export default function TopTabsLayout() {
|
|
41
|
-
const { colors } = useColorScheme();
|
|
42
|
-
return (
|
|
43
|
-
<TopTabs
|
|
44
|
-
initialRouteName='index'
|
|
45
|
-
screenOptions={{
|
|
46
|
-
tabBarActiveTintColor: colors.primary,
|
|
47
|
-
tabBarInactiveTintColor: 'grey',
|
|
48
|
-
tabBarLabelStyle: {
|
|
49
|
-
fontSize: 14,
|
|
50
|
-
textTransform: 'capitalize',
|
|
51
|
-
fontWeight: 'bold',
|
|
52
|
-
},
|
|
53
|
-
tabBarIndicatorStyle: {
|
|
54
|
-
backgroundColor: colors.primary,
|
|
55
|
-
},
|
|
56
|
-
tabBarScrollEnabled: true,
|
|
57
|
-
tabBarItemStyle: { width: width / SCREENS.length },
|
|
58
|
-
}}
|
|
59
|
-
>
|
|
60
|
-
{SCREENS.map(({ name, title }) => (
|
|
61
|
-
<TopTabs.Screen
|
|
62
|
-
key={name}
|
|
63
|
-
name={name}
|
|
64
|
-
options={{
|
|
65
|
-
title,
|
|
66
|
-
}}
|
|
67
|
-
/>
|
|
68
|
-
))}
|
|
69
|
-
</TopTabs>
|
|
70
|
-
);
|
|
71
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Text } from '~/components/nativewind-ui/Text';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
|
|
4
|
-
export default function FollowingScreen() {
|
|
5
|
-
return (
|
|
6
|
-
<View className='flex-1 justify-center items-center gap-5'>
|
|
7
|
-
<View className='items-center gap-1'>
|
|
8
|
-
<Text variant='title1'>Following Tab</Text>
|
|
9
|
-
<Text>Swipe to see other tabs</Text>
|
|
10
|
-
</View>
|
|
11
|
-
</View>
|
|
12
|
-
);
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Text } from '~/components/nativewind-ui/Text';
|
|
2
|
-
import { View } from 'react-native';
|
|
3
|
-
|
|
4
|
-
export default function ForYouScreen() {
|
|
5
|
-
return (
|
|
6
|
-
<View className='flex-1 justify-center items-center gap-5'>
|
|
7
|
-
<View className='items-center gap-1'>
|
|
8
|
-
<Text variant='title1'>For You Tab</Text>
|
|
9
|
-
<Text>Swipe to see other tabs</Text>
|
|
10
|
-
</View>
|
|
11
|
-
</View>
|
|
12
|
-
);
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { View } from 'react-native';
|
|
2
|
-
import { Text } from '~/components/nativewind-ui/Text';
|
|
3
|
-
|
|
4
|
-
export default function MyGroupScreen() {
|
|
5
|
-
return (
|
|
6
|
-
<View className='flex-1 justify-center items-center gap-5'>
|
|
7
|
-
<View className='items-center gap-1'>
|
|
8
|
-
<Text variant='title1'>My Group Tab</Text>
|
|
9
|
-
<Text>Swipe to see other tabs</Text>
|
|
10
|
-
</View>
|
|
11
|
-
</View>
|
|
12
|
-
);
|
|
13
|
-
}
|