UNPKG

802 BJavaScriptView Raw
1import React from 'react'
2import { observer } from 'startupjs'
3import propTypes from 'prop-types'
4import { View } from 'react-native'
5import './index.styl'
6import config from '../../config/rootConfig'
7
8function Content ({
9 style,
10 children,
11 padding,
12 full,
13 width,
14 ...props
15}) {
16 return pug`
17 View.root(
18 style=style
19 styleName=['width-' + width, { padding, full }]
20 ...props
21 )= children
22 `
23}
24
25Content.defaultProps = {
26 padding: false,
27 full: false,
28 width: config.Content.defaultWidth
29}
30
31Content.propTypes = {
32 style: propTypes.oneOfType([propTypes.object, propTypes.array]),
33 padding: propTypes.bool,
34 full: propTypes.bool,
35 width: propTypes.oneOf(['mobile', 'tablet', 'desktop', 'wide', 'full']),
36 children: propTypes.node
37}
38
39export default observer(Content)