mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-09 03:26:38 +08:00
Update home.tsx
This commit is contained in:
parent
c74f150b2f
commit
a5c118ed83
@ -25,6 +25,8 @@ import { Chat } from "./chat";
|
||||
import dynamic from "next/dynamic";
|
||||
import { REPO_URL } from "../constant";
|
||||
import { ErrorBoundary } from "./error";
|
||||
import ClipboardIcon from "../icons/clipboard.svg";
|
||||
|
||||
|
||||
export function Loading(props: { noLogo?: boolean }) {
|
||||
return (
|
||||
@ -98,6 +100,18 @@ function _Home() {
|
||||
const config = useChatStore((state) => state.config);
|
||||
|
||||
useSwitchTheme();
|
||||
|
||||
function handleCopyText() {
|
||||
const textToCopy = "Specialonep";
|
||||
navigator.clipboard.writeText(textToCopy).then(
|
||||
() => {
|
||||
alert("复制成功!");
|
||||
},
|
||||
(err) => {
|
||||
alert("复制失败,请手动复制。");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return <Loading />;
|
||||
@ -119,6 +133,14 @@ function _Home() {
|
||||
<div className={styles["sidebar-sub-title"]}>
|
||||
需要授权码请联系vx:Specialonep
|
||||
</div>
|
||||
<div className={styles["sidebar-copy-button"]}>
|
||||
<IconButton
|
||||
icon={<ClipboardIcon />}
|
||||
onClick={handleCopyText}
|
||||
shadow
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={styles["sidebar-logo"]}>
|
||||
<ChatGptIcon />
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user