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