Introduces Tick & TickList components
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user