commit
56ef8e3ebf
@ -725,6 +725,7 @@ export function Chat() {
|
|||||||
}}
|
}}
|
||||||
fontSize={fontSize}
|
fontSize={fontSize}
|
||||||
parentRef={scrollRef}
|
parentRef={scrollRef}
|
||||||
|
defaultShow={i >= messages.length - 10}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{!isUser && !message.preview && (
|
{!isUser && !message.preview && (
|
||||||
|
@ -62,11 +62,12 @@ export function Markdown(
|
|||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
fontSize?: number;
|
fontSize?: number;
|
||||||
parentRef: RefObject<HTMLDivElement>;
|
parentRef: RefObject<HTMLDivElement>;
|
||||||
|
defaultShow?: boolean;
|
||||||
} & React.DOMAttributes<HTMLDivElement>,
|
} & React.DOMAttributes<HTMLDivElement>,
|
||||||
) {
|
) {
|
||||||
const mdRef = useRef<HTMLDivElement>(null);
|
const mdRef = useRef<HTMLDivElement>(null);
|
||||||
const renderedHeight = useRef(0);
|
const renderedHeight = useRef(0);
|
||||||
const inView = useRef(false);
|
const inView = useRef(!!props.defaultShow);
|
||||||
|
|
||||||
const parent = props.parentRef.current;
|
const parent = props.parentRef.current;
|
||||||
const md = mdRef.current;
|
const md = mdRef.current;
|
||||||
@ -90,15 +91,6 @@ export function Markdown(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
if (!inView.current) {
|
|
||||||
checkInView();
|
|
||||||
}
|
|
||||||
}, 30);
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
checkInView();
|
checkInView();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,16 +1,4 @@
|
|||||||
@import "../styles/animation.scss";
|
@import "../styles/animation.scss";
|
||||||
|
|
||||||
@keyframes search-in {
|
|
||||||
from {
|
|
||||||
opacity: 0;
|
|
||||||
transform: translateY(5vh) scaleX(0.5);
|
|
||||||
}
|
|
||||||
to {
|
|
||||||
opacity: 1;
|
|
||||||
transform: translateY(0) scaleX(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.mask-page {
|
.mask-page {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -23,8 +11,9 @@
|
|||||||
.mask-filter {
|
.mask-filter {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 20px;
|
||||||
animation: search-in ease 0.3s;
|
animation: slide-in ease 0.3s;
|
||||||
|
height: 40px;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
@ -32,8 +21,6 @@
|
|||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
margin-bottom: 20px;
|
|
||||||
animation: search-in ease 0.3s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.mask-filter-lang {
|
.mask-filter-lang {
|
||||||
@ -45,10 +32,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
min-width: 80px;
|
||||||
button {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,8 +291,8 @@ export function MaskPage() {
|
|||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<div className={styles["mask-create"]}>
|
|
||||||
<IconButton
|
<IconButton
|
||||||
|
className={styles["mask-create"]}
|
||||||
icon={<AddIcon />}
|
icon={<AddIcon />}
|
||||||
text={Locale.Mask.Page.Create}
|
text={Locale.Mask.Page.Create}
|
||||||
bordered
|
bordered
|
||||||
@ -302,7 +302,6 @@ export function MaskPage() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{masks.map((m) => (
|
{masks.map((m) => (
|
||||||
|
@ -59,10 +59,9 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.search-bar {
|
.more {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-right: 10px;
|
margin-left: 10px;
|
||||||
width: 40vw;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,10 +5,11 @@ import { EmojiAvatar } from "./emoji";
|
|||||||
import styles from "./new-chat.module.scss";
|
import styles from "./new-chat.module.scss";
|
||||||
|
|
||||||
import LeftIcon from "../icons/left.svg";
|
import LeftIcon from "../icons/left.svg";
|
||||||
import AddIcon from "../icons/lightning.svg";
|
import LightningIcon from "../icons/lightning.svg";
|
||||||
|
import EyeIcon from "../icons/eye.svg";
|
||||||
|
|
||||||
import { useLocation, useNavigate } from "react-router-dom";
|
import { useLocation, useNavigate } from "react-router-dom";
|
||||||
import { createEmptyMask, Mask, useMaskStore } from "../store/mask";
|
import { Mask, useMaskStore } from "../store/mask";
|
||||||
import Locale from "../locales";
|
import Locale from "../locales";
|
||||||
import { useAppConfig, useChatStore } from "../store";
|
import { useAppConfig, useChatStore } from "../store";
|
||||||
import { MaskAvatar } from "./mask";
|
import { MaskAvatar } from "./mask";
|
||||||
@ -148,20 +149,22 @@ export function NewChat() {
|
|||||||
<div className={styles["sub-title"]}>{Locale.NewChat.SubTitle}</div>
|
<div className={styles["sub-title"]}>{Locale.NewChat.SubTitle}</div>
|
||||||
|
|
||||||
<div className={styles["actions"]}>
|
<div className={styles["actions"]}>
|
||||||
<input
|
|
||||||
className={styles["search-bar"]}
|
|
||||||
placeholder={Locale.NewChat.More}
|
|
||||||
type="text"
|
|
||||||
onClick={() => navigate(Path.Masks)}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<IconButton
|
<IconButton
|
||||||
text={Locale.NewChat.Skip}
|
text={Locale.NewChat.Skip}
|
||||||
onClick={() => startChat()}
|
onClick={() => startChat()}
|
||||||
icon={<AddIcon />}
|
icon={<LightningIcon />}
|
||||||
type="primary"
|
type="primary"
|
||||||
shadow
|
shadow
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<IconButton
|
||||||
|
className={styles["more"]}
|
||||||
|
text={Locale.NewChat.More}
|
||||||
|
onClick={() => navigate(Path.Masks)}
|
||||||
|
icon={<EyeIcon />}
|
||||||
|
bordered
|
||||||
|
shadow
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles["masks"]}>
|
<div className={styles["masks"]}>
|
||||||
|
@ -224,7 +224,7 @@ const cn = {
|
|||||||
ConfirmNoShow: "确认禁用?禁用后可以随时在设置中重新启用。",
|
ConfirmNoShow: "确认禁用?禁用后可以随时在设置中重新启用。",
|
||||||
Title: "挑选一个面具",
|
Title: "挑选一个面具",
|
||||||
SubTitle: "现在开始,与面具背后的灵魂思维碰撞",
|
SubTitle: "现在开始,与面具背后的灵魂思维碰撞",
|
||||||
More: "搜索更多",
|
More: "查看全部",
|
||||||
},
|
},
|
||||||
|
|
||||||
UI: {
|
UI: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user