apeman-react-toast
Version:
apeman react package for toast components.
41 lines (34 loc) • 909 B
JSX
/**
* Toast item component
* @constructor ApToastItem
*/
;
import React, {PropTypes as types} from 'react';
import classnames from 'classnames';
import {ApIcon} from 'apeman-react-icon';
import {ApTouchMixin} from 'apeman-react-mixins';
/** @lends ApToastItem */
let ApToastItem = React.createClass({
//--------------------
// Specs
//--------------------
propTypes: {
text: types.string,
icon: types.string
},
mixins: [
ApTouchMixin
],
render(){
let s = this,
{props} = s;
return (
<div className="ap-toast-item" data-text={props.text}>
<ApIcon className={classnames('ap-toast-item-icon', props.icon)}/>
<span className="ap-toast-text">{props.text}</span>
{props.children}
</div>
);
}
});
module.exports = ApToastItem;