-
Notifications
You must be signed in to change notification settings - Fork 71
/
index.jsx
41 lines (37 loc) · 1.15 KB
/
index.jsx
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, {useEffect} from 'react';
import { createRoot } from 'react-dom/client';
import Popup from '../src';
import '../style.css';
const root = createRoot(document.querySelector('#root'));
function App() {
useEffect(() => {
Popup.create({
title: 'Hello World!',
onShow: (id, title) => {
console.log('Callback: onShow', id, title);
},
onClose: (id, title) => {
console.log('Callback: onClose', id, title);
},
content: (
<div>
It takes more than just a good looking body. You've got to have the heart and soul to go with it.
</div>
),
className: 'alert',
buttons: {
left: ['cancel'],
right: [
<span style={{padding: '0 15px'}}>🦄</span>,
{
text: 'Ok!',
className: 'success',
action: Popup.close
}
]
},
});
}, []);
return <Popup />;
}
root.render(<App />);