1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Mobile: Fixes #8027: Fixed link modal position on devices with notch (#8029)

This commit is contained in:
Letty
2023-07-06 20:03:57 +02:00
committed by GitHub
parent e278a26dc8
commit e21a5c1b80
7 changed files with 76 additions and 26 deletions

View File

@ -0,0 +1,32 @@
import * as React from 'react';
import { Modal, ModalProps, StyleSheet, View, ViewStyle } from 'react-native';
import { hasNotch } from 'react-native-device-info';
interface ModalElementProps extends ModalProps {
children: React.ReactNode;
containerStyle?: ViewStyle;
elevation?: Number;
}
const ModalElement: React.FC<ModalElementProps> = ({
children,
containerStyle,
...modalProps
}) => {
return (
<Modal {...modalProps}>
<View style={[styleSheet.modalContainer, containerStyle ? containerStyle : null]}>
{children}
</View>
</Modal>
);
};
const styleSheet = StyleSheet.create({
modalContainer: {
marginTop: hasNotch() ? 65 : 15,
marginBottom: hasNotch() ? 35 : 15,
},
});
export default ModalElement;