tycho-components 0.0.18-SNAPSHOT-3 → 0.0.18-SNAPSHOT-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.
@@ -6,3 +6,4 @@ export declare const corpus: (data: Corpus | undefined) => StoreAction;
6
6
  export declare const logged: (data: User | undefined) => StoreAction;
7
7
  export declare const message: (data: ToastMessage) => StoreAction;
8
8
  export declare const toastLoading: (data: boolean) => StoreAction;
9
+ export declare const silentLoading: (data: boolean) => StoreAction;
@@ -17,3 +17,7 @@ export const toastLoading = (data) => ({
17
17
  type: types.TOAST_LOADING,
18
18
  payload: data,
19
19
  });
20
+ export const silentLoading = (data) => ({
21
+ type: types.SILENT_LOADING,
22
+ payload: data,
23
+ });
@@ -21,6 +21,11 @@ function reducer(state, action) {
21
21
  ...state,
22
22
  toastLoading: action.payload,
23
23
  };
24
+ case types.SILENT_LOADING:
25
+ return {
26
+ ...state,
27
+ silentLoading: action.payload,
28
+ };
24
29
  default:
25
30
  return state;
26
31
  }
@@ -4,5 +4,6 @@ const store = {
4
4
  logged: undefined,
5
5
  message: EMPTY_TOAST,
6
6
  toastLoading: false,
7
+ silentLoading: false,
7
8
  };
8
9
  export default store;
@@ -6,6 +6,7 @@ export type UserStore = {
6
6
  logged: User | undefined;
7
7
  message: ToastMessage;
8
8
  toastLoading: boolean;
9
+ silentLoading: boolean;
9
10
  };
10
11
  export type StoreAction = {
11
12
  type: string;
@@ -15,5 +16,6 @@ export declare const types: {
15
16
  CORPUS: string;
16
17
  MESSAGE: string;
17
18
  TOAST_LOADING: string;
19
+ SILENT_LOADING: string;
18
20
  LOGGED: string;
19
21
  };
@@ -2,5 +2,6 @@ export const types = {
2
2
  CORPUS: 'CORPUS',
3
3
  MESSAGE: 'MESSAGE',
4
4
  TOAST_LOADING: 'TOAST_LOADING',
5
+ SILENT_LOADING: 'SILENT_LOADING',
5
6
  LOGGED: 'LOGGED',
6
7
  };
@@ -14,5 +14,7 @@ export declare const useMessageUtils: () => {
14
14
  dispatchError: ({ err, t, key }: ErrorDispatcher) => void;
15
15
  dispatchMessage: ({ key, ns, t }: MessageDispatcher) => void;
16
16
  isLoading: () => boolean;
17
+ dispatchSilent: (val: boolean) => void;
18
+ isSilentLoading: () => boolean;
17
19
  };
18
20
  export {};
@@ -1,8 +1,14 @@
1
1
  import { useContext } from 'react';
2
- import { message, toastLoading } from '../configs/store/actions';
2
+ import { message, silentLoading, toastLoading } from '../configs/store/actions';
3
3
  import CommonContext from './CommonContext';
4
4
  export const useMessageUtils = () => {
5
5
  const { state, dispatch } = useContext(CommonContext);
6
+ const isSilentLoading = () => {
7
+ return state.silentLoading;
8
+ };
9
+ const dispatchSilent = (val) => {
10
+ dispatch(silentLoading(val));
11
+ };
6
12
  const isLoading = () => {
7
13
  return state.toastLoading;
8
14
  };
@@ -41,5 +47,7 @@ export const useMessageUtils = () => {
41
47
  dispatchError,
42
48
  dispatchMessage,
43
49
  isLoading,
50
+ dispatchSilent,
51
+ isSilentLoading,
44
52
  };
45
53
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.0.18-SNAPSHOT-3",
4
+ "version": "0.0.18-SNAPSHOT-5",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -49,7 +49,7 @@
49
49
  "react-hook-form": "^7.45.2",
50
50
  "react-i18next": "^13.0.2",
51
51
  "react-router-dom": "^6.14.2",
52
- "tycho-storybook": "0.1.7-r11",
52
+ "tycho-storybook": "0.1.7-r12",
53
53
  "yup": "^1.2.0"
54
54
  },
55
55
  "devDependencies": {