fix TextInfoPanel

This commit is contained in:
Aifeilong 2023-10-16 17:51:08 +08:00
parent 20f2a8fa81
commit 0ad04d742c
5 changed files with 36 additions and 47 deletions

View File

@ -2,6 +2,7 @@ import { useCallback, useEffect, useState } from "react";
import { Scrollbars } from "react-custom-scrollbars-2"; import { Scrollbars } from "react-custom-scrollbars-2";
import { useInterval } from "ahooks"; import { useInterval } from "ahooks";
import { useLocation } from "react-router-dom"; import { useLocation } from "react-router-dom";
import styles from "./index.module.less";
let index = 0; let index = 0;
@ -38,8 +39,16 @@ function TextInfoPanel({ content }) {
}, []); }, []);
return ( return (
<div className="text-info-panel" onDoubleClick={stopHandler}> <div className={styles.textInfoPanel} onDoubleClick={stopHandler}>
<Scrollbars autoHide autoHideTimeout={1000} autoHideDuration={400}> <Scrollbars
className="scrollbars"
renderThumbVertical={(styles) => {
return <div className="thumbVertical" {...styles}></div>;
}}
renderView={(props) => {
return <div className="view" {...props}></div>;
}}
>
{contentText} {contentText}
</Scrollbars> </Scrollbars>
</div> </div>

View File

@ -0,0 +1,25 @@
.textInfoPanel :global {
width: 100%;
height: 100%;
border: 1px solid #04fbfd;
color: #02f9ff !important;
background-color: #000000e7;
pointer-events: auto;
font-size: 18px;
text-indent: 2em;
line-height: 1.5;
z-index: 999;
border-radius: 8px;
.scrollbars {
.view {
padding: 12px;
}
.thumbVertical {
background-color: #00a2a2;
border-radius: 6px;
// margin-left: 8px;
}
}
}

View File

@ -51,21 +51,6 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
.text-info-panel {
width: 100%;
height: 100%;
padding: 12px;
border: 1px solid #04fbfd;
color: #02f9ff !important;
background-color: #000000e7;
pointer-events: auto;
font-size: 18px;
text-indent: 2em;
line-height: 1.5;
z-index: 999;
border-radius: 8px;
}
} }
.right-panel { .right-panel {

View File

@ -32,21 +32,6 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
.text-info-panel {
width: 100%;
height: 100%;
padding: 12px;
border: 1px solid #04fbfd;
color: #02f9ff !important;
background-color: #000000e7;
pointer-events: auto;
font-size: 18px;
text-indent: 2em;
line-height: 1.5;
z-index: 999;
border-radius: 8px;
}
} }
.right-panel { .right-panel {

View File

@ -44,21 +44,6 @@
.bottom-panel { .bottom-panel {
flex: 1; flex: 1;
} }
.text-info-panel {
width: 100%;
height: 100%;
padding: 12px;
border: 1px solid #04fbfd;
color: #02f9ff !important;
background-color: #000000e7;
pointer-events: auto;
font-size: 18px;
text-indent: 2em;
line-height: 1.5;
z-index: 999;
border-radius: 8px;
}
} }
.right-panel { .right-panel {