UNPKG

apeman-react-section

Version:
53 lines (40 loc) 829 B
/** * Section component. * @class ApSection */ 'use strict' 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