diff --git a/.eslintrc.js b/.eslintrc.js index f0c09b29..1285accb 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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", }, diff --git a/cypress/integration/e2e/e2e_home.js b/cypress/integration/e2e/e2e_home.js index a3fc6364..85174f04 100644 --- a/cypress/integration/e2e/e2e_home.js +++ b/cypress/integration/e2e/e2e_home.js @@ -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"); }); diff --git a/package.json b/package.json index 59400e00..3f63c984 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" } } diff --git a/src/App.js b/src/App.js index 23688257..1f66932c 100644 --- a/src/App.js +++ b/src/App.js @@ -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"; @@ -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) { @@ -61,10 +59,10 @@ function App(props) { cacheLocation={"localstorage"} > - + {content(props.route)} -