Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:UCF/campus-map-react into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramin Farhadi authored and Ramin Farhadi committed Aug 23, 2024
2 parents 8a1f624 + 3f48b05 commit 6e88816
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 22 deletions.
11 changes: 1 addition & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"sass": "^1.76.0"
},
"devDependencies": {
"@types/lodash.debounce": "^4.0.9",
"@types/lodash": "^4.17.7",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function App() {

const debouncedResults = useMemo(() => {
return debounce(searchData, 300);
}, [searchResults]);
}, [searchResults, buildingPointData]);

const campusHandler = (campus: Campus) => {
mapRef.current!.flyTo({
Expand Down
12 changes: 2 additions & 10 deletions src/components/SearchResults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,15 @@ interface SearchResultsProps {

export default function SearchResults(props: SearchResultsProps) {
const [searchQuery, setSearchQuery] = useState<string>('');
const [debouncedSearchQuery, setDebouncedSearchQuery] = useState<string>('');
const [searchBoxVisibility,setSearchBoxVisibility] = useState<boolean>(false);

useEffect(() => {
const delaySearchQueryTimeOutId = setTimeout(() => {
setDebouncedSearchQuery(searchQuery);
}, 500);
return () => clearTimeout(delaySearchQueryTimeOutId);
}, [searchQuery, 500])

useEffect(() => {
ReactGA.event({
category: "map_search",
action: "search",
label: `${debouncedSearchQuery}`,
label: `${searchQuery}`,
});
},[debouncedSearchQuery])
},[searchQuery])

// useEffect(() => {

Expand Down

0 comments on commit 6e88816

Please sign in to comment.