apeman-react-section
Version:
apeman react package for section components.
53 lines (40 loc) • 829 B
JSX
/**
* Section component.
* @class ApSection
*/
import React, {PropTypes as types} from 'react'
import classnames from 'classnames'
import uuid from 'uuid'
/** @lends ApSection */
const ApSection = React.createClass({
// --------------------
// Specs
// --------------------
propTypes: {
id: types.string
},
mixins: [],
statics: {},
getInitialState () {
return {}
},
getDefaultProps () {
return {
id: `ap-section-${uuid.v4()}`
}
},
render () {
const s = this
let { props } = s
let { id } = props
return (
<section className={ classnames('ap-section', props.className) }
id={ id }
style={ Object.assign({}, props.style) }>
{ props.children }
</section>
)
}
})
export default ApSection