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/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); }, []); 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..c5ae3d3 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() { @@ -39,24 +42,32 @@ function LocationResults() { return (
- {typeof locationResults !== 'undefined' ? ( + {typeof locationResults !== 'undefined' && (
{locationResults.results.locations.length > 0 && locationResults.results.locations.map((loc) => { -

Locations

return ( -
-

{loc.name}

-
-
- More Information - Directions +
+

+ Locations +

+
) })}
- ): (

No Results for "{searchQuery}".

)} + )}
) } 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();