This commit is contained in:
fuhl 2023-04-17 21:06:44 +08:00
parent 800d8a9f22
commit e7b28625e7

View File

@ -25,6 +25,8 @@ import dynamic from "next/dynamic";
import { REPO_URL } from "../constant"; import { REPO_URL } from "../constant";
import { ErrorBoundary } from "./error"; import { ErrorBoundary } from "./error";
import React, { useState } from "react";
export function Loading(props: { noLogo?: boolean }) { export function Loading(props: { noLogo?: boolean }) {
return ( return (
<div className={styles["loading-content"]}> <div className={styles["loading-content"]}>
@ -42,6 +44,36 @@ const ChatList = dynamic(async () => (await import("./chat-list")).ChatList, {
loading: () => <Loading noLogo />, loading: () => <Loading noLogo />,
}); });
function PopUp({ onClose }) {
return (
<div className="popup">
<div className="popup-content">
<h1></h1>
<button onClick={onClose}></button>
</div>
</div>
);
}
export default function App() {
const [showPopUp, setShowPopUp] = useState(false);
function handleOpen() {
setShowPopUp(true);
}
function handleClose() {
setShowPopUp(false);
}
return (
<div className="app">
{showPopUp && <PopUp onClose={handleClose} />}
<button onClick={handleOpen}></button>
</div>
);
}
function useSwitchTheme() { function useSwitchTheme() {
const config = useChatStore((state) => state.config); const config = useChatStore((state) => state.config);
@ -204,7 +236,6 @@ function _Home() {
shadow shadow
/> />
</div> </div>
</div> </div>
<div> <div>
<IconButton <IconButton