diff --git a/package-lock.json b/package-lock.json index 6f99005..f93c436 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1950,6 +1950,11 @@ "@types/node": "*" } }, + "@types/history": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/@types/history/-/history-4.7.8.tgz", + "integrity": "sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==" + }, "@types/html-minifier-terser": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz", @@ -2014,9 +2019,9 @@ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" }, "@types/node": { - "version": "14.14.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.31.tgz", - "integrity": "sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g==" + "version": "14.14.37", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", + "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -2053,6 +2058,25 @@ "csstype": "^3.0.2" } }, + "@types/react-router": { + "version": "5.1.13", + "resolved": "https://registry.npmjs.org/@types/react-router/-/react-router-5.1.13.tgz", + "integrity": "sha512-ZIuaO9Yrln54X6elg8q2Ivp6iK6p4syPsefEYAhRDAoqNh48C8VYUmB9RkXjKSQAJSJV0mbIFCX7I4vZDcHrjg==", + "requires": { + "@types/history": "*", + "@types/react": "*" + } + }, + "@types/react-router-dom": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/@types/react-router-dom/-/react-router-dom-5.1.7.tgz", + "integrity": "sha512-D5mHD6TbdV/DNHYsnwBTv+y73ei+mMjrkGrla86HthE4/PVvL1J94Bu3qABU+COXzpL23T1EZapVVpwHuBXiUg==", + "requires": { + "@types/history": "*", + "@types/react": "*", + "@types/react-router": "*" + } + }, "@types/react-transition-group": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.1.tgz", @@ -14097,6 +14121,11 @@ "is-typedarray": "^1.0.0" } }, + "typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==" + }, "uncontrollable": { "version": "7.2.1", "resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-7.2.1.tgz", diff --git a/package.json b/package.json index ca73daa..d1e99ed 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,9 @@ "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "@types/bootstrap": "^5.0.12", + "@types/node": "^14.14.37", + "@types/react": "^17.0.3", + "@types/react-router-dom": "^5.1.7", "bootstrap": "^4.6.0", "jquery": "^3.6.0", "popper.js": "^1.16.1", @@ -15,6 +18,7 @@ "react-dom": "^17.0.2", "react-router-dom": "^5.2.0", "react-scripts": "4.0.3", + "typescript": "^4.2.4", "web-vitals": "^1.0.1" }, "scripts": { diff --git a/src/App.js b/src/App.tsx similarity index 100% rename from src/App.js rename to src/App.tsx diff --git a/src/api.js b/src/api.js deleted file mode 100644 index 26b0ca0..0000000 --- a/src/api.js +++ /dev/null @@ -1,2 +0,0 @@ -const dev = process.env.NODE_ENV === 'development'; -export const API_ENDPOINT = 'http://localhost/api'; diff --git a/src/api.ts b/src/api.ts new file mode 100644 index 0000000..ce57768 --- /dev/null +++ b/src/api.ts @@ -0,0 +1,4 @@ +const dev = process.env.NODE_ENV === 'development'; +export const API_ENDPOINT = 'http://localhost/api'; +export const ION_AUTHORIZATION_ENDPOINT = + 'https://ion.tjhsst.edu/oauth/authorize?response_type=code&client_id=ScL9QdZ9m3iGmHG11uznwABg4ZSkabQJan05ZYsk&scope=read&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fauth%2Fion%2Fsuccess;'; diff --git a/src/components/CreatePool.js b/src/components/CreatePool.tsx similarity index 84% rename from src/components/CreatePool.js rename to src/components/CreatePool.tsx index 3f33c7a..04172e2 100644 --- a/src/components/CreatePool.js +++ b/src/components/CreatePool.tsx @@ -1,7 +1,7 @@ -import React from 'react'; +import { FormEventHandler } from 'react'; -const CreatePool = (props) => { - const onSubmit = (e) => { +const CreatePool = () => { + const onSubmit: FormEventHandler = (e) => { e.preventDefault(); fetch(`${process.env.REACT_APP_API_ENDPOINT}/createPool`) @@ -24,7 +24,7 @@ const CreatePool = (props) => {

Create Pool

-