feat: 新增大量社区功能与基础组件,优化站点整体体验
- 新增事件总线式toast通知系统 - 新增头像、阅读进度、404/500错误页等基础组件 - 重构页脚、布局、分页、点赞按钮等现有组件 - 新增用户个人页、通知中心、帖子编辑/发布/置顶/推荐管理功能 - 优化登录注册页面样式与交互 - 修复路径类型文件引用,更新站点元信息与字体配置
This commit is contained in:
45
frontend/app/error.tsx
Normal file
45
frontend/app/error.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import Link from "next/link";
|
||||
import { CloudOff, RotateCcw } from "lucide-react";
|
||||
|
||||
export default function Error({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
useEffect(() => {
|
||||
console.error(error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<div className="max-w-md mx-auto text-center py-20 sm:py-28">
|
||||
<span
|
||||
className="inline-flex w-16 h-16 rounded-full items-center justify-center mb-6"
|
||||
style={{ background: "var(--clay-soft)", color: "var(--clay)" }}
|
||||
>
|
||||
<CloudOff size={30} />
|
||||
</span>
|
||||
<p className="text-[15px] font-extrabold tracking-wide mb-1" style={{ color: "var(--clay)" }}>
|
||||
500
|
||||
</p>
|
||||
<h1 className="text-2xl font-extrabold mb-2" style={{ color: "var(--ink)" }}>
|
||||
页面出了点问题
|
||||
</h1>
|
||||
<p className="text-sm mb-8" style={{ color: "var(--ink-2)" }}>
|
||||
可以重试,或先回首页看看其他内容
|
||||
</p>
|
||||
<div className="flex items-center justify-center gap-3">
|
||||
<button onClick={reset} className="btn btn-primary">
|
||||
<RotateCcw size={15} /> 重试
|
||||
</button>
|
||||
<Link href="/" className="btn btn-line">
|
||||
返回首页
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user