Skip to content

Commit 570f3db

Browse files
authored
fix: pass styles prop through to modal component (#63)
* fix: pass styles prop through to modal component * chore: update version number * fix: lint fix
1 parent 531b521 commit 570f3db

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"modal",
99
"useModal"
1010
],
11-
"version": "0.2.2",
11+
"version": "0.2.3",
1212
"main": "lib/index",
1313
"types": "lib",
1414
"files": [

src/Modal.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import ModalComponent, { ModalProps } from 'react-native-modal';
1111
const styles = StyleSheet.create({
1212
modalStyle: {
1313
flex: 1,
14+
margin: 0,
1415
},
1516
});
1617

@@ -47,10 +48,10 @@ export const ModalProvider: React.FC<ModalProviderProps> = ({
4748
setContent(null);
4849
}, []);
4950

50-
const value = useMemo(
51-
() => ({ showModal, closeModal }),
52-
[showModal, closeModal],
53-
);
51+
const value = useMemo(() => ({ showModal, closeModal }), [
52+
showModal,
53+
closeModal,
54+
]);
5455

5556
return (
5657
<ModalContext.Provider value={value}>
@@ -63,7 +64,7 @@ export const ModalProvider: React.FC<ModalProviderProps> = ({
6364
hideModalContentWhileAnimating
6465
hardwareAccelerated={true}
6566
presentationStyle="overFullScreen"
66-
style={styles.modalStyle}
67+
style={[styles.modalStyle, modalProps?.style]}
6768
>
6869
{content}
6970
</ModalComponent>

0 commit comments

Comments
 (0)