1 | import React from 'react'
|
2 | import { observer } from 'startupjs'
|
3 | import { Text } from 'react-native'
|
4 | import propTypes from 'prop-types'
|
5 | import { u } from './../../config/helpers'
|
6 | import './index.styl'
|
7 | const LINE_HEIGHT = u(2)
|
8 |
|
9 | function Br ({ style, half, lines }) {
|
10 | const height = half ? LINE_HEIGHT / 2 : LINE_HEIGHT * lines
|
11 | return pug`
|
12 | Text.root(style=[{ height }, style])
|
13 | `
|
14 | }
|
15 |
|
16 | Br.defaultProps = {
|
17 | half: false,
|
18 | lines: 1
|
19 | }
|
20 |
|
21 | Br.propTypes = {
|
22 | style: propTypes.oneOfType([propTypes.object, propTypes.array]),
|
23 | half: propTypes.bool,
|
24 | lines: propTypes.number
|
25 |
|
26 | }
|
27 |
|
28 | export default observer(Br)
|