()
| 37 | } |
| 38 | |
| 39 | render() { |
| 40 | return ( |
| 41 | <Transition name="el-alert-fade" onAfterLeave={this.onAfterLeave.bind(this)}> |
| 42 | <View show={this.state.visible}> |
| 43 | <div style={this.style()} className={this.className('el-alert', `el-alert--${ this.props.type }`)}> |
| 44 | { |
| 45 | this.props.showIcon && <i className={this.classNames('el-alert__icon', TYPE_CLASSES_MAP[this.props.type] || 'el-icon-information', { |
| 46 | 'is-big': this.props.description |
| 47 | })} /> |
| 48 | } |
| 49 | <div className="el-alert__content"> |
| 50 | { |
| 51 | this.props.title && ( |
| 52 | <span className={this.classNames('el-alert__title', { |
| 53 | 'is-bold': this.props.description |
| 54 | })}>{this.props.title}</span> |
| 55 | ) |
| 56 | } |
| 57 | { |
| 58 | this.props.description && <p className="el-alert__description">{this.props.description}</p> |
| 59 | } |
| 60 | <View show={this.props.closable}> |
| 61 | <i className={this.classNames('el-alert__closebtn', this.props.closeText ? 'is-customed' : 'el-icon-close')} onClick={this.close.bind(this)}>{this.props.closeText}</i> |
| 62 | </View> |
| 63 | </div> |
| 64 | </div> |
| 65 | </View> |
| 66 | </Transition> |
| 67 | ) |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | Alert.propTypes = { |
nothing calls this directly
no test coverage detected