-
Notifications
You must be signed in to change notification settings - Fork 920
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rn-modal): apply modal header blur effect
Signed-off-by: Innei <[email protected]>
- Loading branch information
Showing
8 changed files
with
82 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @description only for iOS modal | ||
* | ||
* ``` | ||
* Set screen options: | ||
* + headerTransparent: true, | ||
* + headerBackground: BlurEffectWithBottomBorder, | ||
* ``` | ||
*/ | ||
import { useHeaderHeight } from "@react-navigation/elements" | ||
import type { KeyboardAwareScrollViewProps } from "react-native-keyboard-controller" | ||
import { KeyboardAwareScrollView } from "react-native-keyboard-controller" | ||
import { useSafeAreaInsets } from "react-native-safe-area-context" | ||
|
||
interface SafeModalScrollViewProps extends KeyboardAwareScrollViewProps {} | ||
export const SafeModalScrollView = (props: SafeModalScrollViewProps) => { | ||
const headerHeight = useHeaderHeight() | ||
const insets = useSafeAreaInsets() | ||
return ( | ||
<KeyboardAwareScrollView | ||
{...props} | ||
scrollIndicatorInsets={{ top: headerHeight, bottom: insets.bottom }} | ||
contentContainerStyle={{ paddingTop: headerHeight, paddingBottom: insets.bottom }} | ||
> | ||
{props.children} | ||
</KeyboardAwareScrollView> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { View } from "react-native" | ||
|
||
export default function ManageListScreen() { | ||
return <View /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters