From 6ae978a3921a77b9d2d24c45b2ad70977a8beeb0 Mon Sep 17 00:00:00 2001 From: Jim Barnes Date: Mon, 2 Feb 2026 13:05:10 -0500 Subject: [PATCH 1/4] Added font awesome icons and cleaned up location results --- ...ure-static-web-apps-icy-tree-070bd9f0f.yml | 1 + .npmrc | 3 + package-lock.json | 57 ++++++++++++++++++- package.json | 2 + src/components/LocationResults.scss | 14 +++++ src/components/LocationResults.tsx | 27 ++++++--- 6 files changed, 94 insertions(+), 10 deletions(-) create mode 100644 .npmrc diff --git a/.github/workflows/azure-static-web-apps-icy-tree-070bd9f0f.yml b/.github/workflows/azure-static-web-apps-icy-tree-070bd9f0f.yml index 1c571f4..4f135f6 100644 --- a/.github/workflows/azure-static-web-apps-icy-tree-070bd9f0f.yml +++ b/.github/workflows/azure-static-web-apps-icy-tree-070bd9f0f.yml @@ -24,6 +24,7 @@ jobs: VITE_SEARCH_ENGINE_ID: ${{ vars.VITE_SEARCH_ENGINE_ID }} VITE_MAP_SEARCH_URL: ${{ vars.VITE_MAP_SEARCH_URL }} VITE_MYUCF_API_URL: ${{ vars.VITE_MYUCF_API_URL }} + FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }} name: Build and Deploy Job steps: - uses: actions/checkout@v3 diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..4497d5a --- /dev/null +++ b/.npmrc @@ -0,0 +1,3 @@ +@awesome.me:registry=https://npm.fontawesome.com/ +@fortawesome:registry=https://npm.fontawesome.com/ +//npm.fontawesome.com/:_authToken=${FONTAWESOME_NPM_AUTH_TOKEN} diff --git a/package-lock.json b/package-lock.json index 59ce485..b502406 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,15 @@ { "name": "ucf-search", - "version": "0.0.0", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ucf-search", - "version": "0.0.0", + "version": "1.0.0", "dependencies": { + "@awesome.me/kit-850d323291": "^1.0.4", + "@fortawesome/react-fontawesome": "^3.1.1", "react": "^19.1.1", "react-dom": "^19.1.1", "react-router-dom": "^7.9.4", @@ -27,6 +29,22 @@ "typescript": "~5.9.3", "typescript-eslint": "^8.45.0", "vite": "^7.1.7" + }, + "engines": { + "node": ">=22.0.0", + "npm": ">10.0.0" + } + }, + "node_modules/@awesome.me/kit-850d323291": { + "version": "1.0.4", + "resolved": "https://npm.fontawesome.com/@awesome.me/kit-850d323291/-/kit-850d323291-1.0.4.tgz", + "integrity": "sha512-sZLsLrs+5//IMDi9qO6iga17IaG/i6fAPG4JyonyPFD1pGiTQpfuE+FVOJDw0sG1ikN9sIKbpIxcw28yEBzmHg==", + "license": "UNLICENSED", + "dependencies": { + "@fortawesome/fontawesome-common-types": "^7.0.0" + }, + "engines": { + "node": ">=16" } }, "node_modules/@babel/code-frame": { @@ -910,6 +928,41 @@ "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, + "node_modules/@fortawesome/fontawesome-common-types": { + "version": "7.1.0", + "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-7.1.0.tgz", + "integrity": "sha512-l/BQM7fYntsCI//du+6sEnHOP6a74UixFyOYUyz2DLMXKx+6DEhfR3F2NYGE45XH1JJuIamacb4IZs9S0ZOWLA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/@fortawesome/fontawesome-svg-core": { + "version": "7.1.0", + "resolved": "https://npm.fontawesome.com/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-7.1.0.tgz", + "integrity": "sha512-fNxRUk1KhjSbnbuBxlWSnBLKLBNun52ZBTcs22H/xEEzM6Ap81ZFTQ4bZBxVQGQgVY0xugKGoRcCbaKjLQ3XZA==", + "license": "MIT", + "peer": true, + "dependencies": { + "@fortawesome/fontawesome-common-types": "7.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@fortawesome/react-fontawesome": { + "version": "3.1.1", + "resolved": "https://npm.fontawesome.com/@fortawesome/react-fontawesome/-/react-fontawesome-3.1.1.tgz", + "integrity": "sha512-EDllr9hpodc21odmUywHS1alXNiCd4E8sp5GJ5s7wYINz8vSmMiNWpALTiuYODb865YyQ/NlyiN4mbXp7HCNqg==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@fortawesome/fontawesome-svg-core": "~6 || ~7", + "react": "^18.0.0 || ^19.0.0" + } + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", diff --git a/package.json b/package.json index 4c15fdd..37ed2da 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,8 @@ "preview": "vite preview" }, "dependencies": { + "@awesome.me/kit-850d323291": "^1.0.4", + "@fortawesome/react-fontawesome": "^3.1.1", "react": "^19.1.1", "react-dom": "^19.1.1", "react-router-dom": "^7.9.4", diff --git a/src/components/LocationResults.scss b/src/components/LocationResults.scss index e69de29..2ba0da0 100644 --- a/src/components/LocationResults.scss +++ b/src/components/LocationResults.scss @@ -0,0 +1,14 @@ +.location-result-heading { + border-bottom: 1px solid #ccc; + font-size: 1.25rem; + font-weight: 400; + padding-bottom: 1rem; +} + +.location-heading { + font-size: .95rem; +} + +.sidebar-result a { + font-size: .8rem; +} diff --git a/src/components/LocationResults.tsx b/src/components/LocationResults.tsx index 997b053..e3a6f07 100644 --- a/src/components/LocationResults.tsx +++ b/src/components/LocationResults.tsx @@ -3,6 +3,9 @@ import './LocationResults.scss' import { SearchQueryContext } from '../SearchContext'; import type { LocationResultSet } from '../types/LocationTypes'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { byPrefixAndName } from '@awesome.me/kit-850d323291/icons'; + const MAP_SEARCH_URL = import.meta.env.VITE_MAP_SEARCH_URL; function LocationResults() { @@ -42,17 +45,25 @@ function LocationResults() { {typeof locationResults !== 'undefined' ? (
{locationResults.results.locations.length > 0 && locationResults.results.locations.map((loc) => { -

Locations

return ( -
-

{loc.name}

-
-
- More Information - Directions + <> +

+ Locations +

+ -
+ ) })}
From cc521c216a3d26d8242b2b208cbf84cb9d5c29d9 Mon Sep 17 00:00:00 2001 From: Jim Barnes Date: Mon, 2 Feb 2026 14:26:18 -0500 Subject: [PATCH 2/4] Removed three character minimum and refactored empty search logic --- src/components/LocationResults.tsx | 4 ++-- src/components/SearchBar.tsx | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/LocationResults.tsx b/src/components/LocationResults.tsx index e3a6f07..04f7e22 100644 --- a/src/components/LocationResults.tsx +++ b/src/components/LocationResults.tsx @@ -46,7 +46,7 @@ function LocationResults() {
{locationResults.results.locations.length > 0 && locationResults.results.locations.map((loc) => { return ( - <> +

Locations

@@ -63,7 +63,7 @@ function LocationResults() {
- +
) })} diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx index b3bcfc9..1f74e73 100644 --- a/src/components/SearchBar.tsx +++ b/src/components/SearchBar.tsx @@ -39,15 +39,16 @@ function SearchBar() { } debounceTimerRef.current = setTimeout(() => { - if (element.value.length < 3) { - setSearchParams(); + if (element.value === "") { searchElement.clearAllResults(); + setSearchParams({}); + } else { + setSearchParams({ + q: element.value + }); } setSearchQuery(element.value); - setSearchParams({ - q: element.value !== "" ? element.value : "" - }); searchElement.execute(); From c27528502aa627a19c8bb1eec0db94a0a50f3178 Mon Sep 17 00:00:00 2001 From: Jim Barnes Date: Mon, 2 Feb 2026 14:41:13 -0500 Subject: [PATCH 3/4] Changed script loading from async to defer --- src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index da98407..a93cdbc 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,7 +14,7 @@ function App() { useEffect(() => { const script = document.createElement('script'); script.src = `https://cse.google.com/cse.js?cx=${SEARCH_ENGINE_ID}`; - script.async = true; + script.defer = true; document.body.appendChild(script); }, []); From 9a8a2ed5352c87dee0a8183ef73518b8ba3f78e9 Mon Sep 17 00:00:00 2001 From: Jim Barnes Date: Thu, 5 Feb 2026 09:52:18 -0500 Subject: [PATCH 4/4] Show nothing when there are no location results --- src/components/LocationResults.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/LocationResults.tsx b/src/components/LocationResults.tsx index 04f7e22..c5ae3d3 100644 --- a/src/components/LocationResults.tsx +++ b/src/components/LocationResults.tsx @@ -42,7 +42,7 @@ function LocationResults() { return (
- {typeof locationResults !== 'undefined' ? ( + {typeof locationResults !== 'undefined' && (
{locationResults.results.locations.length > 0 && locationResults.results.locations.map((loc) => { return ( @@ -67,7 +67,7 @@ function LocationResults() { ) })}
- ): (

No Results for "{searchQuery}".

)} + )}
) }