@tonconnect/ui-react 2.0.0-beta.3 → 2.0.0-beta.4
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/README.md +20 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -107,6 +107,26 @@ export const Wallet = () => {
|
|
|
107
107
|
};
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
+
### useTonConnectModal
|
|
111
|
+
|
|
112
|
+
Use this hook to access the functions for opening and closing the modal window. The hook returns an object with the current modal state and methods to open and close the modal.
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
import { useTonConnectModal } from '@tonconnect/ui-react';
|
|
116
|
+
|
|
117
|
+
export const ModalControl = () => {
|
|
118
|
+
const { state, open, close } = useTonConnectModal();
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<div>
|
|
122
|
+
<div>Modal state: {state?.status}</div>
|
|
123
|
+
<button onClick={open}>Open modal</button>
|
|
124
|
+
<button onClick={close}>Close modal</button>
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
```
|
|
129
|
+
|
|
110
130
|
### useTonConnectUI
|
|
111
131
|
Use it to get access to the `TonConnectUI` instance and UI options updating function.
|
|
112
132
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tonconnect/ui-react",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.4",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite",
|
|
6
6
|
"build": "tsc && vite build"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"vite-plugin-dts": "^1.7.1"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@tonconnect/ui": "^2.0.0-beta.
|
|
55
|
+
"@tonconnect/ui": "^2.0.0-beta.4"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"react": ">=17.0.0",
|