This repository was archived by the owner on May 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +117
-1
lines changed Expand file tree Collapse file tree 5 files changed +117
-1
lines changed Original file line number Diff line number Diff line change 26
26
"@mantine/hooks" : " ^7.8.1" ,
27
27
"@mantine/notifications" : " ^7.8.1" ,
28
28
"@monaco-editor/react" : " ^4.5.1" ,
29
+ "@reduxjs/toolkit" : " ^2.5.0" ,
29
30
"@tabler/icons-react" : " ^3.3.0" ,
30
31
"@types/js-cookie" : " ^3.0.3" ,
31
32
"axios" : " ^1.4.0" ,
52
53
"react-grid-layout" : " ^1.4.4" ,
53
54
"react-query" : " ^3.39.3" ,
54
55
"react-querybuilder" : " ^6.5.5" ,
56
+ "react-redux" : " ^9.2.0" ,
55
57
"react-resizable" : " ^3.0.5" ,
56
58
"react-resizable-panels" : " ^0.0.53" ,
57
59
"react-router-dom" : " ^6.14.0" ,
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ import Mantine from '@/components/Mantine';
13
13
import { BrowserRouter } from 'react-router-dom' ;
14
14
import ErrorBoundary from './components/ErrorBoundary' ;
15
15
import { QueryClient , QueryClientProvider } from 'react-query' ;
16
+ import { Provider } from 'react-redux' ;
17
+ import { store } from './store' ;
16
18
17
19
const queryClient = new QueryClient ( ) ;
18
20
@@ -21,7 +23,9 @@ ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
21
23
< Mantine >
22
24
< ErrorBoundary >
23
25
< BrowserRouter >
24
- < App />
26
+ < Provider store = { store } >
27
+ < App />
28
+ </ Provider >
25
29
</ BrowserRouter >
26
30
</ ErrorBoundary >
27
31
</ Mantine >
Original file line number Diff line number Diff line change
1
+ import { createSlice } from '@reduxjs/toolkit' ;
2
+
3
+ const alertsSlice = createSlice ( {
4
+ name : 'alerts' ,
5
+ initialState : {
6
+ alertsList : [ { } ] ,
7
+ } ,
8
+ reducers : {
9
+ pushAlert ( state , action ) {
10
+ state . alertsList . push ( action . payload ) ;
11
+ } ,
12
+ } ,
13
+ } ) ;
14
+
15
+ export const { pushAlert } = alertsSlice . actions ;
16
+ export const alertsReducer = alertsSlice . reducer ;
Original file line number Diff line number Diff line change
1
+ import { configureStore } from '@reduxjs/toolkit' ;
2
+ import { alertsReducer , pushAlert } from './alertsSlice' ;
3
+
4
+ export const store = configureStore ( {
5
+ reducer : {
6
+ alerts : alertsReducer ,
7
+ } ,
8
+ } ) ;
9
+
10
+ export { pushAlert } ;
11
+
12
+ export type RootState = ReturnType < typeof store . getState > ;
13
+ export type AppDispatch = typeof store . dispatch ;
You can’t perform that action at this time.
0 commit comments