-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
52 lines (46 loc) · 1.17 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
import Head from 'next/head'
import { DTPageHeader, DTButton, DTDrawer, DTEmpty } from 'ui-antd-wrapper';
import { useState } from 'react';
export default function Home() {
const [visible, setVisible] = useState(false);
const [loading, setLoading] = useState(false);
const loaderIllusion = () => {
if(!visible) {
setLoading(true);
setTimeout(() => {
setLoading(false);
}, 1000);
}
setVisible(!visible);
}
return (
<>
<div className="container">
<Head>
<title>NPM Module Publish Test</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<DTPageHeader title="AntD Wrapper Example" subTitle="This is the subtitle" />
<main>
<div>
<DTButton
label="Click to open Drawer"
onClick={loaderIllusion}
type="primary"
icon={{name : 'PlusOutlined'}}
/>
</div>
</main>
</div>
<DTDrawer
title="Hello World"
visible={visible}
onClose={() => setVisible(false)}
placement="left"
loading={loading}
>
<DTEmpty description="Hello World" />
</DTDrawer>
</>
)
}