Skip to content

Commit

Permalink
fix: not-found route segment
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Apr 23, 2024
1 parent 280fe3d commit 5b73dc9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/app/404.tsx

This file was deleted.

20 changes: 20 additions & 0 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 1,20 @@
/* eslint-disable react/display-name */
import { NotFound404 } from '~/components/common/404'
import { StyledButton } from '~/components/ui/button'
import { sansFont } from '~/lib/fonts'

export default () => {
return (
<html>
<body className={`${sansFont.variable} m-0 h-full p-0 font-sans`}>
<div data-theme>
<NotFound404>
<StyledButton>
<a href="/">返回首页</a>
</StyledButton>
</NotFound404>
</div>
</body>
</html>
)
}
3 changes: 2 additions & 1 deletion src/components/common/404.tsx
Original file line number Diff line number Diff line change
@@ -1,10 1,11 @@
/* eslint-disable react/no-unknown-property */
export const NotFound404 = () => {
export const NotFound404: Component = ({ children }) => {
return (
<div className="min-h-[500px]">
<div className="fixed inset-0 flex flex-col space-y-6 center">
<$404SVG className="size-[400px]" />
<p>这颗星球还没有知识哦,去其他地方探索吧</p>
{children}
</div>
</div>
)
Expand Down

0 comments on commit 5b73dc9

Please sign in to comment.