REFACTOR: Update ResultsPage for when no results are found
This commit is contained in:
@@ -6,6 +6,7 @@ interface DynamicPageContentProps extends React.HTMLProps<HTMLDivElement> {
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
navbarVariant?: "home" | "no-navbar" | "default";
|
navbarVariant?: "home" | "no-navbar" | "default";
|
||||||
className?: string;
|
className?: string;
|
||||||
|
contentClassName?: string;
|
||||||
style?: React.CSSProperties;
|
style?: React.CSSProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ const DynamicPageContent: React.FC<DynamicPageContentProps> = ({
|
|||||||
children,
|
children,
|
||||||
navbarVariant = "default",
|
navbarVariant = "default",
|
||||||
className = "",
|
className = "",
|
||||||
|
contentClassName = "",
|
||||||
style,
|
style,
|
||||||
}) => {
|
}) => {
|
||||||
const { showSideBar } = useSidebar();
|
const { showSideBar } = useSidebar();
|
||||||
@@ -24,7 +26,7 @@ const DynamicPageContent: React.FC<DynamicPageContentProps> = ({
|
|||||||
id="content"
|
id="content"
|
||||||
className={`min-w-[850px] ${
|
className={`min-w-[850px] ${
|
||||||
showSideBar ? "w-[85vw] translate-x-[15vw]" : "w-[100vw]"
|
showSideBar ? "w-[85vw] translate-x-[15vw]" : "w-[100vw]"
|
||||||
} items-start transition-all duration-[500ms] ease-in-out`}
|
} items-start transition-all duration-[500ms] ease-in-out ${contentClassName}`}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -36,13 +36,14 @@ const ResultsPage: React.FC = ({}) => {
|
|||||||
<DynamicPageContent
|
<DynamicPageContent
|
||||||
id="results-page"
|
id="results-page"
|
||||||
navbarVariant="no-navbar"
|
navbarVariant="no-navbar"
|
||||||
className="flex flex-col items-center justify-evenly min-h-[70vh] my-[15vh] p-4"
|
className="flex flex-col items-stretch justify-stretch h-[70vh] my-[15vh] p-4"
|
||||||
|
contentClassName="flex flex-col items-center h-full p-4"
|
||||||
>
|
>
|
||||||
<h1 className="text-3xl font-bold mb-4">
|
<h1 className="text-3xl font-bold mb-4">
|
||||||
Search results for "{query}"
|
Search results for "{query}"
|
||||||
</h1>
|
</h1>
|
||||||
<SearchBar value={query} />
|
<SearchBar value={query} />
|
||||||
<h3 className="text-2xl text-gray-400">Nothing Found</h3>
|
<h3 className="flex items-center flex-grow text-2xl text-gray-400">Nothing Found</h3>
|
||||||
<div className="flex gap-8">
|
<div className="flex gap-8">
|
||||||
<Button onClick={() => navigate(-1)}>Go Back</Button>
|
<Button onClick={() => navigate(-1)}>Go Back</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user