From d077c06d6316715085c928f58ef4aba42c3c7a09 Mon Sep 17 00:00:00 2001 From: Anton Herasymov Date: Tue, 10 Oct 2023 04:20:29 +0300 Subject: [PATCH] added no match result for search and fixed click on people --- src/api.ts | 2 +- src/components/Navbar.tsx | 8 +++++--- src/components/PageContent.tsx | 4 ++-- src/components/PeopleList.tsx | 4 +++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/api.ts b/src/api.ts index 03bd2e428..c799527b8 100644 --- a/src/api.ts +++ b/src/api.ts @@ -7,7 +7,7 @@ function wait(delay: number) { return new Promise(resolve => setTimeout(resolve, delay)); } -export function getPeople(): Promise { +export async function getPeople(): Promise { // keep this delay for testing purpose return wait(500) .then(() => fetch(API_URL)) diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 60670b466..ef4e67eff 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -1,13 +1,15 @@ import classNames from 'classnames'; -import { NavLink } from 'react-router-dom'; +import { NavLink, useSearchParams } from 'react-router-dom'; -export const NavBar = () => { +export const Navbar = () => { const getLinkClass = ( { isActive }: { isActive: boolean }, ) => classNames('navbar-item', { 'has-background-grey-lighter': isActive, }); + const [params] = useSearchParams(); + return (