@centreon/ui 23.10.29 → 23.10.30-MON-19324-dashboard-section-navigation.0

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.
Files changed (81) hide show
  1. package/package.json +12 -2
  2. package/src/Dashboard/DashboardLayout.stories.tsx +3 -5
  3. package/src/Dashboard/Layout.tsx +4 -4
  4. package/src/Dashboard/utils.ts +28 -28
  5. package/src/ThemeProvider/index.tsx +6 -5
  6. package/src/ThemeProvider/palettes.ts +385 -208
  7. package/src/api/TestQueryProvider.tsx +2 -1
  8. package/src/api/useFetchQuery/index.ts +8 -7
  9. package/src/api/useMutationQuery/index.ts +11 -10
  10. package/src/base/tokens/README.md +3 -0
  11. package/src/base/tokens/source/$metadata.json +5 -0
  12. package/src/base/tokens/source/base.json +142 -0
  13. package/src/base/tokens/themes/base.tokens.d.ts +38 -0
  14. package/src/base/tokens/themes/base.tokens.json +695 -0
  15. package/src/base/tokens/themes/base.tokens.ts +38 -0
  16. package/src/base/tokens/themes/ui-dark.tokens.d.ts +38 -0
  17. package/src/base/tokens/themes/ui-dark.tokens.json +695 -0
  18. package/src/base/tokens/themes/ui-dark.tokens.ts +38 -0
  19. package/src/base/tokens/themes/ui-light.tokens.d.ts +38 -0
  20. package/src/base/tokens/themes/ui-light.tokens.json +695 -0
  21. package/src/base/tokens/themes/ui-light.tokens.ts +38 -0
  22. package/src/components/Button/Button.styles.ts +17 -3
  23. package/src/components/Button/Button.tsx +6 -3
  24. package/src/components/Button/Icon/IconButton.styles.ts +9 -2
  25. package/src/components/DataTable/Item/DataTableItem.styles.ts +5 -2
  26. package/src/components/DataTable/Item/DataTableItem.tsx +36 -18
  27. package/src/components/Header/Header.styles.ts +0 -27
  28. package/src/components/Header/PageHeader/PageHeader.stories.tsx +88 -0
  29. package/src/components/Header/PageHeader/PageHeader.styles.ts +99 -0
  30. package/src/components/Header/PageHeader/PageHeader.tsx +15 -0
  31. package/src/components/Header/PageHeader/PageHeaderActions.tsx +17 -0
  32. package/src/components/Header/PageHeader/PageHeaderMain.tsx +15 -0
  33. package/src/components/Header/PageHeader/PageHeaderMenu.tsx +15 -0
  34. package/src/components/Header/PageHeader/PageHeaderTitle.tsx +44 -0
  35. package/src/components/Header/PageHeader/index.ts +12 -0
  36. package/src/components/Header/index.ts +1 -1
  37. package/src/components/Layout/AreaIndicator.styles.ts +33 -0
  38. package/src/components/Layout/AreaIndicator.tsx +35 -0
  39. package/src/components/Layout/PageLayout/PageLayout.stories.tsx +81 -0
  40. package/src/components/Layout/PageLayout/PageLayout.styles.ts +37 -0
  41. package/src/components/Layout/PageLayout/PageLayout.tsx +21 -0
  42. package/src/components/Layout/PageLayout/PageLayoutActions.tsx +15 -0
  43. package/src/components/Layout/PageLayout/PageLayoutBody.tsx +24 -0
  44. package/src/components/Layout/PageLayout/PageLayoutHeader.tsx +15 -0
  45. package/src/components/Layout/PageLayout/index.ts +10 -0
  46. package/src/components/Layout/index.ts +1 -0
  47. package/src/components/Menu/Button/MenuButton.stories.tsx +16 -0
  48. package/src/components/Menu/Button/MenuButton.styles.ts +27 -0
  49. package/src/components/Menu/Button/MenuButton.tsx +59 -0
  50. package/src/components/Menu/Button/index.ts +1 -0
  51. package/src/components/Menu/Menu.stories.tsx +71 -0
  52. package/src/components/Menu/Menu.styles.ts +70 -0
  53. package/src/components/Menu/Menu.tsx +25 -0
  54. package/src/components/Menu/MenuDivider.tsx +13 -0
  55. package/src/components/Menu/MenuItem.tsx +36 -0
  56. package/src/components/Menu/MenuItems.tsx +35 -0
  57. package/src/components/Menu/index.ts +12 -0
  58. package/src/components/Menu/useMenu.tsx +79 -0
  59. package/src/components/Modal/index.ts +2 -0
  60. package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.stories.tsx +71 -0
  61. package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.styles.ts +5 -0
  62. package/src/components/Tooltip/TextOverflowTooltip/TextOverflowTooltip.tsx +115 -0
  63. package/src/components/Tooltip/TextOverflowTooltip/index.tsx +1 -0
  64. package/src/components/Tooltip/Tooltip.stories.tsx +41 -0
  65. package/src/components/Tooltip/Tooltip.styles.ts +5 -0
  66. package/src/components/Tooltip/Tooltip.tsx +46 -0
  67. package/src/components/Tooltip/index.ts +1 -0
  68. package/src/components/index.ts +3 -0
  69. package/src/index.ts +0 -2
  70. package/src/screens/dashboard/DashboardsDetail.stories.tsx +108 -0
  71. package/src/screens/dashboard/DashboardsOverview.stories.tsx +110 -102
  72. package/src/utils/useResizeObserver.ts +6 -0
  73. package/test/setupTests.js +3 -0
  74. package/src/components/Header/Header.stories.tsx +0 -27
  75. package/src/components/Header/Header.tsx +0 -23
  76. package/src/layout/TiledListingPage/TiledListingActions.tsx +0 -15
  77. package/src/layout/TiledListingPage/TiledListingContent.tsx +0 -21
  78. package/src/layout/TiledListingPage/TiledListingList.tsx +0 -11
  79. package/src/layout/TiledListingPage/TiledListingPage.styles.ts +0 -16
  80. package/src/layout/TiledListingPage/TiledListingPage.tsx +0 -15
  81. package/src/layout/TiledListingPage/index.ts +0 -4
