UNPKG

603 BJavaScriptView Raw
1import React from 'react'
2import { observer } from 'startupjs'
3import { Text } from 'react-native'
4import propTypes from 'prop-types'
5import { u } from './../../config/helpers'
6import './index.styl'
7const LINE_HEIGHT = u(2)
8
9function 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
16Br.defaultProps = {
17 half: false,
18 lines: 1
19}
20
21Br.propTypes = {
22 style: propTypes.oneOfType([propTypes.object, propTypes.array]),
23 half: propTypes.bool,
24 lines: propTypes.number
25
26}
27
28export default observer(Br)