diff --git a/.gitignore b/.gitignore index 4253c0b..a5a9a4e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,10 +43,10 @@ android.iml # Cocoapods # -example/ios/Pods +example/bare/ios/Pods # Ruby -example/vendor/ +example/bare/vendor/ # node.js # diff --git a/AGENTS.md b/AGENTS.md index 33e6906..864537a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -22,7 +22,9 @@ src/ ├── specs/ # TurboModule spec ├── reanimated/ # Reanimated integration ├── navigation/ # React Navigation integration +│ └── screen/ # Screen components for navigator ├── TrueSheet.tsx # Main React component +├── TrueSheetProvider.tsx └── TrueSheet.types.ts ios/ @@ -30,9 +32,10 @@ ios/ ├── TrueSheetViewController.mm # UIViewController for sheet presentation ├── TrueSheetModule.mm # TurboModule ├── TrueSheet*View.mm # Container, Content, Header, Footer views -├── core/ # Core UI components (GrabberView, BlurView) -├── events/ # Event classes -└── utils/ # Utility classes +├── TrueSheetComponentDescriptor.h +├── core/ # GrabberView, BlurView +├── events/ # Lifecycle, State, Drag, Focus events +└── utils/ # Layout, Gesture, Window utilities android/.../truesheet/ ├── TrueSheetView.kt # Host view @@ -40,13 +43,14 @@ android/.../truesheet/ ├── TrueSheetModule.kt # TurboModule ├── TrueSheet*View.kt # Container, Content, Header, Footer views ├── TrueSheet*ViewManager.kt # View managers -├── core/ # Core components (GrabberView, DialogObserver, etc.) -├── events/ # Event classes -└── utils/ # Utility classes +├── TrueSheetPackage.kt +├── core/ # GrabberView, DialogObserver, RNScreensFragmentObserver +├── events/ # Lifecycle, State, Drag, Focus events +└── utils/ # ScreenUtils common/cpp/.../TrueSheetSpec/ -├── TrueSheetViewState.h/.cpp # Shared state -├── TrueSheetViewShadowNode.h/.cpp # Custom shadow node +├── TrueSheetViewState.cpp/.h +├── TrueSheetViewShadowNode.cpp/.h └── TrueSheetViewComponentDescriptor.h ``` diff --git a/example/.bundle/config b/example/bare/.bundle/config similarity index 100% rename from example/.bundle/config rename to example/bare/.bundle/config diff --git a/example/.watchmanconfig b/example/bare/.watchmanconfig similarity index 100% rename from example/.watchmanconfig rename to example/bare/.watchmanconfig diff --git a/example/Gemfile b/example/bare/Gemfile similarity index 100% rename from example/Gemfile rename to example/bare/Gemfile diff --git a/example/Gemfile.lock b/example/bare/Gemfile.lock similarity index 100% rename from example/Gemfile.lock rename to example/bare/Gemfile.lock diff --git a/example/README.md b/example/bare/README.md similarity index 100% rename from example/README.md rename to example/bare/README.md diff --git a/example/android/app/build.gradle b/example/bare/android/app/build.gradle similarity index 100% rename from example/android/app/build.gradle rename to example/bare/android/app/build.gradle diff --git a/example/android/app/debug.keystore b/example/bare/android/app/debug.keystore similarity index 100% rename from example/android/app/debug.keystore rename to example/bare/android/app/debug.keystore diff --git a/example/android/app/proguard-rules.pro b/example/bare/android/app/proguard-rules.pro similarity index 100% rename from example/android/app/proguard-rules.pro rename to example/bare/android/app/proguard-rules.pro diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/bare/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from example/android/app/src/debug/AndroidManifest.xml rename to example/bare/android/app/src/debug/AndroidManifest.xml diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/bare/android/app/src/main/AndroidManifest.xml similarity index 100% rename from example/android/app/src/main/AndroidManifest.xml rename to example/bare/android/app/src/main/AndroidManifest.xml diff --git a/example/android/app/src/main/java/truesheet/example/MainActivity.kt b/example/bare/android/app/src/main/java/truesheet/example/MainActivity.kt similarity index 100% rename from example/android/app/src/main/java/truesheet/example/MainActivity.kt rename to example/bare/android/app/src/main/java/truesheet/example/MainActivity.kt diff --git a/example/android/app/src/main/java/truesheet/example/MainApplication.kt b/example/bare/android/app/src/main/java/truesheet/example/MainApplication.kt similarity index 100% rename from example/android/app/src/main/java/truesheet/example/MainApplication.kt rename to example/bare/android/app/src/main/java/truesheet/example/MainApplication.kt diff --git a/example/android/app/src/main/res/drawable/rn_edit_text_material.xml b/example/bare/android/app/src/main/res/drawable/rn_edit_text_material.xml similarity index 100% rename from example/android/app/src/main/res/drawable/rn_edit_text_material.xml rename to example/bare/android/app/src/main/res/drawable/rn_edit_text_material.xml diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/example/bare/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to example/bare/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/example/bare/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to example/bare/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/example/bare/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to example/bare/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/example/bare/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to example/bare/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/example/bare/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to example/bare/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/example/bare/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to example/bare/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/example/bare/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to example/bare/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/example/bare/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to example/bare/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/example/bare/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to example/bare/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/example/bare/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to example/bare/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/example/android/app/src/main/res/values/strings.xml b/example/bare/android/app/src/main/res/values/strings.xml similarity index 100% rename from example/android/app/src/main/res/values/strings.xml rename to example/bare/android/app/src/main/res/values/strings.xml diff --git a/example/android/app/src/main/res/values/styles.xml b/example/bare/android/app/src/main/res/values/styles.xml similarity index 100% rename from example/android/app/src/main/res/values/styles.xml rename to example/bare/android/app/src/main/res/values/styles.xml diff --git a/example/android/build.gradle b/example/bare/android/build.gradle similarity index 100% rename from example/android/build.gradle rename to example/bare/android/build.gradle diff --git a/example/android/gradle.properties b/example/bare/android/gradle.properties similarity index 100% rename from example/android/gradle.properties rename to example/bare/android/gradle.properties diff --git a/example/android/gradle/wrapper/gradle-wrapper.jar b/example/bare/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from example/android/gradle/wrapper/gradle-wrapper.jar rename to example/bare/android/gradle/wrapper/gradle-wrapper.jar diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/bare/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from example/android/gradle/wrapper/gradle-wrapper.properties rename to example/bare/android/gradle/wrapper/gradle-wrapper.properties diff --git a/example/android/gradlew b/example/bare/android/gradlew similarity index 100% rename from example/android/gradlew rename to example/bare/android/gradlew diff --git a/example/android/gradlew.bat b/example/bare/android/gradlew.bat similarity index 100% rename from example/android/gradlew.bat rename to example/bare/android/gradlew.bat diff --git a/example/android/settings.gradle b/example/bare/android/settings.gradle similarity index 100% rename from example/android/settings.gradle rename to example/bare/android/settings.gradle diff --git a/example/app.json b/example/bare/app.json similarity index 100% rename from example/app.json rename to example/bare/app.json diff --git a/example/babel.config.js b/example/bare/babel.config.js similarity index 74% rename from example/babel.config.js rename to example/bare/babel.config.js index 19ec600..c65478c 100644 --- a/example/babel.config.js +++ b/example/bare/babel.config.js @@ -1,8 +1,8 @@ const path = require('path') const { getConfig } = require('react-native-builder-bob/babel-config') -const pkg = require('../package.json') +const pkg = require('../../package.json') -const root = path.resolve(__dirname, '..') +const root = path.resolve(__dirname, '../..') module.exports = getConfig( { diff --git a/example/index.js b/example/bare/index.js similarity index 100% rename from example/index.js rename to example/bare/index.js diff --git a/example/ios/.xcode.env b/example/bare/ios/.xcode.env similarity index 100% rename from example/ios/.xcode.env rename to example/bare/ios/.xcode.env diff --git a/example/ios/Podfile b/example/bare/ios/Podfile similarity index 100% rename from example/ios/Podfile rename to example/bare/ios/Podfile diff --git a/example/ios/Podfile.lock b/example/bare/ios/Podfile.lock similarity index 99% rename from example/ios/Podfile.lock rename to example/bare/ios/Podfile.lock index 2a47842..2aa16e0 100644 --- a/example/ios/Podfile.lock +++ b/example/bare/ios/Podfile.lock @@ -2845,7 +2845,7 @@ DEPENDENCIES: - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - RNReanimated (from `../node_modules/react-native-reanimated`) - RNScreens (from `../node_modules/react-native-screens`) - - RNTrueSheet (from `../..`) + - RNTrueSheet (from `../../..`) - RNWorklets (from `../node_modules/react-native-worklets`) - SocketRocket (~> 0.7.1) - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) @@ -3011,7 +3011,7 @@ EXTERNAL SOURCES: RNScreens: :path: "../node_modules/react-native-screens" RNTrueSheet: - :path: "../.." + :path: "../../.." RNWorklets: :path: "../node_modules/react-native-worklets" Yoga: diff --git a/example/ios/TrueSheetExample.xcodeproj/project.pbxproj b/example/bare/ios/TrueSheetExample.xcodeproj/project.pbxproj similarity index 100% rename from example/ios/TrueSheetExample.xcodeproj/project.pbxproj rename to example/bare/ios/TrueSheetExample.xcodeproj/project.pbxproj diff --git a/example/ios/TrueSheetExample.xcodeproj/xcshareddata/xcschemes/TrueSheetExample.xcscheme b/example/bare/ios/TrueSheetExample.xcodeproj/xcshareddata/xcschemes/TrueSheetExample.xcscheme similarity index 100% rename from example/ios/TrueSheetExample.xcodeproj/xcshareddata/xcschemes/TrueSheetExample.xcscheme rename to example/bare/ios/TrueSheetExample.xcodeproj/xcshareddata/xcschemes/TrueSheetExample.xcscheme diff --git a/example/ios/TrueSheetExample.xcworkspace/contents.xcworkspacedata b/example/bare/ios/TrueSheetExample.xcworkspace/contents.xcworkspacedata similarity index 100% rename from example/ios/TrueSheetExample.xcworkspace/contents.xcworkspacedata rename to example/bare/ios/TrueSheetExample.xcworkspace/contents.xcworkspacedata diff --git a/example/ios/TrueSheetExample/AppDelegate.swift b/example/bare/ios/TrueSheetExample/AppDelegate.swift similarity index 100% rename from example/ios/TrueSheetExample/AppDelegate.swift rename to example/bare/ios/TrueSheetExample/AppDelegate.swift diff --git a/example/ios/TrueSheetExample/Images.xcassets/AppIcon.appiconset/Contents.json b/example/bare/ios/TrueSheetExample/Images.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from example/ios/TrueSheetExample/Images.xcassets/AppIcon.appiconset/Contents.json rename to example/bare/ios/TrueSheetExample/Images.xcassets/AppIcon.appiconset/Contents.json diff --git a/example/ios/TrueSheetExample/Images.xcassets/Contents.json b/example/bare/ios/TrueSheetExample/Images.xcassets/Contents.json similarity index 100% rename from example/ios/TrueSheetExample/Images.xcassets/Contents.json rename to example/bare/ios/TrueSheetExample/Images.xcassets/Contents.json diff --git a/example/ios/TrueSheetExample/Info.plist b/example/bare/ios/TrueSheetExample/Info.plist similarity index 100% rename from example/ios/TrueSheetExample/Info.plist rename to example/bare/ios/TrueSheetExample/Info.plist diff --git a/example/ios/TrueSheetExample/LaunchScreen.storyboard b/example/bare/ios/TrueSheetExample/LaunchScreen.storyboard similarity index 100% rename from example/ios/TrueSheetExample/LaunchScreen.storyboard rename to example/bare/ios/TrueSheetExample/LaunchScreen.storyboard diff --git a/example/ios/TrueSheetExample/PrivacyInfo.xcprivacy b/example/bare/ios/TrueSheetExample/PrivacyInfo.xcprivacy similarity index 100% rename from example/ios/TrueSheetExample/PrivacyInfo.xcprivacy rename to example/bare/ios/TrueSheetExample/PrivacyInfo.xcprivacy diff --git a/example/jest.config.js b/example/bare/jest.config.js similarity index 100% rename from example/jest.config.js rename to example/bare/jest.config.js diff --git a/example/metro.config.js b/example/bare/metro.config.js similarity index 91% rename from example/metro.config.js rename to example/bare/metro.config.js index 63e08db..3f42a95 100644 --- a/example/metro.config.js +++ b/example/bare/metro.config.js @@ -2,8 +2,8 @@ const path = require('path') const { getDefaultConfig } = require('@react-native/metro-config') const { withMetroConfig } = require('react-native-monorepo-config') -const root = path.resolve(__dirname, '..') -const pkg = require('../package.json') +const root = path.resolve(__dirname, '../..') +const pkg = require('../../package.json') /** * Metro configuration diff --git a/example/package.json b/example/bare/package.json similarity index 93% rename from example/package.json rename to example/bare/package.json index 2d5705b..9a6c953 100644 --- a/example/package.json +++ b/example/bare/package.json @@ -1,5 +1,5 @@ { - "name": "react-native-true-sheet-example", + "name": "@example/bare", "version": "0.0.1", "private": true, "scripts": { @@ -11,6 +11,8 @@ "doctor": "react-native doctor" }, "dependencies": { + "@example/shared": "*", + "@lodev09/react-native-true-sheet": "workspace:*", "@react-navigation/native": "^7.1.21", "@react-navigation/native-stack": "^7.7.0", "react": "19.1.1", diff --git a/example/react-native.config.js b/example/bare/react-native.config.js similarity index 71% rename from example/react-native.config.js rename to example/bare/react-native.config.js index b50076e..5653ae3 100644 --- a/example/react-native.config.js +++ b/example/bare/react-native.config.js @@ -1,5 +1,5 @@ const path = require('path'); -const pkg = require('../package.json'); +const pkg = require('../../package.json'); module.exports = { project: { @@ -9,7 +9,7 @@ module.exports = { }, dependencies: { [pkg.name]: { - root: path.join(__dirname, '..'), + root: path.join(__dirname, '../..'), platforms: { ios: {}, }, diff --git a/example/src/App.tsx b/example/bare/src/App.tsx similarity index 100% rename from example/src/App.tsx rename to example/bare/src/App.tsx diff --git a/example/src/hooks/index.ts b/example/bare/src/hooks/index.ts similarity index 100% rename from example/src/hooks/index.ts rename to example/bare/src/hooks/index.ts diff --git a/example/src/hooks/useAppNavigation.ts b/example/bare/src/hooks/useAppNavigation.ts similarity index 100% rename from example/src/hooks/useAppNavigation.ts rename to example/bare/src/hooks/useAppNavigation.ts diff --git a/example/bare/src/navigators/ModalStackNavigator.tsx b/example/bare/src/navigators/ModalStackNavigator.tsx new file mode 100644 index 0000000..839b3ac --- /dev/null +++ b/example/bare/src/navigators/ModalStackNavigator.tsx @@ -0,0 +1,27 @@ +import { createNativeStackNavigator } from '@react-navigation/native-stack'; +import { useNavigation } from '@react-navigation/native'; +import type { NativeStackNavigationProp } from '@react-navigation/native-stack'; + +import { ModalScreen, TestScreen } from '@example/shared/screens'; +import type { ModalStackParamList } from '../types'; + +const ModalStack = createNativeStackNavigator(); + +const ModalScreenWrapper = () => { + const navigation = useNavigation>(); + return ( + navigation.navigate('Test')} + onDismiss={() => navigation.goBack()} + /> + ); +}; + +export const ModalStackNavigator = () => { + return ( + + + + + ); +}; diff --git a/example/src/navigators/RootNavigator.tsx b/example/bare/src/navigators/RootNavigator.tsx similarity index 58% rename from example/src/navigators/RootNavigator.tsx rename to example/bare/src/navigators/RootNavigator.tsx index 377efc0..6070494 100644 --- a/example/src/navigators/RootNavigator.tsx +++ b/example/bare/src/navigators/RootNavigator.tsx @@ -1,14 +1,38 @@ import { createNativeStackNavigator } from '@react-navigation/native-stack'; -import { MapScreen, StandardScreen, TestScreen } from '../screens'; +import { MapScreen, StandardScreen, TestScreen } from '@example/shared/screens'; +import { Map } from '@example/shared/components'; import { ModalStackNavigator } from './ModalStackNavigator'; import { SheetNavigator } from './SheetNavigator'; import type { AppStackParamList } from '../types'; +import { useAppNavigation } from '../hooks'; const Stack = createNativeStackNavigator(); const INITIAL_ROUTE_NAME: keyof AppStackParamList = 'Map'; +const MapScreenWrapper = () => { + const navigation = useAppNavigation(); + return ( + navigation.navigate('ModalStack')} + onNavigateToSheetStack={() => navigation.navigate('SheetStack')} + /> + ); +}; + +const StandardScreenWrapper = () => { + const navigation = useAppNavigation(); + return ( + navigation.navigate('Test')} + onNavigateToModal={() => navigation.navigate('ModalStack')} + onNavigateToMap={() => navigation.navigate('Map')} + /> + ); +}; + export const RootNavigator = () => { return ( { name="SheetStack" component={SheetNavigator} /> - + (); diff --git a/example/src/navigators/index.ts b/example/bare/src/navigators/index.ts similarity index 100% rename from example/src/navigators/index.ts rename to example/bare/src/navigators/index.ts diff --git a/example/src/types.ts b/example/bare/src/types.ts similarity index 100% rename from example/src/types.ts rename to example/bare/src/types.ts diff --git a/expo-example/.gitignore b/example/expo/.gitignore similarity index 100% rename from expo-example/.gitignore rename to example/expo/.gitignore diff --git a/expo-example/app.json b/example/expo/app.json similarity index 100% rename from expo-example/app.json rename to example/expo/app.json diff --git a/expo-example/app/+html.tsx b/example/expo/app/+html.tsx similarity index 100% rename from expo-example/app/+html.tsx rename to example/expo/app/+html.tsx diff --git a/expo-example/app/_layout.tsx b/example/expo/app/_layout.tsx similarity index 60% rename from expo-example/app/_layout.tsx rename to example/expo/app/_layout.tsx index 166d9bb..1d39242 100644 --- a/expo-example/app/_layout.tsx +++ b/example/expo/app/_layout.tsx @@ -4,19 +4,17 @@ import { useFonts } from 'expo-font'; import { Stack } from 'expo-router'; import * as SplashScreen from 'expo-splash-screen'; import { useEffect } from 'react'; -import { TrueSheetProvider } from '@lodev09/react-native-true-sheet'; +import { useColorScheme } from 'react-native'; +import { ReanimatedTrueSheetProvider } from '@lodev09/react-native-true-sheet/reanimated'; import 'react-native-reanimated'; -import { useColorScheme } from '../components/useColorScheme'; - export { // Catch any errors thrown by the Layout component. ErrorBoundary, } from 'expo-router'; export const unstable_settings = { - // Ensure that reloading on `/modal` keeps a back button present. - initialRouteName: '(tabs)', + initialRouteName: 'index', }; // Prevent the splash screen from auto-hiding before asset loading is complete. @@ -51,12 +49,21 @@ function RootLayoutNav() { return ( - - - - + + + + + + + - + ); } diff --git a/example/expo/app/index.tsx b/example/expo/app/index.tsx new file mode 100644 index 0000000..9935513 --- /dev/null +++ b/example/expo/app/index.tsx @@ -0,0 +1,16 @@ +import { useRouter } from 'expo-router'; + +import { MapScreen } from '@example/shared/screens'; +import { Map } from '@example/shared/components'; + +export default function Index() { + const router = useRouter(); + + return ( + router.push('/modal')} + onNavigateToSheetStack={() => router.push('/sheet-stack')} + /> + ); +} diff --git a/example/expo/app/modal.tsx b/example/expo/app/modal.tsx new file mode 100644 index 0000000..5e06dea --- /dev/null +++ b/example/expo/app/modal.tsx @@ -0,0 +1,11 @@ +import { useRouter } from 'expo-router'; + +import { ModalScreen } from '@example/shared/screens'; + +export default function Modal() { + const router = useRouter(); + + return ( + router.push('/test')} onDismiss={() => router.back()} /> + ); +} diff --git a/example/expo/app/sheet-stack/_layout.tsx b/example/expo/app/sheet-stack/_layout.tsx new file mode 100644 index 0000000..65b8a80 --- /dev/null +++ b/example/expo/app/sheet-stack/_layout.tsx @@ -0,0 +1,70 @@ +import { withLayoutContext } from 'expo-router'; +import { createTrueSheetNavigator } from '@lodev09/react-native-true-sheet/navigation'; + +import { DARK } from '@example/shared/utils'; + +const { Navigator } = createTrueSheetNavigator(); + +export const Sheet = withLayoutContext(Navigator); + +export default function SheetStackLayout() { + return ( + { + console.log(`[SheetNavigator] sheetWillPresent: index=${e.data.index}`); + }, + sheetDidPresent: (e) => { + console.log(`[SheetNavigator] sheetDidPresent: index=${e.data.index}`); + }, + sheetWillDismiss: () => { + console.log('[SheetNavigator] sheetWillDismiss'); + }, + sheetDidDismiss: () => { + console.log('[SheetNavigator] sheetDidDismiss'); + }, + sheetDetentChange: (e) => { + console.log(`[SheetNavigator] sheetDetentChange: index=${e.data.index}`); + }, + sheetDragBegin: (e) => { + console.log(`[SheetNavigator] sheetDragBegin: index=${e.data.index}`); + }, + sheetDragChange: (e) => { + console.log(`[SheetNavigator] sheetDragChange: position=${e.data.position.toFixed(0)}`); + }, + sheetDragEnd: (e) => { + console.log(`[SheetNavigator] sheetDragEnd: index=${e.data.index}`); + }, + sheetWillFocus: () => { + console.log('[SheetNavigator] sheetWillFocus'); + }, + sheetDidFocus: () => { + console.log('[SheetNavigator] sheetDidFocus'); + }, + sheetWillBlur: () => { + console.log('[SheetNavigator] sheetWillBlur'); + }, + sheetDidBlur: () => { + console.log('[SheetNavigator] sheetDidBlur'); + }, + }} + > + + + + + ); +} diff --git a/example/expo/app/sheet-stack/details.tsx b/example/expo/app/sheet-stack/details.tsx new file mode 100644 index 0000000..f2592cc --- /dev/null +++ b/example/expo/app/sheet-stack/details.tsx @@ -0,0 +1,43 @@ +import { StyleSheet, Text, View } from 'react-native'; +import { useTrueSheetNavigation } from '@lodev09/react-native-true-sheet/navigation'; + +import { Button, DemoContent } from '@example/shared/components'; +import { GAP, LIGHT_GRAY, SPACING } from '@example/shared/utils'; + +export default function DetailsSheet() { + const navigation = useTrueSheetNavigation(); + + return ( + + Details Sheet + This is a sheet screen using expo-router. + + +