apeman-react-touchable
Version:
apeman react package for touchable component.
42 lines (34 loc) • 825 B
JSX
/**
* Style for ApTouchable.
* @class ApTouchableStyle
*/
import React, { Component } from 'react'
import { ApStyle } from 'apeman-react-style'
/** @lends ApTouchableStyle */
class ApTouchableStyle extends Component {
render () {
const s = this
let { props } = s
let { all, small, medium, large } = ApTouchableStyle.styleData(props)
return (
<ApStyle data={ Object.assign(all, props.style) }
smallMediaData={ small }
mediumMediaData={ medium }
largeMediaData={ large }
>{ props.children }</ApStyle>
)
}
}
Object.assign(ApTouchableStyle, {
propTypes: ApStyle.propTypes,
defaultProps: {},
styleData (config) {
return {
all: {
'.ap-touchable': {}
}
}
}
})
export default ApTouchableStyle