2020-03-08 14:19:47 +01:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import * as React from 'react';
|
|
|
|
import {withTheme} from 'react-native-paper';
|
|
|
|
import {Modalize} from "react-native-modalize";
|
|
|
|
|
2020-03-29 14:46:44 +02:00
|
|
|
/**
|
|
|
|
* Abstraction layer for Modalize component, using custom configuration
|
|
|
|
*
|
|
|
|
* @param props Props to pass to the element. Must specify an onRef prop to get an Modalize ref.
|
|
|
|
* @return {*}
|
|
|
|
*/
|
2020-03-08 14:19:47 +01:00
|
|
|
function CustomModal(props) {
|
2020-03-29 14:46:44 +02:00
|
|
|
const {colors} = props.theme;
|
2020-03-08 14:19:47 +01:00
|
|
|
return (
|
|
|
|
<Modalize
|
|
|
|
ref={props.onRef}
|
|
|
|
adjustToContentHeight
|
|
|
|
handlePosition={'inside'}
|
|
|
|
modalStyle={{backgroundColor: colors.card}}
|
|
|
|
handleStyle={{backgroundColor: colors.primary}}
|
|
|
|
>
|
|
|
|
{props.children}
|
|
|
|
</Modalize>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default withTheme(CustomModal);
|
|
|
|
|