1 |
|
2 |
|
3 |
|
4 |
|
5 | 'use strict'
|
6 |
|
7 | import React, {PropTypes as types} from 'react'
|
8 | import classnames from 'classnames'
|
9 | import {ApIcon} from 'apeman-react-icon'
|
10 | import {ApTouchMixin} from 'apeman-react-mixin-touch'
|
11 |
|
12 |
|
13 | const ApToastItem = React.createClass({
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | propTypes: {
|
19 | text: types.string,
|
20 | icon: types.string
|
21 | },
|
22 |
|
23 | mixins: [
|
24 | ApTouchMixin
|
25 | ],
|
26 |
|
27 | render () {
|
28 | const s = this
|
29 | let { props } = s
|
30 | return (
|
31 | <div className="ap-toast-item" data-text={ props.text }>
|
32 | <span className="ap-toast-text">
|
33 | <ApIcon className={ classnames('ap-toast-item-icon', props.icon) }/>{ props.text }
|
34 | </span>
|
35 | { props.children }
|
36 | </div>
|
37 | )
|
38 | }
|
39 | })
|
40 |
|
41 | export default ApToastItem
|