message-verify 0.0.32-beta.0 → 0.0.33-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -32,8 +32,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
32
32
  // src/modal.tsx
33
33
  import Modal from './compoments/modal.js';
34
34
  import ReactDOM from 'react-dom/client';
35
+ import { useState } from 'react';
35
36
  let modalRoot = null;
36
- const AntdModal = ({ config }) => (_jsx(Modal, { visible: true, onClose: () => { console.log('close'); }, children: config.content }));
37
+ // ... existing code ...
38
+ const AntdModal = ({ config }) => {
39
+ const [visible, setVisible] = useState(true);
40
+ return (_jsx(Modal, { visible: visible, onClose: () => {
41
+ setVisible(false);
42
+ config.onClose?.();
43
+ }, children: config.content }));
44
+ };
45
+ // ... existing code ...
37
46
  export const showModal = (config) => {
38
47
  const container = document.createElement('div');
39
48
  container.id = 'antd-modal-container';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "message-verify",
3
- "version": "0.0.32-beta.0",
3
+ "version": "0.0.33-beta.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "dependencies": {
package/src/index.tsx CHANGED
@@ -36,6 +36,7 @@
36
36
  // src/modal.tsx
37
37
  import Modal from './compoments/modal.js'
38
38
  import ReactDOM from 'react-dom/client'
39
+ import { useState } from'react'
39
40
 
40
41
  export type ModalConfig = {
41
42
  content: React.ReactNode
@@ -46,14 +47,23 @@ export type ModalConfig = {
46
47
 
47
48
  let modalRoot: ReactDOM.Root | null = null
48
49
 
49
- const AntdModal = ({ config }: { config: ModalConfig }) => (
50
- <Modal
51
- visible={true}
52
- onClose={() => {console.log('close')}}
53
- >
54
- {config.content}
55
- </Modal>
56
- )
50
+ // ... existing code ...
51
+ const AntdModal = ({ config }: { config: ModalConfig }) => {
52
+ const [visible, setVisible] = useState(true);
53
+
54
+ return (
55
+ <Modal
56
+ visible={visible}
57
+ onClose={() => {
58
+ setVisible(false);
59
+ config.onClose?.();
60
+ }}
61
+ >
62
+ {config.content}
63
+ </Modal>
64
+ );
65
+ };
66
+ // ... existing code ...
57
67
 
58
68
  export const showModal = (config: ModalConfig) => {
59
69
  const container = document.createElement('div')