-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathhyperline.js
More file actions
52 lines (47 loc) · 1.19 KB
/
hyperline.js
File metadata and controls
52 lines (47 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React from 'react'
import PropTypes from 'prop-types'
import Component from 'hyper/component'
import decorate from 'hyper/decorate'
class HyperLine extends Component {
static propTypes() {
return {
plugins: PropTypes.array.isRequired
}
}
render() {
const { plugins, ...props } = this.props
return (
<div className="line" {...props}>
{plugins.map((Component, index) => (
<div key={index} className="wrapper">
<Component />
</div>
))}
<style jsx>{`
.line {
display: flex;
align-items: center;
position: absolute;
overflow: hidden;
bottom: 30px;
width: 100%;
height: 18px;
font: bold 12px Monospace;
pointer-events: none;
background: transparent;
margin: 2px 0;
padding: 0 10px;
},
.wrapper {
display: flex;
flex-shrink: 0;
align-items: center;
padding-left: 10px;
padding-right: 10px;
}
`}</style>
</div>
)
}
}
export default decorate(HyperLine, 'HyperLine')