diff options
Diffstat (limited to '')
| -rw-r--r-- | packages/mobile/app/_layout.tsx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/packages/mobile/app/_layout.tsx b/packages/mobile/app/_layout.tsx index 7403c6ff..c578d07f 100644 --- a/packages/mobile/app/_layout.tsx +++ b/packages/mobile/app/_layout.tsx @@ -1,12 +1,29 @@ import "@/globals.css"; +import "expo-dev-client"; -import { Slot } from "expo-router"; +import { Slot, useRouter } from "expo-router"; +import { useShareIntent } from "expo-share-intent"; import { StatusBar } from "expo-status-bar"; +import { useEffect } from "react"; import { View } from "react-native"; export default function RootLayout() { + const router = useRouter(); + const { hasShareIntent, shareIntent, resetShareIntent } = useShareIntent({ + debug: true, + }); + + useEffect(() => { + if (hasShareIntent) { + router.replace({ + pathname: "shareintent", + params: { shareIntent: JSON.stringify(shareIntent) }, + }); + resetShareIntent(); + } + }, [hasShareIntent]); return ( - <View className="w-full h-full bg-white"> + <View className="h-full w-full bg-white"> <Slot /> <StatusBar style="auto" /> </View> |