@@ -1,208 +1,385 @@
1
- import { equals } from 'ramda';
2
-
3
- import { alpha, PaletteOptions } from '@mui/material';
4
-
5
- import { ThemeMode } from '@centreon/ui-context';
6
-
7
- declare module '@mui/material/styles/createPalette' {
8
- interface TypeAction {
9
- acknowledged: string;
10
- acknowledgedBackground: string;
11
- inDowntime: string;
12
- inDowntimeBackground: string;
13
- }
14
- }
15
-
16
- declare module '@mui/material/styles' {
17
- interface Palette {
18
- background: {
19
- default: string;
20
- listingHeader: string;
21
- panelGroups: string;
22
- paper: string;
23
- };
24
- pending: {
25
- contrastText: string;
26
- main: string;
27
- };
28
- statusBackground: StatusBackground;
29
- }
30
- interface StatusBackground {
31
- error: string;
32
- none: string;
33
- pending: string;
34
- success: string;
35
- unknown: string;
36
- warning: string;
37
- }
38
- interface PaletteOptions {
39
- pending: {
40
- contrastText: string;
41
- main: string;
42
- };
43
- statusBackground: StatusBackground;
44
- }
45
-
46
- interface TypeBackground {
47
- listingHeader: string;
48
- panel: string;
49
- panelGroups: string;
50
- }
51
- }
52
-
53
- declare module '@mui/material/Button' {
54
- interface ButtonPropsColorOverrides {
55
- pending: true;
56
- }
57
- }
58
-
59
- declare module '@mui/material/Badge' {
60
- interface BadgePropsColorOverrides {
61
- pending: true;
62
- }
63
- }
64
-
65
- export const lightPalette: PaletteOptions = {
66
- action: {
67
- acknowledged: '#67532C',
68
- acknowledgedBackground: '#F5F1E9',
69
- activatedOpacity: 0.12,
70
- active: '#666666',
71
- disabled: '#999999',
72
- disabledBackground: 'rgba(0, 0, 0, 0.12)',
73
- focus: 'rgba(0, 0, 0, 0.12)',
74
- focusOpacity: 0.12,
75
- hover: 'rgba(0, 0, 0, 0.06)',
76
- hoverOpacity: 0.06,
77
- inDowntime: '#4B2352',
78
- inDowntimeBackground: '#F0E9F8',
79
- selected: 'rgba(102, 102, 102, 0.3)',
80
- selectedOpacity: 0.3
81
- },
82
- background: {
83
- default: '#F4F4F4',
84
- listingHeader: '#666666',
85
- panel: '#EDEDED',
86
- panelGroups: '#F5F5F5',
87
- paper: '#FFFFFF'
88
- },
89
- divider: '#E3E3E3',
90
- error: {
91
- contrastText: '#000',
92
- main: '#FF4A4A'
93
- },
94
- info: {
95
- contrastText: '#000',
96
- main: '#1588D1'
97
- },
98
- mode: ThemeMode.light,
99
- pending: {
100
- contrastText: '#000',
101
- main: '#1EBEB3'
102
- },
103
- primary: {
104
- contrastText: '#fff',
105
- dark: '#255891',
106
- light: '#cde7fc',
107
- main: '#2E68AA'
108
- },
109
- secondary: {
110
- contrastText: '#fff',
111
- main: '#C772D6'
112
- },
113
- statusBackground: {
114
- error: '#FF6666',
115
- none: alpha('#2E68AA', 0.1),
116
- pending: '#1EBEB3',
117
- success: '#88B922',
118
- unknown: '#E3E3E3',
119
- warning: '#FD9B27'
120
- },
121
- success: {
122
- contrastText: '#000',
123
- main: '#88B922'
124
- },
125
- text: {
126
- disabled: '#999999',
127
- primary: '#000000',
128
- secondary: '#666666'
129
- },
130
- warning: {
131
- contrastText: '#000',
132
- main: '#FD9B27'
133
- }
134
- };
135
-
136
- export const darkPalette: PaletteOptions = {
137
- action: {
138
- acknowledged: '#67532C',
139
- acknowledgedBackground: '#67532C',
140
- activatedOpacity: 0.3,
141
- active: '#B5B5B5',
142
- disabled: '#999999',
143
- disabledBackground: '#555555',
144
- focus: 'rgba(255, 255, 255, 0.30)',
145
- focusOpacity: 0.3,
146
- hover: 'rgba(255, 255, 255, 0.16)',
147
- hoverOpacity: 0.16,
148
- inDowntime: '#4B2352',
149
- inDowntimeBackground: '#4B2352',
150
- selected: 'rgba(255, 255, 255, 0.5)',
151
- selectedOpacity: 0.5
152
- },
153
- background: {
154
- default: '#4a4a4a',
155
- listingHeader: '#666666',
156
- panel: '#4a4a4a',
157
- panelGroups: '#252525',
158
- paper: '#212121'
159
- },
160
- divider: '#666666',
161
- error: {
162
- contrastText: '#fff',
163
- main: '#D60101'
164
- },
165
- info: {
166
- contrastText: '#fff',
167
- main: '#1CA9F4'
168
- },
169
- mode: ThemeMode.dark,
170
- pending: {
171
- contrastText: '#fff',
172
- main: '#118077'
173
- },
174
- primary: {
175
- contrastText: '#000',
176
- dark: '#4974A5',
177
- light: '#8bbff9',
178
- main: '#6eaff8'
179
- },
180
- secondary: {
181
- contrastText: '#fff',
182
- main: '#7C1FA2'
183
- },
184
- statusBackground: {
185
- error: '#D60101',
186
- none: alpha('#2E68AA', 0.1),
187
- pending: '#118077',
188
- success: '#5F8118',
189
- unknown: '#666666',
190
- warning: '#C55400'
191
- },
192
- success: {
193
- contrastText: '#fff',
194
- main: '#5F8118'
195
- },
196
- text: {
197
- disabled: '#666666',
198
- primary: '#FFFFFF',
199
- secondary: '#CCCCCC'
200
- },
201
- warning: {
202
- contrastText: '#fff',
203
- main: '#C55400'
204
- }
205
- };
206
-
207
- export const getPalette = (mode: ThemeMode): PaletteOptions =>
208
- equals(mode, ThemeMode.dark) ? darkPalette : lightPalette;
1
+ import { equals } from 'ramda';
2
+
3
+ import { alpha, PaletteOptions } from '@mui/material';
4
+
5
+ import { ThemeMode } from '@centreon/ui-context';
6
+
7
+ import * as BaseTokens from '../base/tokens/themes/base.tokens';
8
+
9
+ declare module '@mui/material/styles/createPalette' {
10
+ interface TypeAction {
11
+ acknowledged: string;
12
+ acknowledgedBackground: string;
13
+ inDowntime: string;
14
+ inDowntimeBackground: string;
15
+ }
16
+ }
17
+
18
+ declare module '@mui/material/styles' {
19
+ interface Palette {
20
+ background: TypeBackground;
21
+ header: TypeHeader;
22
+ layout: TypeLayout;
23
+ menu: TypeMenu;
24
+ pending: {
25
+ contrastText: string;
26
+ main: string;
27
+ };
28
+ statusBackground: StatusBackground;
29
+ }
30
+ interface StatusBackground {
31
+ error: string;
32
+ none: string;
33
+ pending: string;
34
+ success: string;
35
+ unknown: string;
36
+ warning: string;
37
+ }
38
+ interface PaletteOptions {
39
+ header: TypeHeader;
40
+ layout: TypeLayout;
41
+ menu: TypeMenu;
42
+ pending: {
43
+ contrastText: string;
44
+ main: string;
45
+ };
46
+ statusBackground: StatusBackground;
47
+ }
48
+
49
+ interface TypeBackground {
50
+ default: string;
51
+ listingHeader: string;
52
+ panel: string;
53
+ panelGroups: string;
54
+ }
55
+
56
+ interface TypeLayout {
57
+ body: {
58
+ background: string;
59
+ };
60
+ header: {
61
+ background: string;
62
+ border: string;
63
+ };
64
+ }
65
+
66
+ interface TypeHeader {
67
+ page: {
68
+ action: {
69
+ background: {
70
+ active: string;
71
+ default: string;
72
+ };
73
+ color: {
74
+ active: string;
75
+ default: string;
76
+ };
77
+ };
78
+ border: string;
79
+ description: string;
80
+ title: string;
81
+ };
82
+ }
83
+
84
+ interface TypeMenu {
85
+ background: string;
86
+ button: {
87
+ background: {
88
+ active: string;
89
+ default: string;
90
+ hover: string;
91
+ };
92
+ color: {
93
+ active: string;
94
+ default: string;
95
+ hover: string;
96
+ };
97
+ };
98
+ divider: {
99
+ border: string;
100
+ };
101
+ item: {
102
+ background: {
103
+ active: string;
104
+ default: string;
105
+ hover: string;
106
+ };
107
+ color: {
108
+ active: string;
109
+ default: string;
110
+ hover: string;
111
+ };
112
+ };
113
+ }
114
+ }
115
+
116
+ declare module '@mui/material/Button' {
117
+ interface ButtonPropsColorOverrides {
118
+ pending: true;
119
+ }
120
+ }
121
+
122
+ declare module '@mui/material/Badge' {
123
+ interface BadgePropsColorOverrides {
124
+ pending: true;
125
+ }
126
+ }
127
+
128
+ export const lightPalette: PaletteOptions = {
129
+ action: {
130
+ acknowledged: '#67532C',
131
+ acknowledgedBackground: '#F5F1E9',
132
+ activatedOpacity: 0.12,
133
+ active: '#666666',
134
+ disabled: '#999999',
135
+ disabledBackground: 'rgba(0, 0, 0, 0.12)',
136
+ focus: 'rgba(0, 0, 0, 0.12)',
137
+ focusOpacity: 0.12,
138
+ hover: 'rgba(0, 0, 0, 0.06)',
139
+ hoverOpacity: 0.06,
140
+ inDowntime: '#4B2352',
141
+ inDowntimeBackground: '#F0E9F8',
142
+ selected: 'rgba(102, 102, 102, 0.3)',
143
+ selectedOpacity: 0.3
144
+ },
145
+ background: {
146
+ default: '#F4F4F4',
147
+ listingHeader: '#666666',
148
+ panel: '#EDEDED',
149
+ panelGroups: '#F5F5F5',
150
+ paper: '#FFFFFF'
151
+ },
152
+ divider: '#E3E3E3',
153
+ error: {
154
+ contrastText: '#000',
155
+ main: '#FF4A4A'
156
+ },
157
+ header: {
158
+ page: {
159
+ action: {
160
+ background: {
161
+ active: '#1975D10F',
162
+ default: '#FFFFFF00'
163
+ },
164
+ color: {
165
+ active: '#1976D2',
166
+ default: '#696969'
167
+ }
168
+ },
169
+ border: '#4A4A4A',
170
+ description: '#4A4A4A',
171
+ title: '#000000'
172
+ }
173
+ },
174
+ info: {
175
+ contrastText: '#000',
176
+ main: '#1588D1'
177
+ },
178
+ layout: {
179
+ body: {
180
+ background: '#F6F6F6'
181
+ },
182
+ header: {
183
+ background: '#FFFFFF',
184
+ border: '#E3E3E3'
185
+ }
186
+ },
187
+ menu: {
188
+ background: '#FFFFFF',
189
+ button: {
190
+ background: {
191
+ active: BaseTokens.colorBlue50,
192
+ default: 'transparent',
193
+ hover: BaseTokens.colorGrey50
194
+ },
195
+ color: {
196
+ active: BaseTokens.colorBlue400,
197
+ default: BaseTokens.colorGrey400,
198
+ hover: BaseTokens.colorGrey500
199
+ }
200
+ },
201
+ divider: {
202
+ border: BaseTokens.colorGrey200
203
+ },
204
+ item: {
205
+ background: {
206
+ active: BaseTokens.colorBlue50,
207
+ default: 'transparent',
208
+ hover: BaseTokens.colorGrey50
209
+ },
210
+ color: {
211
+ active: BaseTokens.colorBlue400,
212
+ default: BaseTokens.colorGrey900,
213
+ hover: BaseTokens.colorGrey950
214
+ }
215
+ }
216
+ },
217
+ mode: ThemeMode.light,
218
+ pending: {
219
+ contrastText: '#000',
220
+ main: '#1EBEB3'
221
+ },
222
+ primary: {
223
+ contrastText: '#fff',
224
+ dark: '#255891',
225
+ light: '#cde7fc',
226
+ main: '#2E68AA'
227
+ },
228
+ secondary: {
229
+ contrastText: '#fff',
230
+ dark: '#ac28c1',
231
+ light: '#e5a5f0',
232
+ main: '#C772D6'
233
+ },
234
+ statusBackground: {
235
+ error: '#FF6666',
236
+ none: alpha('#2E68AA', 0.1),
237
+ pending: '#1EBEB3',
238
+ success: '#88B922',
239
+ unknown: '#E3E3E3',
240
+ warning: '#FD9B27'
241
+ },
242
+ success: {
243
+ contrastText: '#000',
244
+ main: '#88B922'
245
+ },
246
+ text: {
247
+ disabled: '#999999',
248
+ primary: '#000000',
249
+ secondary: '#666666'
250
+ },
251
+ warning: {
252
+ contrastText: '#000',
253
+ main: '#FD9B27'
254
+ }
255
+ };
256
+
257
+ export const darkPalette: PaletteOptions = {
258
+ action: {
259
+ acknowledged: '#67532C',
260
+ acknowledgedBackground: '#67532C',
261
+ activatedOpacity: 0.3,
262
+ active: '#B5B5B5',
263
+ disabled: '#999999',
264
+ disabledBackground: '#555555',
265
+ focus: 'rgba(255, 255, 255, 0.30)',
266
+ focusOpacity: 0.3,
267
+ hover: 'rgba(255, 255, 255, 0.16)',
268
+ hoverOpacity: 0.16,
269
+ inDowntime: '#4B2352',
270
+ inDowntimeBackground: '#4B2352',
271
+ selected: 'rgba(255, 255, 255, 0.5)',
272
+ selectedOpacity: 0.5
273
+ },
274
+ background: {
275
+ default: '#4a4a4a',
276
+ listingHeader: '#666666',
277
+ panel: '#4a4a4a',
278
+ panelGroups: '#252525',
279
+ paper: '#212121'
280
+ },
281
+ divider: '#666666',
282
+ error: {
283
+ contrastText: '#fff',
284
+ main: '#D60101'
285
+ },
286
+ header: {
287
+ page: {
288
+ action: {
289
+ background: {
290
+ active: '#1975D10F',
291
+ default: '#FFFFFF00'
292
+ },
293
+ color: {
294
+ active: '#1976D2',
295
+ default: '#696969'
296
+ }
297
+ },
298
+ border: '#bdbdbd',
299
+ description: '#bdbdbd',
300
+ title: '#fff'
301
+ }
302
+ },
303
+ info: {
304
+ contrastText: '#fff',
305
+ main: '#1CA9F4'
306
+ },
307
+ layout: {
308
+ body: {
309
+ background: '#F6F6F6'
310
+ },
311
+ header: {
312
+ background: '#FFFFFF',
313
+ border: '#E3E3E3'
314
+ }
315
+ },
316
+ menu: {
317
+ background: BaseTokens.colorGrey950,
318
+ button: {
319
+ background: {
320
+ active: BaseTokens.colorBlue950,
321
+ default: 'transparent',
322
+ hover: BaseTokens.colorGrey950
323
+ },
324
+ color: {
325
+ active: BaseTokens.colorBlue600,
326
+ default: BaseTokens.colorGrey600,
327
+ hover: BaseTokens.colorGrey500
328
+ }
329
+ },
330
+ divider: {
331
+ border: BaseTokens.colorGrey800
332
+ },
333
+ item: {
334
+ background: {
335
+ active: BaseTokens.colorBlue950,
336
+ default: 'transparent',
337
+ hover: BaseTokens.colorGrey950
338
+ },
339
+ color: {
340
+ active: BaseTokens.colorBlue400,
341
+ default: BaseTokens.colorGrey50,
342
+ hover: '#fff'
343
+ }
344
+ }
345
+ },
346
+ mode: ThemeMode.dark,
347
+ pending: {
348
+ contrastText: '#fff',
349
+ main: '#118077'
350
+ },
351
+ primary: {
352
+ contrastText: '#000',
353
+ dark: '#4974A5',
354
+ light: '#8bbff9',
355
+ main: '#6eaff8'
356
+ },
357
+ secondary: {
358
+ contrastText: '#fff',
359
+ main: '#7C1FA2'
360
+ },
361
+ statusBackground: {
362
+ error: '#D60101',
363
+ none: alpha('#2E68AA', 0.1),
364
+ pending: '#118077',
365
+ success: '#5F8118',
366
+ unknown: '#666666',
367
+ warning: '#C55400'
368
+ },
369
+ success: {
370
+ contrastText: '#fff',
371
+ main: '#5F8118'
372
+ },
373
+ text: {
374
+ disabled: '#666666',
375
+ primary: '#FFFFFF',
376
+ secondary: '#CCCCCC'
377
+ },
378
+ warning: {
379
+ contrastText: '#fff',
380
+ main: '#C55400'
381
+ }
382
+ };
383
+
384
+ export const getPalette = (mode: ThemeMode): PaletteOptions =>
385
+ equals(mode, ThemeMode.dark) ? darkPalette : lightPalette;
@@ -5,7 +5,8 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
5
5
  const client = new QueryClient({
6
6
  defaultOptions: {
7
7
  queries: {
8
- cacheTime: 0
8
+ cacheTime: 0,
9
+ retry: false
9
10
  }
10
11
  }
11
12
  });
