Skip to content

Commit

Permalink
Merge pull request #1514 from hngx-org/bug-fixes
Browse files Browse the repository at this point in the history
Explore Page reload Fix
  • Loading branch information
incredible-phoenix246 authored Dec 6, 2023
2 parents cb89950 + 7813c04 commit 6392830
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion modules/explore/explorePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const HomePage = () => {
allUsers = `${baseUrl}/explore/GetAllPortfolio`;

const pa = `?SortBy=1&Location=nigeria&Country=lagos&Provider=ee&Skill=ee&Track=ee&Ranking=ee&RoleId=1&Tag=a&PageSize=12&PageNumber=1`;

async function fetchUsers(query?: string) {
let url = allUsers;
if (query) {
Expand Down Expand Up @@ -81,8 +82,9 @@ const HomePage = () => {
const { data, isLoading } = useQuery<UserInfo>({
queryKey: ['profile', deBounce, filters, pageNumber],
queryFn: () => fetchUsers(searchQuery),
staleTime: 60000,
});
console.log(data);

return (
<main>
<Banner />
Expand Down
3 changes: 2 additions & 1 deletion modules/explore/hooks/deBounce.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { useEffect, useState } from 'react';

export default function useDebounce(value: string, delay: number) {
const [valueSearch, setValueSearch] = useState<string>();
const [valueSearch, setValueSearch] = useState<string>('');

useEffect(() => {
const handleSetTimeOut = setTimeout(() => {
setValueSearch(value);
}, delay);

return () => {
clearTimeout(handleSetTimeOut);
};
Expand Down

1 comment on commit 6392830

@vercel
Copy link

@vercel vercel bot commented on 6392830 Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

zuriportfolio-frontend – ./

zuriportfolio.vercel.app
zuriportfolio-frontend-git-dev-zuri-team.vercel.app
zuriportfolio-frontend-zuri-team.vercel.app

Please sign in to comment.