@symply.io/basic-components 1.3.10 → 1.3.11-alpha.1
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/ToastPrompt/index.d.ts +2 -1
- package/ToastPrompt/index.js +3 -2
- package/package.json +1 -1
package/ToastPrompt/index.d.ts
CHANGED
@@ -7,7 +7,8 @@ export interface ShowPromptProps {
|
|
7
7
|
message: string | 400;
|
8
8
|
timeout?: number;
|
9
9
|
}
|
10
|
-
export declare
|
10
|
+
export declare function PromptProvider(props: PromptProviderProps): JSX.Element;
|
11
11
|
export declare function usePrompt(): {
|
12
12
|
showPrompt: (props: ShowPromptProps) => void;
|
13
13
|
};
|
14
|
+
export default usePrompt;
|
package/ToastPrompt/index.js
CHANGED
@@ -14,7 +14,7 @@ import { createContext, useRef, useContext } from "react";
|
|
14
14
|
import Logics from "./Logics";
|
15
15
|
import ToastPrompt from "./Presentation";
|
16
16
|
var PromptContext = createContext({});
|
17
|
-
export
|
17
|
+
export function PromptProvider(props) {
|
18
18
|
var children = props.children;
|
19
19
|
var toastRef = useRef(null);
|
20
20
|
function showPrompt(props) {
|
@@ -23,7 +23,8 @@ export var PromptProvider = function (props) {
|
|
23
23
|
show(type, message, timeout);
|
24
24
|
}
|
25
25
|
return (_jsx(PromptContext.Provider, __assign({ value: { showPrompt: showPrompt } }, { children: _jsxs(_Fragment, { children: [children, _jsx(Logics, __assign({ ref: toastRef }, { children: _jsx(ToastPrompt, {}) }))] }) })));
|
26
|
-
}
|
26
|
+
}
|
27
27
|
export function usePrompt() {
|
28
28
|
return useContext(PromptContext);
|
29
29
|
}
|
30
|
+
export default usePrompt;
|