Skip to content

Commit

Permalink
Merge pull request #78 from NTUCourse-Neo/refactor/minor-issues-clean-up
Browse files Browse the repository at this point in the history
Refactor/minor issues clean up
  • Loading branch information
swh00tw authored Jun 28, 2022
2 parents 68422af + 3f02149 commit 5ccc0e7
Show file tree
Hide file tree
Showing 40 changed files with 2,853 additions and 3,222 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = {
"react/react-in-jsx-scope": "off",
"react/no-unescaped-entities": "off",
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"prefer-const": "error",
"react/no-unstable-nested-components": "warn",
},
Expand Down
3 changes: 0 additions & 3 deletions cypress/integration/e2e/e2e_home.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ describe("Home page e2e test", () => {
});
it("Navigate to recruiting page", () => {
cy.visit("/");
cy.get("button").contains("加入我們").click();
cy.url().should("include", "/recruiting");
cy.go(-1);
cy.get("button").contains("夥伴招募").click();
cy.url().should("include", "/recruiting");
});
Expand Down
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"react-sortable-hoc": "^2.0.0",
"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",
Expand Down Expand Up @@ -67,19 +68,24 @@
"last 1 safari version"
]
},
"resolutions": {
"//": "See https://github.com/facebook/create-react-app/issues/11773",
"react-error-overlay": "6.0.9"
},
"devDependencies": {
"cypress": "9.6.0",
"eslint-plugin-cypress": "^2.12.1",
"@babel/eslint-parser": "^7.17.0",
"@babel/preset-react": "^7.16.7",
"cypress": "9.6.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^4.5.0",
"eslint-plugin-unused-imports": "^2.0.0",
"husky": "^8.0.1",
"lint-staged": "^12.4.1",
"prettier": "^2.6.2"
"prettier": "^2.6.2",
"react-error-overlay": "6.0.9"
}
}
8 changes: 3 additions & 5 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { React } from "react";
import { ChakraProvider, useColorModeValue, Box, useMediaQuery } from "@chakra-ui/react";
import { ChakraProvider, useColorModeValue, Box } from "@chakra-ui/react";
import theme from "theme";
import HeaderBar from "components/HeaderBar";
import Footer from "components/Footer";
Expand All @@ -25,8 +25,6 @@ if (process.env.REACT_APP_ENV === "prod") {

function App(props) {
const { code } = useParams();
const [isMobile] = useMediaQuery("(max-width: 1000px)");
const miniFooterPages = ["home", "course", "courseinfo", "user/my", "user/info", "recruiting"];

const content = (route) => {
switch (route) {
Expand Down Expand Up @@ -61,10 +59,10 @@ function App(props) {
cacheLocation={"localstorage"}
>
<ChakraProvider theme={theme}>
<Box w="100vw" h={isMobile && miniFooterPages.includes(props.route) ? "100%" : ""}>
<Box w="100vw" h={{ base: "100%", lg: "" }}>
<HeaderBar useColorModeValue={useColorModeValue} />
{content(props.route)}
<Footer mini={miniFooterPages.includes(props.route)} />
<Footer />
</Box>
</ChakraProvider>
</Auth0Provider>
Expand Down
3 changes: 3 additions & 0 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
LOG_IN_SUCCESS,
LOG_OUT_SUCCESS,
SET_DISPLAY_TAGS,
SET_HOVER_COURSE,
} from "constants/action-types";
import instance from "api/axios";

Expand All @@ -20,6 +21,7 @@ const logOut = () => ({ type: LOG_OUT_SUCCESS });
const logIn = (user_data) => ({ type: LOG_IN_SUCCESS, payload: user_data });
const setNewDisplayTags = (new_display_tags) => ({ type: SET_DISPLAY_TAGS, payload: new_display_tags });
const setBatchSize = (new_batch_size) => ({ type: SET_BATCH_SIZE, payload: new_batch_size });
const setHoveredCourse = (course) => ({ type: SET_HOVER_COURSE, payload: course });

// data =
// when filter_name == 'department', arr of dept_code (4-digits),
Expand Down Expand Up @@ -55,4 +57,5 @@ export {
setFilter,
setFilterEnable,
setBatchSize,
setHoveredCourse,
};
Loading

0 comments on commit 5ccc0e7

Please sign in to comment.