@jhelom/react-mui-message-dialog 1.0.3 → 1.0.5
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 +27 -0
- package/package.json +6 -2
package/README.md
CHANGED
@@ -66,3 +66,30 @@ await messageDialog.error("Error Message");
|
|
66
66
|
## Error
|
67
67
|
|
68
68
|

|
69
|
+
|
70
|
+
# Localize Text
|
71
|
+
|
72
|
+
You can localize the dialog texts (button labels and titles) by passing a `MessageDialogSettings` object to the `settings` prop of `MessageDialogProvider`. Set each property to the desired language string to customize the dialog UI for your users.
|
73
|
+
|
74
|
+
```tsx
|
75
|
+
import {
|
76
|
+
MessageDialogProvider,
|
77
|
+
MessageDialogSettings,
|
78
|
+
} from "@jhelom/react-mui-message-dialog";
|
79
|
+
|
80
|
+
const messageDialogSettings = {
|
81
|
+
okText: "OK",
|
82
|
+
cancelText: "Cancel",
|
83
|
+
alertTitle: "Alert",
|
84
|
+
confirmTitle: "Confirm",
|
85
|
+
errorTitle: "Error",
|
86
|
+
} as MessageDialogSettings;
|
87
|
+
|
88
|
+
createRoot(document.getElementById("root")!).render(
|
89
|
+
<StrictMode>
|
90
|
+
<MessageDialogProvider settings={messageDialogSettings}>
|
91
|
+
<App />
|
92
|
+
</MessageDialogProvider>
|
93
|
+
</StrictMode>
|
94
|
+
);
|
95
|
+
```
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@jhelom/react-mui-message-dialog",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.5",
|
4
4
|
"main": "dist/index.es.js",
|
5
5
|
"module": "dist/index.es.js",
|
6
6
|
"types": "dist/index.d.ts",
|
@@ -32,8 +32,12 @@
|
|
32
32
|
"keywords": [
|
33
33
|
"react",
|
34
34
|
"mui",
|
35
|
-
"dialog"
|
35
|
+
"dialog",
|
36
|
+
"typescript",
|
37
|
+
"promise",
|
38
|
+
"message"
|
36
39
|
],
|
40
|
+
"license": "MIT",
|
37
41
|
"scripts": {
|
38
42
|
"build": "vite build",
|
39
43
|
"test": "vitest",
|