@jescon-technologies/react-native-ui-kit 0.0.14 → 0.0.16
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/index.d.ts +10 -6
- package/index.js +10 -6
- package/package.json +1 -1
- package/src/Alerts/AAlert.tsx +1 -0
- package/src/Alerts/AAlertIOS.tsx +1 -0
- package/src/Common/NetworkServiceCall.ts +1 -0
- package/src/CommonStyle/ComponentFunctions.tsx +1 -22
- package/src/Custom/CSliderMenu.tsx +10 -0
- package/src/Custom/OUserView.tsx +355 -0
- package/src/CustomComponents/CBackHandler.tsx +1 -0
- package/src/CustomComponents/CContainerView.tsx +39 -0
- package/src/CustomComponents/CDetailView.tsx +234 -0
- package/src/CustomComponents/CFooterView.tsx +86 -0
- package/src/CustomComponents/CNetworkStatus.tsx +172 -0
- package/src/CustomComponents/COverlay.tsx +111 -0
- package/src/CustomComponents/HeaderBlock.tsx +775 -0
- package/src/Handlers/NotificationsContext.tsx +7 -0
- package/src/Handlers/ResponseComponentContext.tsx +56 -0
- package/src/Hoc/HDashboard.tsx +1065 -0
- package/src/Hoc/HIcons.tsx +48 -56
- package/src/Hoc/HProvider.tsx +18 -0
- package/src/Hoc/HShadowButton.tsx +102 -0
- package/src/StaticComponents/SDateTimePicker.tsx +504 -0
- package/src/StaticComponents/SSearchBar.tsx +118 -0
- package/src/Custom/Loader.js +0 -182
- package/src/Layout/LoginLayout.tsx +0 -711
- package/src/Screens/ForgotPassword.tsx +0 -342
- package/src/Screens/Login.tsx +0 -331
- package/src/Screens/Splash.tsx +0 -782
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const dataset: unknown[] = [];
|
|
4
|
+
export const NotificationContext = React.createContext<unknown[]>(dataset);
|
|
5
|
+
export const NotificationProvider = NotificationContext.Provider;
|
|
6
|
+
export const useNotifications = (): unknown[] => React.useContext(NotificationContext);
|
|
7
|
+
export default useNotifications;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React, { createContext, useState, Dispatch, SetStateAction } from 'react';
|
|
2
|
+
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Types
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
|
|
7
|
+
/** Shape of the EMR response object. Nested fields are consumer-defined. */
|
|
8
|
+
export interface ResponseJSON {
|
|
9
|
+
consultation: unknown[];
|
|
10
|
+
consultationEdit: Record<string, unknown>;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Value carried by the context. */
|
|
15
|
+
export interface ResponseContextValue {
|
|
16
|
+
responseJSON: ResponseJSON;
|
|
17
|
+
/** Accepts a value OR a functional updater (matches React's `setState`). */
|
|
18
|
+
setResponseJSON: Dispatch<SetStateAction<ResponseJSON>>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// Context
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
|
|
25
|
+
const defaultResponseJSON: ResponseJSON = {
|
|
26
|
+
consultation: [],
|
|
27
|
+
consultationEdit: {},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const ResponseComponentContext = createContext<ResponseContextValue>({
|
|
31
|
+
responseJSON: defaultResponseJSON,
|
|
32
|
+
// Default setter is a no-op. Real state lives in the Provider below.
|
|
33
|
+
setResponseJSON: () => {},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
// Provider
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
export interface ResponseComponentProviderProps {
|
|
41
|
+
children?: React.ReactNode;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export const ResponseComponentProvider: React.FC<ResponseComponentProviderProps> = ({
|
|
45
|
+
children,
|
|
46
|
+
}) => {
|
|
47
|
+
const [responseJSON, setResponseJSON] = useState<ResponseJSON>(defaultResponseJSON);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<ResponseComponentContext.Provider value={{ responseJSON, setResponseJSON }}>
|
|
51
|
+
{children}
|
|
52
|
+
</ResponseComponentContext.Provider>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export default ResponseComponentContext;
|