Created
January 26, 2019 01:54
-
-
Save jkappers/aa5bedb239540858ae1a4fa40e3422b3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { Text } from 'react-native'; | |
export default () => <Text>OK</Text>; |
This file contains hidden or 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
import React, { Component } from 'react'; | |
import propTypes from 'prop-types'; | |
import navigatorStyle from '../styles/navigator'; | |
import { iconsMap } from '../utils/AppIcons'; | |
import GeolocationPermissionModalView from './GeolocationPermissionModalView'; | |
class ModalScreen extends Component { | |
static navigatorStyle = navigatorStyle; | |
componentDidMount() { | |
const { navigator } = this.props; | |
navigator.setButtons({ | |
rightButtons: [{ | |
id: 'dismissModal', | |
icon: iconsMap['md-close--light'] | |
}] | |
}); | |
navigator.setOnNavigatorEvent(e => { | |
if (e.id === 'dismissModal') { | |
navigator.dismissModal(); | |
} | |
}); | |
} | |
render = () => { | |
const { ViewComponent, viewProps } = this.props; | |
return <ViewComponent {...viewProps} />; | |
}; | |
} | |
ModalScreen.propTypes = { | |
viewProps: propTypes.object, | |
ViewComponent: propTypes.oneOfType([ | |
GeolocationPermissionModalView | |
]).isRequired | |
}; | |
ModalScreen.defaultProps = { | |
viewProps: {} | |
} | |
export default ModalScreen; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment