From 2e90c874b9390c6d7a2766f8466d5237bec8026b Mon Sep 17 00:00:00 2001 From: Nicholas Wang Date: Thu, 26 Oct 2023 23:23:22 -0700 Subject: [PATCH 1/2] updated dependencies --- package-lock.json | 55 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 56 insertions(+) diff --git a/package-lock.json b/package-lock.json index eea2a497..ca1d112e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,7 @@ "skulpt": "^1.2.0" }, "devDependencies": { + "@types/react-router-dom": "^5.3.3", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", "enzyme": "^3.11.0", @@ -3470,6 +3471,12 @@ "@types/node": "*" } }, + "node_modules/@types/history": { + "version": "4.7.11", + "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", + "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==", + "dev": true + }, "node_modules/@types/hoist-non-react-statics": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", @@ -3593,6 +3600,27 @@ "redux": "^4.0.0" } }, + "node_modules/@types/react-router": { + "version": "5.1.20", + "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", + "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", + "dev": true, + "dependencies": { + "@types/history": "^4.7.11", + "@types/react": "*" + } + }, + "node_modules/@types/react-router-dom": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", + "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", + "dev": true, + "dependencies": { + "@types/history": "^4.7.11", + "@types/react": "*", + "@types/react-router": "*" + } + }, "node_modules/@types/resolve": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", @@ -27587,6 +27615,12 @@ "@types/node": "*" } }, + "@types/history": { + "version": "4.7.11", + "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.11.tgz", + "integrity": "sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==", + "dev": true + }, "@types/hoist-non-react-statics": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz", @@ -27710,6 +27744,27 @@ "redux": "^4.0.0" } }, + "@types/react-router": { + "version": "5.1.20", + "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.20.tgz", + "integrity": "sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==", + "dev": true, + "requires": { + "@types/history": "^4.7.11", + "@types/react": "*" + } + }, + "@types/react-router-dom": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.3.3.tgz", + "integrity": "sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==", + "dev": true, + "requires": { + "@types/history": "^4.7.11", + "@types/react": "*", + "@types/react-router": "*" + } + }, "@types/resolve": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz", diff --git a/package.json b/package.json index 13410045..8ccc28e7 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "prod_build": "cross-env REACT_APP_FS_PROJ=prod REACT_APP_SERVER_TYPE=prod react-scripts build" }, "devDependencies": { + "@types/react-router-dom": "^5.3.3", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", "enzyme": "^3.11.0", From c240755646c2c7cb7006283228e1886646c8913f Mon Sep 17 00:00:00 2001 From: Nicholas Wang Date: Tue, 31 Oct 2023 17:13:06 -0700 Subject: [PATCH 2/2] convert ClassBox.js to ClassBox.tsx --- .../Classes/components/{ClassBox.js => ClassBox.tsx} | 11 ++++++++++- .../Classes/components/ConfirmLeaveModal.js | 1 - 2 files changed, 10 insertions(+), 2 deletions(-) rename src/components/Classes/components/{ClassBox.js => ClassBox.tsx} (85%) diff --git a/src/components/Classes/components/ClassBox.js b/src/components/Classes/components/ClassBox.tsx similarity index 85% rename from src/components/Classes/components/ClassBox.js rename to src/components/Classes/components/ClassBox.tsx index fac61497..672a0806 100644 --- a/src/components/Classes/components/ClassBox.js +++ b/src/components/Classes/components/ClassBox.tsx @@ -4,9 +4,18 @@ import React from 'react'; import { Link } from 'react-router-dom'; import '../../../styles/ClassBox.scss'; +interface ClassBoxProps { + deleteFunc: () => void; + img: string; + instructorString: string; + name: string; + redirFunc: () => void; + showLeaveButton: JSX.Element; +} + const ClassBox = function ({ deleteFunc, img, instructorString, name, redirFunc, showLeaveButton, -}) { +}: ClassBoxProps) { const leaveButton = showLeaveButton ? (