Skip to content

Commit

Permalink
Merge pull request #440 from charlielee/issue-398
Browse files Browse the repository at this point in the history
Implement redux toolkit for actions
  • Loading branch information
charlielee committed Dec 18, 2022
2 parents a4bda07 + 0f82cf0 commit d573894
Show file tree
Hide file tree
Showing 20 changed files with 233 additions and 400 deletions.
85 changes: 55 additions & 30 deletions package-lock.json

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

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"dependencies": {
"@ffmpeg-installer/ffmpeg": "1.1.0",
"@redux-devtools/extension": "^3.2.3",
"@reduxjs/toolkit": "^1.9.1",
"classnames": "^2.3.1",
"conf": "^10.0.3",
"electron-store": "^8.0.1",
Expand All @@ -49,8 +49,6 @@
"react-icons": "^4.3.1",
"react-redux": "^8.0.2",
"react-router-dom": "^6.3.0",
"redux": "^4.2.0",
"redux-thunk": "^2.4.1",
"uuid": "^8.3.2"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useDispatch, useSelector } from "react-redux";
import { changeWorkingDirectory } from "../../../redux/app/thunks";
import { changeWorkingDirectory } from "../../../redux/thunks";
import { RootState } from "../../../redux/store";
import Button from "../../common/Button/Button";
import InputGroup from "../../common/Input/InputGroup/InputGroup";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useDispatch, useSelector } from "react-redux";
import { PLAYBACK_SPEEDS } from "../../../../common/utils";
import { setPlaybackSpeed } from "../../../redux/project/actions";
import { setPlaybackSpeed } from "../../../redux/slices/projectSlice";
import { RootState } from "../../../redux/store";
import InputSelect from "../../common/Input/InputSelect/InputSelect";

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/common/AppListener/AppListener.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
fetchAndSetDeviceList,
loadSavedPreferences,
onRouteChange,
} from "../../../redux/app/thunks";
} from "../../../redux/thunks";
import { RootState } from "../../../redux/store";
import { handleOnCloseButtonClick } from "../../../services/appListener/AppListenerService";
import { onDeviceChange } from "../../../services/imagingDevice/ImagingDevice";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { PageRoute } from "../../../../common/PageRoute";
import { editUserPreferences } from "../../../redux/app/actions";
import { editUserPreferences } from "../../../redux/slices/appSlice";
import { RootState } from "../../../redux/store";
import Button from "../../common/Button/Button";
import Content from "../../common/Content/Content";
Expand Down
7 changes: 3 additions & 4 deletions src/renderer/components/modals/StartupModal/StartupModal.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { useDispatch, useSelector } from "react-redux";
import { useNavigate } from "react-router-dom";
import { Action } from "redux";
import { ThunkDispatch } from "redux-thunk";
import { PageRoute } from "../../../../common/PageRoute";
import { changeWorkingDirectory } from "../../../redux/app/thunks";
import { addTake } from "../../../redux/project/actions";
import { changeWorkingDirectory } from "../../../redux/thunks";
import { RootState } from "../../../redux/store";
import { makeTake } from "../../../services/project/projectBuilder";
import Button from "../../common/Button/Button";
Expand All @@ -25,6 +22,8 @@ import ToolbarItem, {
ToolbarItemAlign,
} from "../../common/ToolbarItem/ToolbarItem";
import NewsFeed from "../NewsFeed/NewsFeed";
import { addTake } from "../../../redux/slices/projectSlice";
import { Action, ThunkDispatch } from "@reduxjs/toolkit";

const StartupModal = (): JSX.Element => {
const { workingDirectory } = useSelector(
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createRoot } from "react-dom/client";
import { Provider } from "react-redux";
import { MemoryRouter } from "react-router-dom";
import App from "./components/common/App/App";
import store from "./redux/store";
import { store } from "./redux/store";
import "./styles/theme.css";

// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
Expand Down
116 changes: 0 additions & 116 deletions src/renderer/redux/app/actions.ts

This file was deleted.

36 changes: 0 additions & 36 deletions src/renderer/redux/app/reducer.ts

This file was deleted.

0 comments on commit d573894

Please sign in to comment.