Introduces HorizontalGrid component

This commit is contained in:
mashazyu
2019-11-17 19:57:47 +01:00
committed by Sofiya Tepikin
parent ed66395318
commit 09129adba3
3 changed files with 35 additions and 17 deletions
+26
View File
@@ -0,0 +1,26 @@
import React from 'react'
import PropTypes from 'prop-types'
import { View } from 'react-native'
import { getTickPositions } from '../helpers/chart'
import styles from './styles'
const HorizontalGrid = ({ height, startPosition }) => {
return getTickPositions(height).map(tick => {
return (
<View
top={startPosition + tick}
{...styles.horizontalGrid}
key={tick}
/>
)
})
}
HorizontalGrid.propTypes = {
height: PropTypes.number,
startPosition: PropTypes.number,
}
export default HorizontalGrid