one-ewallet-otc-ui 0.0.3 → 0.0.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 +25 -3
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -58,7 +58,18 @@ function App() {
|
|
|
58
58
|
}
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
### 2.
|
|
61
|
+
### 2. Import Styles (Required)
|
|
62
|
+
|
|
63
|
+
**Important:** You must import the component library's styles in your application entry file:
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
// In your main.tsx or App.tsx
|
|
67
|
+
import 'one-ewallet-otc-ui/style.css'
|
|
68
|
+
// or
|
|
69
|
+
import 'one-ewallet-otc-ui/dist/style.css'
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 3. Using OtcModal Component
|
|
62
73
|
|
|
63
74
|
`OtcModal` is an OTC trading modal component:
|
|
64
75
|
|
|
@@ -89,7 +100,7 @@ function MyComponent() {
|
|
|
89
100
|
| `userAddress` | `string` | ✅ | - | User Sui wallet address |
|
|
90
101
|
| `lang` | `'ZH' \| 'EN'` | ❌ | `'EN'` | Interface language |
|
|
91
102
|
|
|
92
|
-
###
|
|
103
|
+
### 4. Using Withdraw Component
|
|
93
104
|
|
|
94
105
|
`Withdraw` is a withdrawal component that requires SuiClient support:
|
|
95
106
|
|
|
@@ -147,6 +158,8 @@ import { createRoot } from 'react-dom/client'
|
|
|
147
158
|
import { SuiClientProvider, createNetworkConfig, useSuiClient } from '@onelabs/dapp-kit'
|
|
148
159
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
149
160
|
import { OtcModal, Withdraw } from 'one-ewallet-otc-ui'
|
|
161
|
+
// Import styles
|
|
162
|
+
import 'one-ewallet-otc-ui/style.css'
|
|
150
163
|
|
|
151
164
|
// Create Sui network configuration
|
|
152
165
|
const { networkConfig } = createNetworkConfig({
|
|
@@ -212,7 +225,16 @@ createRoot(document.getElementById('root')!).render(<App />)
|
|
|
212
225
|
|
|
213
226
|
## 🎨 Styling
|
|
214
227
|
|
|
215
|
-
|
|
228
|
+
**Important:** You must import the component library's styles in your application entry file:
|
|
229
|
+
|
|
230
|
+
```tsx
|
|
231
|
+
// In your main.tsx or App.tsx
|
|
232
|
+
import 'one-ewallet-otc-ui/style.css'
|
|
233
|
+
// or
|
|
234
|
+
import 'one-ewallet-otc-ui/dist/style.css'
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
The component library includes built-in styles written in SCSS. The styles are automatically bundled into `dist/style.css` during the build process. Make sure to import this CSS file in your application for the components to display correctly.
|
|
216
238
|
|
|
217
239
|
## 🔌 API Endpoints
|
|
218
240
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "one-ewallet-otc-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -13,8 +13,13 @@
|
|
|
13
13
|
"import": "./dist/index.es.js",
|
|
14
14
|
"require": "./dist/index.umd.js",
|
|
15
15
|
"types": "./dist/types/components/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./style.css": {
|
|
18
|
+
"import": "./dist/style.css",
|
|
19
|
+
"require": "./dist/style.css"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
22
|
+
"style": "./dist/style.css",
|
|
18
23
|
"scripts": {
|
|
19
24
|
"dev": "vite",
|
|
20
25
|
"build": "tsc && vite build",
|