-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
52 lines (41 loc) · 1.27 KB
/
index.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
42
43
44
45
46
47
48
49
50
51
52
/**
* @description React component with es module
* @email [email protected]
* @date 2019-05-31
*/
import React from 'react';
function styleInject(css, ref) {
if ( ref === void 0 ) ref = {};
var insertAt = ref.insertAt;
if (!css || typeof document === 'undefined') { return; }
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
style.type = 'text/css';
if (insertAt === 'top') {
if (head.firstChild) {
head.insertBefore(style, head.firstChild);
} else {
head.appendChild(style);
}
} else {
head.appendChild(style);
}
if (style.styleSheet) {
style.styleSheet.cssText = css;
} else {
style.appendChild(document.createTextNode(css));
}
}
var css = ".button-container {\n padding: 10px 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n\n background-color: #1790ff;\n color: #fff;\n font-size: 14px;\n border-radius: 4px;\n}";
styleInject(css);
function Button(props) {
var callback = props.callback;
var handlerClick = function handlerClick() {
!!callback && callback();
};
return React.createElement("div", {
className: "button-container",
onClick: handlerClick
}, "Primary");
}
export { Button };