-
Notifications
You must be signed in to change notification settings - Fork 285
/
Copy pathbutton.js
41 lines (36 loc) · 840 Bytes
/
button.js
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
import React, {Component} from 'react';
import {create, injectStyle} from 'react-free-style';
const Style = create();
const CONTAINER_STYLE = Style.registerStyle({
textAlign: 'center'
});
const BUTTON_STYLE = Style.registerStyle({
backgroundColor: '#ff0000',
width: '320px',
padding: '20px',
borderRadius: '5px',
border: 'none',
outline: 'none',
'&:hover': {
color: '#fff',
},
'&:active': {
position: 'relative',
top: '2px'
},
'@media (max-width: 480px)': {
width: '160px'
}
});
@injectStyle(Style)
class Button extends Component {
render() {
return (
<div className={CONTAINER_STYLE.className}>
<button className={BUTTON_STYLE.className}>Click me!</button>
<Style.Element />
</div>
);
}
};
React.render(<Button />, document.getElementById('content'));