Created
April 30, 2020 08:27
-
-
Save AllGistsEqual/dcc5ea4287bb53a744d251771d1f1071 to your computer and use it in GitHub Desktop.
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
import React from 'react' | |
import PropTypes from 'prop-types' | |
import { StyleSheet, ImageBackground } from 'react-native' | |
const BackgroundPage = ({ background, children }) => ( | |
<ImageBackground source={background} style={styles.imageBackground}> | |
{children} | |
</ImageBackground> | |
) | |
const styles = StyleSheet.create({ | |
imageBackground: { | |
flex: 1, | |
flexDirection: 'column', | |
resizeMode: 'cover', | |
alignItems: 'center', | |
justifyContent: 'center', | |
}, | |
}) | |
BackgroundPage.propTypes = { | |
background: PropTypes.number.isRequired, | |
children: PropTypes.node.isRequired, | |
} | |
export default BackgroundPage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment