-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
70 additions
and
21 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,32 @@ | ||
import { TriggerSearch } from "@/components/TriggerSearch"; | ||
import { Button } from "@/components/ui/button"; | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import whereAmI from "../../public/where-am-i.gif"; | ||
|
||
export default function NotFound() { | ||
return ( | ||
<div> | ||
<h2>Not Found</h2> | ||
<p>Could not find requested resource</p> | ||
<Link href="/">Return Home</Link> | ||
<div className="h-full w-full flex flex-col lg:flex-row gap-8 md:gap-12 items-center sm:justify-center md:mt-[-100px] container"> | ||
<Image src={whereAmI} alt="Where am I?" className="rounded-md shadow" /> | ||
<main className="flex flex-col gap-4"> | ||
<h1 className="font-semibold text-6xl text-black dark:text-white"> | ||
Oops ! | ||
</h1> | ||
<div className="text-muted-foreground"> | ||
<p>La page que vous cherchez n'existe pas.</p> | ||
<p> | ||
Peut-être que vous avez mal tapé l'adresse ou que la page a été | ||
supprimée. | ||
</p> | ||
</div> | ||
<div className="space-x-2"> | ||
<Button asChild variant="secondary" className="w-max"> | ||
<Link href="/">Returner à l'accueil</Link> | ||
</Button> | ||
<span className="text-sm">ou</span> | ||
<TriggerSearch variant="secondary">Chercher une page</TriggerSearch> | ||
</div> | ||
</main> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
"use client"; | ||
import { searchStore } from "@/stores/search.store"; | ||
import { useStore } from "zustand"; | ||
import { Button, type ButtonProps } from "./ui/button"; | ||
|
||
export const TriggerSearch = ({ | ||
children, | ||
...props | ||
}: React.PropsWithChildren<ButtonProps>) => { | ||
const openSearch = useStore(searchStore, (state) => state.setOpen); | ||
|
||
return ( | ||
<Button {...props} type="button" onClick={() => openSearch(true)}> | ||
{children} | ||
</Button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { create } from "zustand"; | ||
|
||
interface SearchStore { | ||
open: boolean; | ||
toogleOpen: () => void; | ||
setOpen: (open: boolean) => void; | ||
} | ||
|
||
export const searchStore = create<SearchStore>((set) => ({ | ||
open: false, | ||
toogleOpen: () => set((state) => ({ open: !state.open })), | ||
setOpen: (open) => set({ open }), | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters