From fa2b89ce3789cc462d82b84deba29092f3cfcc5f Mon Sep 17 00:00:00 2001 From: Dorbmon Date: Wed, 25 Dec 2024 14:31:28 +0800 Subject: [PATCH] feat: toast --- app/components/chat.tsx | 7 +++++-- package.json | 1 + yarn.lock | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/components/chat.tsx b/app/components/chat.tsx index 51fe74fe7..8e52f9233 100644 --- a/app/components/chat.tsx +++ b/app/components/chat.tsx @@ -8,7 +8,7 @@ import React, { Fragment, RefObject, } from "react"; - +import { toast } from "react-toastify"; import SendWhiteIcon from "../icons/send-white.svg"; import BrainIcon from "../icons/brain.svg"; import RenameIcon from "../icons/rename.svg"; @@ -2041,7 +2041,10 @@ function _Chat() { text={Locale.Chat.Send} className={styles["chat-input-send"]} type="primary" - onClick={() => doSubmit(userInput)} + onClick={() => { + toast("刘子阳真是爱江晨成!!!"); + doSubmit(userInput); + }} /> diff --git a/package.json b/package.json index 1d8612e80..83499d888 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "react-dom": "^18.2.0", "react-markdown": "^8.0.7", "react-router-dom": "^6.15.0", + "react-toastify": "^11.0.2", "rehype-highlight": "^6.0.0", "rehype-katex": "^6.0.3", "remark-breaks": "^3.0.2", diff --git a/yarn.lock b/yarn.lock index 004dbf893..fa86dd97a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7204,6 +7204,13 @@ react-router@6.15.0: dependencies: "@remix-run/router" "1.8.0" +react-toastify@^11.0.2: + version "11.0.2" + resolved "https://registry.yarnpkg.com/react-toastify/-/react-toastify-11.0.2.tgz#5c5ae745f3c7240015a8746217595cd26701fdc3" + integrity sha512-GjHuGaiXMvbls3ywqv8XdWONwrcO4DXCJIY1zVLkHU73gEElKvTTXNI5Vom3s/k/M8hnkrfsqgBSX3OwmlonbA== + dependencies: + clsx "^2.1.1" + react@^18.2.0: version "18.2.0" resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"