mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-08 11:06:37 +08:00
Merge branch 'main' into hidebutton
This commit is contained in:
commit
dedfff1ce0
@ -209,6 +209,7 @@ export function Artifacts() {
|
|||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [fileName, setFileName] = useState("");
|
const [fileName, setFileName] = useState("");
|
||||||
const previewRef = useRef<HTMLPreviewHander>(null);
|
const previewRef = useRef<HTMLPreviewHander>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (id) {
|
if (id) {
|
||||||
fetch(`${ApiPath.Artifacts}?id=${id}`)
|
fetch(`${ApiPath.Artifacts}?id=${id}`)
|
||||||
@ -251,6 +252,7 @@ export function Artifacts() {
|
|||||||
{code && (
|
{code && (
|
||||||
<HTMLPreview
|
<HTMLPreview
|
||||||
code={code}
|
code={code}
|
||||||
|
ref={previewRef}
|
||||||
autoHeight={false}
|
autoHeight={false}
|
||||||
height={"100%"}
|
height={"100%"}
|
||||||
ref={previewRef}
|
ref={previewRef}
|
||||||
|
@ -8,7 +8,7 @@ import RehypeHighlight from "rehype-highlight";
|
|||||||
import { useRef, useState, RefObject, useEffect, useMemo } from "react";
|
import { useRef, useState, RefObject, useEffect, useMemo } from "react";
|
||||||
import { copyToClipboard, useWindowSize } from "../utils";
|
import { copyToClipboard, useWindowSize } from "../utils";
|
||||||
import mermaid from "mermaid";
|
import mermaid from "mermaid";
|
||||||
|
import Locale from "../locales";
|
||||||
import LoadingIcon from "../icons/three-dots.svg";
|
import LoadingIcon from "../icons/three-dots.svg";
|
||||||
import ReloadButtonIcon from "../icons/reload.svg";
|
import ReloadButtonIcon from "../icons/reload.svg";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
@ -199,7 +199,7 @@ function CustomCode(props: { children: any }) {
|
|||||||
<div
|
<div
|
||||||
className={`show-hide-button ${collapsed ? "collapsed" : "expanded"}`}
|
className={`show-hide-button ${collapsed ? "collapsed" : "expanded"}`}
|
||||||
>
|
>
|
||||||
<button onClick={toggleCollapsed}>查看全部</button>
|
<button onClick={toggleCollapsed}>{Locale.NewChat.More}</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
|
@ -304,7 +304,7 @@ pre {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pre{
|
pre{
|
||||||
.show-hide-button {
|
.show-hide-button {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
Loading…
Reference in New Issue
Block a user