From e27d460b1689d20f793f8db9ca1cf710825387b0 Mon Sep 17 00:00:00 2001 From: Bridger Thompson Date: Tue, 19 Sep 2023 17:02:44 -0600 Subject: [PATCH 1/2] talking to api --- src/v2/client/package-lock.json | 56 +++++++++++++++++++ src/v2/client/package.json | 1 + src/v2/client/src/components/NavBar.tsx | 2 +- src/v2/client/src/components/Spinner.scss | 43 ++++++++++++++ src/v2/client/src/components/Spinner.tsx | 9 +++ src/v2/client/src/models/Donation.ts | 9 +++ src/v2/client/src/models/Event.ts | 11 ++++ .../client/src/pages/home/DonationProgess.tsx | 33 +++++++++++ src/v2/client/src/pages/home/Home.tsx | 31 ++++++---- .../src/pages/home/UpcomingEventsModal.tsx | 23 ++++++-- src/v2/client/src/pages/home/homeHooks.ts | 24 ++++++++ src/v2/client/src/pages/home/homeService.ts | 16 ++++++ src/v2/client/src/setupProxy.js | 10 ++++ src/v2/client/tsconfig.json | 5 +- 14 files changed, 252 insertions(+), 21 deletions(-) create mode 100644 src/v2/client/src/components/Spinner.scss create mode 100644 src/v2/client/src/components/Spinner.tsx create mode 100644 src/v2/client/src/models/Donation.ts create mode 100644 src/v2/client/src/models/Event.ts create mode 100644 src/v2/client/src/pages/home/DonationProgess.tsx create mode 100644 src/v2/client/src/pages/home/homeHooks.ts create mode 100644 src/v2/client/src/pages/home/homeService.ts create mode 100644 src/v2/client/src/setupProxy.js diff --git a/src/v2/client/package-lock.json b/src/v2/client/package-lock.json index 5717fd11..937f6ee6 100644 --- a/src/v2/client/package-lock.json +++ b/src/v2/client/package-lock.json @@ -18,6 +18,7 @@ "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "@types/react-query": "^1.2.9", + "axios": "^1.5.0", "bootstrap": "^5.3.1", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -5121,6 +5122,29 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", + "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/axobject-query": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", @@ -14297,6 +14321,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -21363,6 +21392,28 @@ "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.8.1.tgz", "integrity": "sha512-9l850jDDPnKq48nbad8SiEelCv4OrUWrKab/cPj0GScVg6cb6NbCCt/Ulk26QEq5jP9NnGr04Bit1BHyV6r5CQ==" }, + "axios": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", + "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + }, + "dependencies": { + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, "axobject-query": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", @@ -27833,6 +27884,11 @@ } } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", diff --git a/src/v2/client/package.json b/src/v2/client/package.json index 8cd902fa..a90caf4c 100644 --- a/src/v2/client/package.json +++ b/src/v2/client/package.json @@ -13,6 +13,7 @@ "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "@types/react-query": "^1.2.9", + "axios": "^1.5.0", "bootstrap": "^5.3.1", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/src/v2/client/src/components/NavBar.tsx b/src/v2/client/src/components/NavBar.tsx index 933ee5f5..fc2882ed 100644 --- a/src/v2/client/src/components/NavBar.tsx +++ b/src/v2/client/src/components/NavBar.tsx @@ -2,7 +2,7 @@ import { Link } from "react-router-dom" export const NavBar = () => { return ( -