diff --git a/packages/docs-gesture-handler/docs/components/reanimated-drawer-layout.mdx b/packages/docs-gesture-handler/docs/components/reanimated-drawer-layout.mdx index 87f0933458..f9e9c887bc 100644 --- a/packages/docs-gesture-handler/docs/components/reanimated-drawer-layout.mdx +++ b/packages/docs-gesture-handler/docs/components/reanimated-drawer-layout.mdx @@ -108,13 +108,21 @@ minSwipeDistance?: number; Minimal distance to swipe before the drawer starts moving. +### rootContainerStyle + +```ts +rootContainerStyle?: StyleProp; +``` + +Style applied to the outermost container that wraps both the content view and the drawer. Note that this container has `flex: 1` and `overflow: 'hidden'` applied by default. + ### contentContainerStyle ```ts contentContainerStyle?: StyleProp; ``` -Style of the content view container. +Style applied to the container wrapping the content view (the [`children`](#children)) and the background overlay. ### drawerContainerStyle @@ -122,7 +130,7 @@ Style of the content view container. drawerContainerStyle?: StyleProp; ``` -Style wrapping the drawer. +Style applied to the container wrapping the drawer (the view returned by [`renderNavigationView`](#rendernavigationview)). ### edgeWidth diff --git a/packages/docs-gesture-handler/docs/fundamentals/_examples/hooks/Simultaneous.tsx b/packages/docs-gesture-handler/docs/fundamentals/_examples/hooks/Simultaneous.tsx index a6e0452ba7..d5fc2bcb7e 100644 --- a/packages/docs-gesture-handler/docs/fundamentals/_examples/hooks/Simultaneous.tsx +++ b/packages/docs-gesture-handler/docs/fundamentals/_examples/hooks/Simultaneous.tsx @@ -8,8 +8,8 @@ import { useSimultaneousGestures, } from 'react-native-gesture-handler'; import Animated, { - useSharedValue, useAnimatedStyle, + useSharedValue, } from 'react-native-reanimated'; export default function App() { diff --git a/packages/docs-gesture-handler/src/components/CodeComparison/index.tsx b/packages/docs-gesture-handler/src/components/CodeComparison/index.tsx index 0c14189589..4ebb416574 100644 --- a/packages/docs-gesture-handler/src/components/CodeComparison/index.tsx +++ b/packages/docs-gesture-handler/src/components/CodeComparison/index.tsx @@ -1,6 +1,6 @@ -import React from 'react'; -import CodeBlock from '@theme/CodeBlock'; import useFormattedCode from '@site/src/hooks/useFormattedCode'; +import CodeBlock from '@theme/CodeBlock'; +import React from 'react'; export default function CodeComparison({ label1, diff --git a/packages/docs-gesture-handler/src/components/CollapseButton/index.tsx b/packages/docs-gesture-handler/src/components/CollapseButton/index.tsx index 7b56a7d593..7c94cd163e 100644 --- a/packages/docs-gesture-handler/src/components/CollapseButton/index.tsx +++ b/packages/docs-gesture-handler/src/components/CollapseButton/index.tsx @@ -1,10 +1,11 @@ /* eslint-disable import-x/extensions */ -import React from 'react'; -import styles from './styles.module.css'; +import { useColorMode } from '@docusaurus/theme-common'; import Arrow from '@site/static/img/Arrow.svg'; import ArrowDark from '@site/static/img/Arrow-dark.svg'; -import { useColorMode } from '@docusaurus/theme-common'; import clsx from 'clsx'; +import React from 'react'; + +import styles from './styles.module.css'; const CollapseButton: React.FC<{ label: string; diff --git a/packages/docs-gesture-handler/src/components/CollapsibleCode/index.tsx b/packages/docs-gesture-handler/src/components/CollapsibleCode/index.tsx index 94a65ad0d4..df7285d631 100644 --- a/packages/docs-gesture-handler/src/components/CollapsibleCode/index.tsx +++ b/packages/docs-gesture-handler/src/components/CollapsibleCode/index.tsx @@ -1,10 +1,9 @@ -import React, { useState } from 'react'; -import CodeBlock from '@theme/CodeBlock'; -import styles from './styles.module.css'; - import CollapseButton from '@site/src/components/CollapseButton'; - import useFormattedCode from '@site/src/hooks/useFormattedCode'; +import CodeBlock from '@theme/CodeBlock'; +import React, { useState } from 'react'; + +import styles from './styles.module.css'; interface Props { src: string; label: string; diff --git a/packages/docs-gesture-handler/src/components/Hero/StartScreen/index.tsx b/packages/docs-gesture-handler/src/components/Hero/StartScreen/index.tsx index 787ca41035..e96abb6d6d 100644 --- a/packages/docs-gesture-handler/src/components/Hero/StartScreen/index.tsx +++ b/packages/docs-gesture-handler/src/components/Hero/StartScreen/index.tsx @@ -1,6 +1,7 @@ +import HomepageButton from '@site/src/components/HomepageButton'; import React from 'react'; + import styles from './styles.module.css'; -import HomepageButton from '@site/src/components/HomepageButton'; const StartScreen = () => { return ( diff --git a/packages/docs-gesture-handler/src/hooks/useFormattedCode.tsx b/packages/docs-gesture-handler/src/hooks/useFormattedCode.tsx index b8e8b7704e..d7227c2370 100644 --- a/packages/docs-gesture-handler/src/hooks/useFormattedCode.tsx +++ b/packages/docs-gesture-handler/src/hooks/useFormattedCode.tsx @@ -1,7 +1,7 @@ -import { useEffect, useState } from 'react'; -import * as prettier from 'prettier/standalone'; -import tsParser from 'prettier/plugins/typescript'; import estreeParser from 'prettier/plugins/estree'; +import tsParser from 'prettier/plugins/typescript'; +import * as prettier from 'prettier/standalone'; +import { useEffect, useState } from 'react'; const prettierOptions = { parser: 'typescript', diff --git a/packages/react-native-gesture-handler/src/components/ReanimatedDrawerLayout.tsx b/packages/react-native-gesture-handler/src/components/ReanimatedDrawerLayout.tsx index c5c4bd399d..25973058cc 100644 --- a/packages/react-native-gesture-handler/src/components/ReanimatedDrawerLayout.tsx +++ b/packages/react-native-gesture-handler/src/components/ReanimatedDrawerLayout.tsx @@ -188,15 +188,28 @@ export type DrawerLayoutProps = { overlayColor?: string; /** - * Style wrapping the content. + * Style applied to the container wrapping the content view (the `children`) + * and the background overlay. */ contentContainerStyle?: StyleProp; /** - * Style wrapping the drawer. + * Style applied to the container wrapping the drawer (the view returned by + * `renderNavigationView`). */ drawerContainerStyle?: StyleProp; + /** + * Style applied to the outermost container that wraps both the content view + * and the drawer. + */ + rootContainerStyle?: StyleProp; + + /** + * Called while the drawer is moving or animating, with a `position` + * parameter indicating the progress of the opening/closing animation. + * It equals `0` when the drawer is closed and `1` when it is fully opened. + */ onDrawerSlide?: (position: number) => void; // Implicit `children` prop has been removed in @types/react^18.0. @@ -286,6 +299,7 @@ const DrawerLayout = function DrawerLayout( drawerType = defaultProps.drawerType, drawerBackgroundColor, drawerContainerStyle, + rootContainerStyle, contentContainerStyle, minSwipeDistance = defaultProps.minSwipeDistance, edgeWidth = defaultProps.edgeWidth, @@ -664,7 +678,9 @@ const DrawerLayout = function DrawerLayout( gesture={panGesture} userSelect={userSelect} enableContextMenu={enableContextMenu}> - +