newcandies 0.1.10 → 0.1.12
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/dist/index.js +26 -113
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -164,6 +164,9 @@ async function writeBaseline({ dest, name, withQuery }) {
|
|
|
164
164
|
baseDeps["@tanstack/react-query"] = "latest";
|
|
165
165
|
}
|
|
166
166
|
baseDeps["tailwind-merge"] = "latest";
|
|
167
|
+
baseDeps["react-native-keyboard-controller"] = "latest";
|
|
168
|
+
baseDeps["@gorhom/bottom-sheet"] = "latest";
|
|
169
|
+
baseDeps["sonner-native"] = "latest";
|
|
167
170
|
const pkg = {
|
|
168
171
|
name,
|
|
169
172
|
version: "0.0.0",
|
|
@@ -353,105 +356,26 @@ export default Text;
|
|
|
353
356
|
`;
|
|
354
357
|
await fs.writeFile(path.join(dest, "global.css"), globalCss);
|
|
355
358
|
{
|
|
356
|
-
const rootLayout =
|
|
357
|
-
import {
|
|
358
|
-
import {
|
|
359
|
-
import
|
|
360
|
-
import {
|
|
361
|
-
import
|
|
362
|
-
import
|
|
363
|
-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
364
|
-
|
|
365
|
-
export { ErrorBoundary } from "expo-router";
|
|
366
|
-
|
|
367
|
-
export const unstable_settings = {
|
|
368
|
-
initialRouteName: "(tabs)",
|
|
369
|
-
};
|
|
370
|
-
|
|
371
|
-
SplashScreen.preventAutoHideAsync();
|
|
372
|
-
|
|
373
|
-
const queryClient = new QueryClient();
|
|
374
|
-
|
|
375
|
-
export default function RootLayout() {
|
|
376
|
-
const [loaded, error] = useFonts({
|
|
377
|
-
SpaceMono: require("../../assets/fonts/SpaceMono-Regular.ttf"),
|
|
378
|
-
...FontAwesome.font,
|
|
379
|
-
});
|
|
380
|
-
|
|
381
|
-
useEffect(() => {
|
|
382
|
-
if (error) throw error;
|
|
383
|
-
}, [error]);
|
|
384
|
-
|
|
385
|
-
useEffect(() => {
|
|
386
|
-
if (loaded) {
|
|
387
|
-
SplashScreen.hideAsync();
|
|
388
|
-
}
|
|
389
|
-
}, [loaded]);
|
|
390
|
-
|
|
391
|
-
if (!loaded) {
|
|
392
|
-
return null;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
return (
|
|
396
|
-
<QueryClientProvider client={queryClient}>
|
|
397
|
-
<RootLayoutNav />
|
|
398
|
-
</QueryClientProvider>
|
|
399
|
-
);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
function RootLayoutNav() {
|
|
403
|
-
return (
|
|
404
|
-
<Stack>
|
|
405
|
-
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
406
|
-
<Stack.Screen name="modal" options={{ presentation: "modal" }} />
|
|
407
|
-
</Stack>
|
|
408
|
-
);
|
|
409
|
-
}
|
|
410
|
-
` : `import FontAwesome from "@expo/vector-icons/FontAwesome";
|
|
411
|
-
import { useFonts } from "expo-font";
|
|
412
|
-
import { Stack } from "expo-router";
|
|
413
|
-
import * as SplashScreen from "expo-splash-screen";
|
|
414
|
-
import { useEffect } from "react";
|
|
415
|
-
import "react-native-reanimated";
|
|
416
|
-
import "../../global.css";
|
|
417
|
-
|
|
418
|
-
export { ErrorBoundary } from "expo-router";
|
|
419
|
-
|
|
420
|
-
export const unstable_settings = {
|
|
421
|
-
initialRouteName: "(tabs)",
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
SplashScreen.preventAutoHideAsync();
|
|
359
|
+
const rootLayout = `import { Stack } from 'expo-router';
|
|
360
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
361
|
+
import { KeyboardProvider } from 'react-native-keyboard-controller';
|
|
362
|
+
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
|
|
363
|
+
import { Toaster } from 'sonner-native';
|
|
364
|
+
import 'react-native-reanimated';
|
|
365
|
+
import '../../global.css';
|
|
425
366
|
|
|
426
367
|
export default function RootLayout() {
|
|
427
|
-
const [loaded, error] = useFonts({
|
|
428
|
-
SpaceMono: require("../../assets/fonts/SpaceMono-Regular.ttf"),
|
|
429
|
-
...FontAwesome.font,
|
|
430
|
-
});
|
|
431
|
-
|
|
432
|
-
useEffect(() => {
|
|
433
|
-
if (error) throw error;
|
|
434
|
-
}, [error]);
|
|
435
|
-
|
|
436
|
-
useEffect(() => {
|
|
437
|
-
if (loaded) {
|
|
438
|
-
SplashScreen.hideAsync();
|
|
439
|
-
}
|
|
440
|
-
}, [loaded]);
|
|
441
|
-
|
|
442
|
-
if (!loaded) {
|
|
443
|
-
return null;
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
return <RootLayoutNav />;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
function RootLayoutNav() {
|
|
450
368
|
return (
|
|
451
|
-
<
|
|
452
|
-
<
|
|
453
|
-
|
|
454
|
-
|
|
369
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
370
|
+
<KeyboardProvider>
|
|
371
|
+
<BottomSheetModalProvider>
|
|
372
|
+
<Stack>
|
|
373
|
+
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
374
|
+
</Stack>
|
|
375
|
+
<Toaster />
|
|
376
|
+
</BottomSheetModalProvider>
|
|
377
|
+
</KeyboardProvider>
|
|
378
|
+
</GestureHandlerRootView>
|
|
455
379
|
);
|
|
456
380
|
}
|
|
457
381
|
`;
|
|
@@ -460,9 +384,7 @@ function RootLayoutNav() {
|
|
|
460
384
|
await fs.ensureDir(tabsDir);
|
|
461
385
|
const layout = `import React from 'react';
|
|
462
386
|
import FontAwesome from '@expo/vector-icons/FontAwesome';
|
|
463
|
-
import {
|
|
464
|
-
import { Pressable } from 'react-native';
|
|
465
|
-
import '../../global.css';
|
|
387
|
+
import { Tabs } from 'expo-router';
|
|
466
388
|
|
|
467
389
|
function TabBarIcon(props: { name: React.ComponentProps<typeof FontAwesome>['name']; color: string; }) {
|
|
468
390
|
return <FontAwesome size={28} style={{ marginBottom: -3 }} {...props} />;
|
|
@@ -470,28 +392,19 @@ function TabBarIcon(props: { name: React.ComponentProps<typeof FontAwesome>['nam
|
|
|
470
392
|
|
|
471
393
|
export default function TabLayout() {
|
|
472
394
|
return (
|
|
473
|
-
<Tabs screenOptions={{ headerShown:
|
|
395
|
+
<Tabs screenOptions={{ headerShown: false }}>
|
|
474
396
|
<Tabs.Screen
|
|
475
397
|
name="index"
|
|
476
398
|
options={{
|
|
477
|
-
title: '
|
|
478
|
-
tabBarIcon: ({ color }) => <TabBarIcon name="
|
|
479
|
-
headerRight: () => (
|
|
480
|
-
<Link href="/modal" asChild>
|
|
481
|
-
<Pressable>
|
|
482
|
-
{({ pressed }) => (
|
|
483
|
-
<FontAwesome name="info-circle" size={25} color={"#1f2937"} style={{ marginRight: 15, opacity: pressed ? 0.5 : 1 }} />
|
|
484
|
-
)}
|
|
485
|
-
</Pressable>
|
|
486
|
-
</Link>
|
|
487
|
-
),
|
|
399
|
+
title: 'Home',
|
|
400
|
+
tabBarIcon: ({ color }) => <TabBarIcon name="home" color={color} />,
|
|
488
401
|
}}
|
|
489
402
|
/>
|
|
490
403
|
<Tabs.Screen
|
|
491
404
|
name="two"
|
|
492
405
|
options={{
|
|
493
|
-
title: '
|
|
494
|
-
tabBarIcon: ({ color }) => <TabBarIcon name="
|
|
406
|
+
title: 'Explore',
|
|
407
|
+
tabBarIcon: ({ color }) => <TabBarIcon name="search" color={color} />,
|
|
495
408
|
}}
|
|
496
409
|
/>
|
|
497
410
|
</Tabs>
|