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)"}
placement="bottom"
>
使
{Locale.Chat.UseTip}
<Progress
percent={
(parseInt(localStorage.getItem("current_day_token") ?? "0") /

View File

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

View File

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

View File

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

View File

@ -15,6 +15,7 @@ import DragIcon from "../icons/drag.svg";
import DiscoveryIcon from "../icons/discovery.svg";
import Locale from "../locales";
import { getLang } from "../locales";
import { useAppConfig, useChatStore } from "../store";
@ -248,15 +249,24 @@ export function SideBar(props: { className?: string }) {
chatStore.currentSession().mask.modelConfig?.providerName ||
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 (
<SideBarContainer
onDragStart={onDragStart}
shouldNarrow={shouldNarrow}
{...props}
>
<SideBarHeader
title="这里开始……"
subTitle={
<span>
<br />
@ -268,13 +278,24 @@ export function SideBar(props: { className?: string }) {
<br />
3.
</span>
}
);
}, [lange]);
return (
<SideBarContainer
onDragStart={onDragStart}
shouldNarrow={shouldNarrow}
{...props}
>
<SideBarHeader
title={Locale.SideBarHeader.Title}
subTitle={SideBarHeaderTextSubtitle}
logo={<ChatGptIcon />}
>
<div className={styles["sidebar-header-bar"]}>
<IconButton
icon={<CoffeeIcon />}
text={shouldNarrow ? undefined : "赏杯咖啡️"}
text={shouldNarrow ? undefined : Locale.SideBarHeader.Coffee}
className={styles["sidebar-bar-button"]}
onClick={() => navigate(Path.Reward)}
shadow

View File

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

View File

@ -60,10 +60,15 @@ const en: LocaleType = {
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",
},
SideBarHeader: {
Title: "Start Here...",
Coffee: "Coffee please",
},
ChatItem: {
ChatItemCount: (count: number) => `${count} messages`,
},
Chat: {
UseTip: "day use",
SubTitle: (count: number) => `${count} messages`,
EditMessage: {
Title: "Edit All Messages",