From 678bb84d3105bc4fc040567a07e8cbdeb56c58d1 Mon Sep 17 00:00:00 2001 From: lodev09 Date: Thu, 25 Apr 2024 18:27:41 +0800 Subject: [PATCH] feat(ios): add `dimmedIndex` --- docs/docs/reference/01-props.mdx | 18 ++++++++++++++++++ example/src/sheets/InlineSheet.tsx | 6 ++++-- ios/TrueSheetView.swift | 11 +++++++++++ ios/TrueSheetViewController.swift | 15 +++++++++++---- ios/TrueSheetViewManager.m | 1 + src/TrueSheet.tsx | 2 ++ src/types.ts | 10 ++++++++-- 7 files changed, 55 insertions(+), 8 deletions(-) diff --git a/docs/docs/reference/01-props.mdx b/docs/docs/reference/01-props.mdx index 894aeae..e3d31f7 100644 --- a/docs/docs/reference/01-props.mdx +++ b/docs/docs/reference/01-props.mdx @@ -74,6 +74,24 @@ If set to `false`, the sheet will prevent interactive dismissal via dragging or | - | - | - | - | | `boolean` | `true` | ✅ | ✅ | +### `dimmed` + +Specify whether the sheet background is dimmed. Set to `false` to allow interaction with the background components. + +| Type | Default | 🍎 | 🤖 | +| - | - | - | - | +| `boolean` | `true` | ✅ | ✅ | + +### `dimmedIndex` + +The size index that the sheet should start to dim on IOS. When value is `> 0`, `dimmed` is ignored. + +Consider using `dimmed` for consistency across platforms. + +| Type | Default | 🍎 | 🤖 | +| - | - | - | - | +| `number` | `0` | ✅ | ✅ | + ### `grabber` Shows a grabber (or handle). Native on IOS and styled `View` on Android. diff --git a/example/src/sheets/InlineSheet.tsx b/example/src/sheets/InlineSheet.tsx index 183129b..62e2a51 100644 --- a/example/src/sheets/InlineSheet.tsx +++ b/example/src/sheets/InlineSheet.tsx @@ -47,13 +47,15 @@ export const InlineSheet = forwardRef((props: InlineSheetProps, ref: Ref setIsPresented(false)} contentContainerStyle={$content} {...props} > +