@@ -1,4 +1,4 @@
1
- import { useEffect } from 'react';
1
+ import { useEffect, useMemo } from 'react';
2
2
 
3
3
  import 'ulog';
4
4
  import {
@@ -30,14 +30,13 @@ export interface UseFetchQueryProps<T> {
30
30
  >;
31
31
  }
32
32
 
33
- export interface UseFetchQueryState<T>
34
- extends Omit<QueryObserverBaseResult, 'data'> {
33
+ export type UseFetchQueryState<T> = {
35
34
  data?: T;
36
35
  fetchQuery: () => Promise<T | ResponseError>;
37
36
  prefetchNextPage: ({ page, getPrefetchQueryKey }) => void;
38
37
  prefetchPreviousPage: ({ page, getPrefetchQueryKey }) => void;
39
38
  prefetchQuery: ({ endpointParams, queryKey }) => void;
40
- }
39
+ } & Omit<QueryObserverBaseResult, 'data'>;
41
40
 
42
41
  export interface PrefetchEndpointParams {
43
42
  page: number;
@@ -155,9 +154,11 @@ const useFetchQuery = <T extends object>({
155
154
  );
156
155
  };
157
156
 
158
- const data = not(has('isError', queryData.data))
159
- ? (queryData.data as T)
160
- : undefined;
157
+ const data = useMemo(
158
+ () =>
159
+ not(has('isError', queryData.data)) ? (queryData.data as T) : undefined,
160
+ [queryData.data]
161
+ );
161
162
 
162
163
  const errorData = queryData.data as ResponseError | undefined;
163
164