blob: fc39d41e282e33b62054e6c8f71a8b5aaef22f8d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
const { Component } = require('react')
const PropTypes = require('prop-types')
const h = require('react-hyperscript')
class Alert extends Component {
render () {
const className = `.global-alert${this.props.visible ? '.visible' : '.hidden'}`
return (
h(`div${className}`, {},
h('a.msg', {}, this.props.msg)
)
)
}
}
Alert.propTypes = {
visible: PropTypes.bool.isRequired,
msg: PropTypes.string,
}
module.exports = Alert
|