1 | import React from 'react'
|
2 | import { observer } from 'startupjs'
|
3 | import propTypes from 'prop-types'
|
4 | import { View } from 'react-native'
|
5 | import './index.styl'
|
6 | import config from '../../config/rootConfig'
|
7 |
|
8 | function 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 |
|
25 | Content.defaultProps = {
|
26 | padding: false,
|
27 | full: false,
|
28 | width: config.Content.defaultWidth
|
29 | }
|
30 |
|
31 | Content.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 |
|
39 | export default observer(Content)
|