新增提示Toast组件

This commit is contained in:
2025-04-21 09:22:13 +08:00
parent 01d93522b8
commit 5c2c367856
36 changed files with 2609 additions and 478 deletions
+13 -3
View File
@@ -12,9 +12,13 @@ import {
} from "@remix-run/react";
import { Layout } from "~/components/layout/Layout";
import { ErrorBoundary as AppErrorBoundary } from "~/components/error/ErrorBoundary";
import { MessageModalProvider } from "~/components/ui/MessageModal";
import { ToastProvider } from "~/components/ui/Toast";
import "remixicon/fonts/remixicon.css";
// 导入样式
import styles from "~/styles/main.css?url";
import messageModalStyles from "~/styles/components/message-modal.css?url";
import toastStyles from "~/styles/components/toast.css?url";
// 添加客户端hydration错误处理
// if (typeof window !== "undefined") {
@@ -43,6 +47,8 @@ export const meta: MetaFunction = () => {
export function links() {
return [
{ rel: "stylesheet", href: styles },
{ rel: "stylesheet", href: messageModalStyles },
{ rel: "stylesheet", href: toastStyles },
// { rel: "preconnect", href: "https://fonts.googleapis.com" },
// { rel: "preconnect", href: "https://fonts.gstatic.com", crossOrigin: "anonymous" },
// { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap" }
@@ -72,9 +78,13 @@ export default function App() {
<Links />
</head>
<body className="font-sans">
<Layout>
<Outlet />
</Layout>
<MessageModalProvider>
<ToastProvider>
<Layout>
<Outlet />
</Layout>
</ToastProvider>
</MessageModalProvider>
<ScrollRestoration />
<Scripts />
</body>