create-expo-stack 2.7.0-next.8c0b833 → 2.7.0-next.d1a265f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Icon } from '@roninoss/icons';
|
|
2
|
-
import { Link } from 'expo-router';
|
|
3
1
|
import * as React from 'react';
|
|
4
|
-
import { FlatList,
|
|
2
|
+
import { Button as RNButton, ButtonProps, FlatList, Linking, View } from 'react-native';
|
|
5
3
|
|
|
6
4
|
import { Text } from '@/components/nativewind-ui/Text';
|
|
7
|
-
import { Toggle } from '@/components/nativewind-ui/Toggle';
|
|
8
|
-
import { cn } from '@/lib/cn';
|
|
9
5
|
import { useColorScheme } from '@/lib/useColorScheme';
|
|
10
6
|
import { useHeaderSearchBar } from '@/lib/useHeaderSearchBar';
|
|
11
7
|
|
|
12
|
-
|
|
8
|
+
function DefaultButton({ color, ...props }: ButtonProps) {
|
|
13
9
|
const { colors } = useColorScheme();
|
|
10
|
+
return <RNButton color={color ?? colors.blue} {...props} />;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default function Screen() {
|
|
14
14
|
const searchValue = useHeaderSearchBar();
|
|
15
15
|
|
|
16
16
|
const data = searchValue
|
|
@@ -25,7 +25,7 @@ export default function Screen() {
|
|
|
25
25
|
<FlatList
|
|
26
26
|
contentInsetAdjustmentBehavior="automatic"
|
|
27
27
|
data={data}
|
|
28
|
-
contentContainerClassName="py-4"
|
|
28
|
+
contentContainerClassName="flex flex-1 py-4 items-center justify-center"
|
|
29
29
|
extraData={searchValue}
|
|
30
30
|
removeClippedSubviews={false} // used for selecting text on android
|
|
31
31
|
keyExtractor={(item) => item.name}
|
|
@@ -37,45 +37,18 @@ export default function Screen() {
|
|
|
37
37
|
</Card>
|
|
38
38
|
);
|
|
39
39
|
}}
|
|
40
|
-
|
|
40
|
+
ListEmptyComponent={() => {
|
|
41
41
|
return (
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
className="ios:px-4"
|
|
53
|
-
extraData={searchValue}
|
|
54
|
-
keyExtractor={(item) => item.name}
|
|
55
|
-
renderItem={({ index, item }) => {
|
|
56
|
-
const isLast = index === screens.length - 1;
|
|
57
|
-
return (
|
|
58
|
-
<Link href={item.href} asChild>
|
|
59
|
-
<Pressable
|
|
60
|
-
className={cn(
|
|
61
|
-
index === 0 && 'ios:rounded-t-xl border-t',
|
|
62
|
-
isLast && 'ios:rounded-b-xl border-b',
|
|
63
|
-
'bg-card ios:border-l ios:border-r border-border flex-row active:opacity-80'
|
|
64
|
-
)}>
|
|
65
|
-
<View
|
|
66
|
-
className={cn(
|
|
67
|
-
!isLast && 'border-border border-b',
|
|
68
|
-
'flex-1 flex-row items-center justify-between px-4 py-3'
|
|
69
|
-
)}>
|
|
70
|
-
<Text>{item.name}</Text>
|
|
71
|
-
<Icon name="chevron-right" size={18} color={colors.grey} />
|
|
72
|
-
</View>
|
|
73
|
-
</Pressable>
|
|
74
|
-
</Link>
|
|
75
|
-
);
|
|
76
|
-
}}
|
|
77
|
-
/>
|
|
78
|
-
);
|
|
42
|
+
<View className='px-4'>
|
|
43
|
+
<Text variant="title3" className="text-center font-bold">
|
|
44
|
+
No Components Installed
|
|
45
|
+
</Text>
|
|
46
|
+
<Text color="tertiary" variant="body" className="text-center pb-4">
|
|
47
|
+
You can install any of the free components from the NativeWindUI website.
|
|
48
|
+
</Text>
|
|
49
|
+
<DefaultButton title="Open NativeWindUI" onPress={() => Linking.openURL('https://nativewindui.com')} />
|
|
50
|
+
</View>
|
|
51
|
+
)
|
|
79
52
|
}}
|
|
80
53
|
/>
|
|
81
54
|
);
|
|
@@ -92,61 +65,7 @@ function Card({ children, title }: { children: React.ReactNode; title: string })
|
|
|
92
65
|
);
|
|
93
66
|
}
|
|
94
67
|
|
|
95
|
-
function ToggleExample() {
|
|
96
|
-
const [switchValue, setSwitchValue] = React.useState(true);
|
|
97
|
-
return (
|
|
98
|
-
<View className="items-center">
|
|
99
|
-
<Toggle value={switchValue} onValueChange={setSwitchValue} />
|
|
100
|
-
</View>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
68
|
const COMPONENTS = [
|
|
105
|
-
{
|
|
106
|
-
name: 'Toggle',
|
|
107
|
-
component: ToggleExample,
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
{
|
|
111
|
-
name: 'Text',
|
|
112
|
-
component: () => (
|
|
113
|
-
<View className="gap-2">
|
|
114
|
-
<Text variant="largeTitle" className="text-center">
|
|
115
|
-
Large Title
|
|
116
|
-
</Text>
|
|
117
|
-
<Text variant="title1" className="text-center">
|
|
118
|
-
Title 1
|
|
119
|
-
</Text>
|
|
120
|
-
<Text variant="title2" className="text-center">
|
|
121
|
-
Title 2
|
|
122
|
-
</Text>
|
|
123
|
-
<Text variant="title3" className="text-center">
|
|
124
|
-
Title 3
|
|
125
|
-
</Text>
|
|
126
|
-
<Text variant="heading" className="text-center">
|
|
127
|
-
Heading
|
|
128
|
-
</Text>
|
|
129
|
-
<Text variant="body" className="text-center">
|
|
130
|
-
Body
|
|
131
|
-
</Text>
|
|
132
|
-
<Text variant="callout" className="text-center">
|
|
133
|
-
Callout
|
|
134
|
-
</Text>
|
|
135
|
-
<Text variant="subhead" className="text-center">
|
|
136
|
-
Subhead
|
|
137
|
-
</Text>
|
|
138
|
-
<Text variant="footnote" className="text-center">
|
|
139
|
-
Footnote
|
|
140
|
-
</Text>
|
|
141
|
-
<Text variant="caption1" className="text-center">
|
|
142
|
-
Caption 1
|
|
143
|
-
</Text>
|
|
144
|
-
<Text variant="caption2" className="text-center">
|
|
145
|
-
Caption 2
|
|
146
|
-
</Text>
|
|
147
|
-
</View>
|
|
148
|
-
),
|
|
149
|
-
},
|
|
150
69
|
] as const;
|
|
151
70
|
|
|
152
71
|
const FULL_SCREEN_COMPONENTS = [
|
package/package.json
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useColorScheme } from '@/lib/useColorScheme';
|
|
2
|
-
import { COLORS } from '@/theme/colors';
|
|
3
|
-
import { Switch } from 'react-native';
|
|
4
|
-
|
|
5
|
-
export function Toggle(props: React.ComponentPropsWithoutRef<typeof Switch>) {
|
|
6
|
-
const { colors } = useColorScheme();
|
|
7
|
-
return (
|
|
8
|
-
<Switch
|
|
9
|
-
trackColor={{
|
|
10
|
-
true: colors.blue,
|
|
11
|
-
false: colors.grey,
|
|
12
|
-
}}
|
|
13
|
-
thumbColor={COLORS.white}
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
17
|
-
}
|