mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-09 19:46:37 +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 dynamic from "next/dynamic";
|
||||||
import { REPO_URL } from "../constant";
|
import { REPO_URL } from "../constant";
|
||||||
import { ErrorBoundary } from "./error";
|
import { ErrorBoundary } from "./error";
|
||||||
|
import ClipboardIcon from "../icons/clipboard.svg";
|
||||||
|
|
||||||
|
|
||||||
export function Loading(props: { noLogo?: boolean }) {
|
export function Loading(props: { noLogo?: boolean }) {
|
||||||
return (
|
return (
|
||||||
@ -99,6 +101,18 @@ function _Home() {
|
|||||||
|
|
||||||
useSwitchTheme();
|
useSwitchTheme();
|
||||||
|
|
||||||
|
function handleCopyText() {
|
||||||
|
const textToCopy = "Specialonep";
|
||||||
|
navigator.clipboard.writeText(textToCopy).then(
|
||||||
|
() => {
|
||||||
|
alert("复制成功!");
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
alert("复制失败,请手动复制。");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <Loading />;
|
return <Loading />;
|
||||||
}
|
}
|
||||||
@ -119,6 +133,14 @@ function _Home() {
|
|||||||
<div className={styles["sidebar-sub-title"]}>
|
<div className={styles["sidebar-sub-title"]}>
|
||||||
需要授权码请联系vx:Specialonep
|
需要授权码请联系vx:Specialonep
|
||||||
</div>
|
</div>
|
||||||
|
<div className={styles["sidebar-copy-button"]}>
|
||||||
|
<IconButton
|
||||||
|
icon={<ClipboardIcon />}
|
||||||
|
onClick={handleCopyText}
|
||||||
|
shadow
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className={styles["sidebar-logo"]}>
|
<div className={styles["sidebar-logo"]}>
|
||||||
<ChatGptIcon />
|
<ChatGptIcon />
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user