This commit is contained in:
sijinhui 2024-08-21 23:36:30 +08:00
parent dd884acab3
commit 9ccf8550b0
7 changed files with 64 additions and 31 deletions

View File

@ -1480,7 +1480,7 @@ function _Chat() {
color={"var(--second)"} color={"var(--second)"}
placement="bottom" placement="bottom"
> >
使 {Locale.Chat.UseTip}
<Progress <Progress
percent={ percent={
(parseInt(localStorage.getItem("current_day_token") ?? "0") / (parseInt(localStorage.getItem("current_day_token") ?? "0") /

View File

@ -124,6 +124,7 @@ export function PreCode(props: { children: any }) {
}); });
setTimeout(renderArtifacts, 1); setTimeout(renderArtifacts, 1);
} }
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []); }, []);
return ( return (

View File

@ -65,6 +65,7 @@ export function SearchChatPage() {
results.sort((a, b) => b.content.length - a.content.length); results.sort((a, b) => b.content.length - a.content.length);
return results; return results;
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []); }, []);
useEffect(() => { useEffect(() => {

View File

@ -1378,21 +1378,21 @@ export function Settings() {
</Select> </Select>
</ListItem> </ListItem>
{/*<ListItem title={Locale.Settings.Lang.Name}>*/} <ListItem title={Locale.Settings.Lang.Name}>
{/* <Select*/} <Select
{/* aria-label={Locale.Settings.Lang.Name}*/} aria-label={Locale.Settings.Lang.Name}
{/* value={getLang()}*/} value={getLang()}
{/* onChange={(e) => {*/} onChange={(e) => {
{/* changeLang(e.target.value as any);*/} changeLang(e.target.value as any);
{/* }}*/} }}
{/* >*/} >
{/* {AllLangs.map((lang) => (*/} {AllLangs.map((lang) => (
{/* <option value={lang} key={lang}>*/} <option value={lang} key={lang}>
{/* {ALL_LANG_OPTIONS[lang]}*/} {ALL_LANG_OPTIONS[lang]}
{/* </option>*/} </option>
{/* ))}*/} ))}
{/* </Select>*/} </Select>
{/*</ListItem>*/} </ListItem>
<ListItem <ListItem
title={Locale.Settings.FontSize.Title} title={Locale.Settings.FontSize.Title}

View File

@ -15,6 +15,7 @@ import DragIcon from "../icons/drag.svg";
import DiscoveryIcon from "../icons/discovery.svg"; import DiscoveryIcon from "../icons/discovery.svg";
import Locale from "../locales"; import Locale from "../locales";
import { getLang } from "../locales";
import { useAppConfig, useChatStore } from "../store"; import { useAppConfig, useChatStore } from "../store";
@ -248,6 +249,38 @@ export function SideBar(props: { className?: string }) {
chatStore.currentSession().mask.modelConfig?.providerName || chatStore.currentSession().mask.modelConfig?.providerName ||
ServiceProvider.OpenAI; ServiceProvider.OpenAI;
const lange = getLang();
const SideBarHeaderTextSubtitle: React.ReactNode = useMemo(() => {
if (lange === "en") {
return (
<span>
{" "}
Choose Your Own Assistant
<br /> <br />
{/* eslint-disable-next-line react/no-unescaped-entities */}
1. Sometimes it might act up a bit. Click <b>New Chat</b> below to try
again. <br /> 2. For drawing: Generate images with the format "/mj
prompt" (you can look up tools or methods for using MidJourney
prompts). <br /> 3. If you find it helpful, consider buying the author
a coffee.
</span>
);
}
return (
<span>
<br />
<br />
1. <b></b><b></b>
<br />
2. /mj
midjourney的提示词工具或使用方法
<br />
3.
</span>
);
}, [lange]);
return ( return (
<SideBarContainer <SideBarContainer
onDragStart={onDragStart} onDragStart={onDragStart}
@ -255,26 +288,14 @@ export function SideBar(props: { className?: string }) {
{...props} {...props}
> >
<SideBarHeader <SideBarHeader
title="这里开始……" title={Locale.SideBarHeader.Title}
subTitle={ subTitle={SideBarHeaderTextSubtitle}
<span>
<br />
<br />
1. <b></b><b></b>
<br />
2. /mj
midjourney的提示词工具或使用方法
<br />
3.
</span>
}
logo={<ChatGptIcon />} logo={<ChatGptIcon />}
> >
<div className={styles["sidebar-header-bar"]}> <div className={styles["sidebar-header-bar"]}>
<IconButton <IconButton
icon={<CoffeeIcon />} icon={<CoffeeIcon />}
text={shouldNarrow ? undefined : "赏杯咖啡️"} text={shouldNarrow ? undefined : Locale.SideBarHeader.Coffee}
className={styles["sidebar-bar-button"]} className={styles["sidebar-bar-button"]}
onClick={() => navigate(Path.Reward)} onClick={() => navigate(Path.Reward)}
shadow shadow

View File

@ -58,10 +58,15 @@ const cn = {
ImageAgentOpenTip: ImageAgentOpenTip:
"开启之后返回的Midjourney图片将会通过本程序自身代理所以本程序需要处于可以访问cdn.discordapp.com的网络环境中才有效", "开启之后返回的Midjourney图片将会通过本程序自身代理所以本程序需要处于可以访问cdn.discordapp.com的网络环境中才有效",
}, },
SideBarHeader: {
Title: "这里开始……",
Coffee: "赏杯咖啡",
},
ChatItem: { ChatItem: {
ChatItemCount: (count: number) => `${count} 条对话`, ChatItemCount: (count: number) => `${count} 条对话`,
}, },
Chat: { Chat: {
UseTip: "当天使用:",
SubTitle: (count: number) => `${count} 条对话`, SubTitle: (count: number) => `${count} 条对话`,
EditMessage: { EditMessage: {
Title: "编辑消息记录", Title: "编辑消息记录",

View File

@ -60,10 +60,15 @@ const en: LocaleType = {
ImageAgentOpenTip: ImageAgentOpenTip:
"After turning it on, the returned Midjourney image will be proxied by this program itself, so this program needs to be in a network environment that can access cdn.discordapp.com to be effective", "After turning it on, the returned Midjourney image will be proxied by this program itself, so this program needs to be in a network environment that can access cdn.discordapp.com to be effective",
}, },
SideBarHeader: {
Title: "Start Here...",
Coffee: "Coffee please",
},
ChatItem: { ChatItem: {
ChatItemCount: (count: number) => `${count} messages`, ChatItemCount: (count: number) => `${count} messages`,
}, },
Chat: { Chat: {
UseTip: "day use",
SubTitle: (count: number) => `${count} messages`, SubTitle: (count: number) => `${count} messages`,
EditMessage: { EditMessage: {
Title: "Edit All Messages", Title: "Edit All Messages",