Introduces Tick & TickList components

This commit is contained in:
mashazyu
2019-11-17 19:37:19 +01:00
committed by Sofiya Tepikin
parent 3598dd5b80
commit bc04f6a24b
4 changed files with 98 additions and 23 deletions
+34
View File
@@ -0,0 +1,34 @@
import React from 'react'
import PropTypes from 'prop-types'
import { View } from 'react-native'
import Tick from './tick'
import { getTickList } from './y-axis'
import styles from './styles'
const TickList = ({ height }) => {
return (
<View style={[styles.yAxis, { height }]}>{
getTickList(height)
.map(({ label, position, isBold, shouldShowLabel}) => {
return (
<Tick
key={label}
yPosition={position}
isBold={isBold}
shouldShowLabel={shouldShowLabel}
label={label}
/>
)
})
}</View>
)
}
TickList.propTypes = {
height: PropTypes.number,
}
export default TickList