Skip to content

Commit

Permalink
feat: Upgrades to Redux Toolkit (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuliomir authored Feb 20, 2025
1 parent dfd320c commit 0d9c4fe
Show file tree
Hide file tree
Showing 9 changed files with 118 additions and 158 deletions.
148 changes: 69 additions & 79 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"private": true,
"dependencies": {
"@hathor/wallet-lib": "1.10.0",
"@reduxjs/toolkit": "2.5.1",
"@unleash/proxy-client-react": "1.0.4",
"axios": "1.7.2",
"bootstrap": "5.3.3",
Expand All @@ -28,10 +29,9 @@
"react-gtm-module": "2.0.11",
"react-loading": "2.0.3",
"react-paginate": "8.2.0",
"react-redux": "8.1.3",
"react-redux": "9.2.0",
"react-router-dom": "6.29.0",
"react-scripts": "3.4.4",
"redux": "4.2.1",
"sass": "1.77.8",
"unleash-proxy-client": "1.11.0",
"viz.js": "2.1.2"
Expand Down
6 changes: 1 addition & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import {
dashboardUpdate,
isVersionAllowedUpdate,
updateServerInfo,
} from './actions/index';
} from './store/rootSlice';
import versionApi from './api/version';
import helpers from './utils/helpers';
import { BASE_URL } from './constants';
Expand Down Expand Up @@ -142,10 +142,6 @@ function Root() {
path="/token_balances"
element={<NavigationRoute internalScreen={TokenBalancesList} />}
/>
<Route
path="/token_balances"
element={<NavigationRoute internalScreen={TokenBalancesList} />}
/>
<Route path="/blocks" element={<NavigationRoute internalScreen={BlockList} />} />
<Route path="/dag" component={Dag} element={<NavigationRoute internalScreen={Dag} />} />
<Route path="/features" element={<NavigationRoute internalScreen={FeatureList} />} />
Expand Down
29 changes: 0 additions & 29 deletions src/actions/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/Navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
UNLEASH_TOKEN_BALANCES_FEATURE_FLAG,
REACT_APP_NETWORK,
} from '../constants';
import { toggleTheme } from '../actions';
import { toggleTheme } from '../store/rootSlice';
import NewHathorAlert from './NewHathorAlert';

function Navigation() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ThemeSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { toggleTheme } from '../actions';
import { toggleTheme } from '../store/rootSlice';

export const ThemeSwitch = () => {
const theme = useSelector(state => state.theme);
Expand Down
2 changes: 1 addition & 1 deletion src/screens/VersionError.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useDispatch } from 'react-redux';
import { MIN_API_VERSION } from '../constants';
import versionApi from '../api/version';
import helpers from '../utils/helpers';
import { isVersionAllowedUpdate } from '../actions/index';
import { isVersionAllowedUpdate } from '../store/rootSlice';
import logo from '../assets/images/hathor-white-logo.png';
import Version from '../components/Version';

Expand Down
6 changes: 3 additions & 3 deletions src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/

import { createStore } from 'redux';
import rootReducer from '../reducers/index';
import { configureStore } from '@reduxjs/toolkit';
import rootReducer from './rootSlice';

const store = createStore(rootReducer);
const store = configureStore({ reducer: rootReducer });

export default store;
Loading

0 comments on commit 0d9c4fe

Please sign in to comment.