From e7b28625e7db99ffa4c6b3bc06f81f9e20f620a2 Mon Sep 17 00:00:00 2001 From: fuhl <370419915@qq.com> Date: Mon, 17 Apr 2023 21:06:44 +0800 Subject: [PATCH] test --- app/components/home.tsx | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/app/components/home.tsx b/app/components/home.tsx index 9013d0c01..7b2fbe5d6 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -25,6 +25,8 @@ import dynamic from "next/dynamic"; import { REPO_URL } from "../constant"; import { ErrorBoundary } from "./error"; +import React, { useState } from "react"; + export function Loading(props: { noLogo?: boolean }) { return (
@@ -42,6 +44,36 @@ const ChatList = dynamic(async () => (await import("./chat-list")).ChatList, { loading: () => , }); +function PopUp({ onClose }) { + return ( +
+
+

这是一个可以关闭的弹框

+ +
+
+ ); +} + +export default function App() { + const [showPopUp, setShowPopUp] = useState(false); + + function handleOpen() { + setShowPopUp(true); + } + + function handleClose() { + setShowPopUp(false); + } + + return ( +
+ {showPopUp && } + +
+ ); +} + function useSwitchTheme() { const config = useChatStore((state) => state.config); @@ -204,7 +236,6 @@ function _Home() { shadow />
-