Files
drip/components/common/app-page.js
T
Maria Zadnepryanets 5a555f5965 Calendar redesign
2020-08-22 13:08:24 +02:00

51 lines
1.0 KiB
JavaScript

import React from 'react'
import PropTypes from 'prop-types'
import { ScrollView, StyleSheet, View } from 'react-native'
import AppText from '../common/app-text'
import { Colors, Typography } from '../../styles'
const AppPage = ({
children,
contentContainerStyle,
scrollViewStyle,
title,
...props
}) => {
return(
<View style={styles.container}>
<ScrollView
contentContainerStyle={[styles.scrollView, contentContainerStyle]}
style={scrollViewStyle}
{...props}
>
{title && <AppText style={styles.title}>{title}</AppText>}
{children}
</ScrollView>
</View>
)
}
AppPage.propTypes = {
children: PropTypes.node,
contentContainerStyle: PropTypes.object,
scrollViewStyle: PropTypes.object,
title: PropTypes.string
}
const styles = StyleSheet.create({
container: {
backgroundColor: Colors.tourquiseLight,
flex: 1
},
scrollView: {
backgroundColor: Colors.tourquiseLight,
flexGrow: 1
},
title: {
...Typography.title
}
})
export default AppPage