Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace redux code by context API #79

Merged
merged 31 commits into from
Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f3c05ae
create handle error utils function
swh00tw Jun 28, 2022
b3e39b4
extract getSocialPostByCourseID
swh00tw Jun 28, 2022
fae80eb
extract createSocialPost
swh00tw Jun 28, 2022
d39037f
extract rest social API from redux
swh00tw Jun 28, 2022
fe4e984
extract user's related actions from redux
swh00tw Jun 28, 2022
86945be
Merge branch 'refactor/minor-issues-clean-up' into remove-redux
swh00tw Jun 28, 2022
de862f3
extract utils function
swh00tw Jun 30, 2022
5836eba
rename folders & files
swh00tw Jun 30, 2022
94f6970
extract api calls
swh00tw Jun 30, 2022
f59a3c0
extract function
swh00tw Jun 30, 2022
75eef3d
extract fetchers
swh00tw Jun 30, 2022
5dc163a
move file
swh00tw Jul 2, 2022
eb39775
remove redux
swh00tw Jul 2, 2022
f9a0217
remoe redux package
swh00tw Jul 2, 2022
f6af546
unified states naming style
swh00tw Jul 2, 2022
677e744
unified state naming style
swh00tw Jul 2, 2022
2bcdb73
extract hover logic
swh00tw Jul 2, 2022
a2820b8
extract function
swh00tw Jul 2, 2022
149bd7d
delete unnecessary function
swh00tw Jul 2, 2022
fccb3dc
delete unnecessary function
swh00tw Jul 2, 2022
2c312c6
delete unnecessary function
swh00tw Jul 2, 2022
77ee989
move states to provider
swh00tw Jul 2, 2022
22968be
add courseTable provider
swh00tw Jul 2, 2022
debac5c
delete unnecessary functions
swh00tw Jul 2, 2022
d284441
unified API function style
swh00tw Jul 2, 2022
e49a74a
unified API calling style
swh00tw Jul 2, 2022
05428ce
unified API calling style
swh00tw Jul 2, 2022
a178c26
move user related API to file
swh00tw Jul 2, 2022
ae2475d
move courseTable API to file
swh00tw Jul 2, 2022
737d621
move courses API to file
swh00tw Jul 2, 2022
dc5b23c
navigate back to home after delete
swh00tw Jul 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@
"@testing-library/user-event": "^12.0.2",
"array-move": "^4.0.0",
"axios": "^0.24.0",
"chart.js": "^3.7.0",
"color-hash": "^2.0.1",
"dotenv-defaults": "^3.0.0",
"focus-visible": "^5.2.0",
"framer-motion": "^4.1.17",
"moment": "^2.29.1",
"randomcolor": "^0.6.2",
"react": "^17.0.2",
"react-chartjs-2": "^4.0.1",
"react-copy-to-clipboard": "^5.0.4",
"react-countdown-hook": "^1.1.1",
"react-dom": "^17.0.2",
Expand All @@ -30,7 +28,6 @@
"react-icons": "^3.0.0",
"react-loading-overlay": "^1.0.1",
"react-minimal-pie-chart": "^8.2.0",
"react-redux": "^7.2.6",
"react-router-dom": "6",
"react-scripts": "4.0.3",
"react-scroll": "^1.8.4",
Expand All @@ -39,9 +36,8 @@
"react-spinners": "^0.11.0",
"react-table-drag-select": "^0.3.1",
"react-use": "^17.4.0",
"redux": "^4.1.2",
"redux-thunk": "^2.4.1",
"uuid": "^8.3.2",
"valtio": "^1.6.1",
"web-vitals": "^0.2.2"
},
"scripts": {
Expand Down
22 changes: 17 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import CourseInfoContainer from "containers/CourseInfoContainer";
import { useParams } from "react-router-dom";
import ReactGA from "react-ga";
import RecruitingPageContainer from "containers/RecruitingPageContainer";
import { UserDataProvider } from "components/Providers/UserProvider";
import { CourseSearchingProvider } from "components/Providers/CourseSearchingProvider";
import { DisplayTagsProvider } from "components/Providers/DisplayTagsProvider";
import { CourseTableProvider } from "components/Providers/CourseTableProvider";

dotenv.config();

Expand Down Expand Up @@ -59,11 +63,19 @@ function App(props) {
cacheLocation={"localstorage"}
>
<ChakraProvider theme={theme}>
<Box w="100vw" h={{ base: "100%", lg: "" }}>
<HeaderBar useColorModeValue={useColorModeValue} />
{content(props.route)}
<Footer />
</Box>
<CourseSearchingProvider>
<CourseTableProvider>
<UserDataProvider>
<DisplayTagsProvider>
<Box w="100vw" h={{ base: "100%", lg: "" }}>
<HeaderBar useColorModeValue={useColorModeValue} />
{content(props.route)}
<Footer />
</Box>
</DisplayTagsProvider>
</UserDataProvider>
</CourseTableProvider>
</CourseSearchingProvider>
Comment on lines +66 to +78
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we've gotten rid of redux, there will be more context providers in the future.
To prevent pyramid of doom, I suggest we can solve this based on one of the solutions here.

but ignore this comment, LOL

This is what Redux solves. – coreyward Jul 24, 2018 at 17:33

</ChakraProvider>
</Auth0Provider>
);
Expand Down
159 changes: 0 additions & 159 deletions src/actions/course_tables.js

This file was deleted.

Loading