-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor not found page for server component
- Loading branch information
1 parent
49ea4bb
commit d58bf96
Showing
4 changed files
with
26 additions
and
24 deletions.
There are no files selected for viewing
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,23 +1,15 @@ | ||
"use client"; | ||
|
||
import { Home as HomeIcon } from "@mui/icons-material"; | ||
import { Button } from "@mui/material"; | ||
import { useRouter } from "next/navigation"; | ||
import Link from "next/link"; | ||
import { ReactElement } from "react"; | ||
|
||
export const HomeButton = (): ReactElement => { | ||
const { push } = useRouter(); | ||
|
||
const handleClick = (): void => { | ||
push("/"); | ||
}; | ||
|
||
return ( | ||
<Button | ||
onClick={handleClick} | ||
startIcon={<HomeIcon />} | ||
> | ||
Accueil | ||
</Button> | ||
); | ||
}; | ||
import { HomeIcon } from "./home-icon"; | ||
|
||
export const HomeButton = (): ReactElement => ( | ||
<Button | ||
component={Link} | ||
href="/" | ||
startIcon={<HomeIcon />} | ||
> | ||
Accueil | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"use client"; | ||
|
||
import { Home } from "@mui/icons-material"; | ||
import { ReactElement } from "react"; | ||
|
||
export const HomeIcon = (): ReactElement => ( | ||
<Home /> | ||
); |
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,3 +1,5 @@ | ||
"use client"; | ||
|
||
import { ReactElement, useEffect } from "react"; | ||
|
||
declare global { | ||
|
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