🐛 fix(parameterComponent): add refNumberComponents to keep track of the number of components
🐛 fix(parameterComponent): change text-destructive class to text-status-red for better semantics 🐛 fix(ModalField): change text-destructive class to text-status-red for better semantics 🐛 fix(codeAreaModal): change text-destructive class to text-status-red for better semantics
This commit is contained in:
parent
7cded3898e
commit
d2f28dee6b
3 changed files with 8 additions and 4 deletions
|
|
@ -41,6 +41,7 @@ export default function ParameterComponent({
|
||||||
}: ParameterComponentType) {
|
}: ParameterComponentType) {
|
||||||
const ref = useRef(null);
|
const ref = useRef(null);
|
||||||
const refHtml = useRef(null);
|
const refHtml = useRef(null);
|
||||||
|
const refNumberComponents = useRef(0);
|
||||||
const infoHtml = useRef(null);
|
const infoHtml = useRef(null);
|
||||||
const updateNodeInternals = useUpdateNodeInternals();
|
const updateNodeInternals = useUpdateNodeInternals();
|
||||||
const [position, setPosition] = useState(0);
|
const [position, setPosition] = useState(0);
|
||||||
|
|
@ -91,9 +92,12 @@ export default function ParameterComponent({
|
||||||
);
|
);
|
||||||
}, [info]);
|
}, [info]);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const groupedObj = groupByFamily(myData, tooltipTitle, left, data.type);
|
const groupedObj = groupByFamily(myData, tooltipTitle, left, data.type);
|
||||||
|
|
||||||
|
refNumberComponents.current = groupedObj[0]?.component?.length;
|
||||||
|
|
||||||
refHtml.current = groupedObj.map((item, i) => {
|
refHtml.current = groupedObj.map((item, i) => {
|
||||||
const Icon: any = nodeIconsLucide[item.family];
|
const Icon: any = nodeIconsLucide[item.family];
|
||||||
|
|
||||||
|
|
@ -155,7 +159,7 @@ export default function ParameterComponent({
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
<span className="text-destructive">{required ? " *" : ""}</span>
|
<span className="text-status-red">{required ? " *" : ""}</span>
|
||||||
<div className="">
|
<div className="">
|
||||||
{info !== "" && (
|
{info !== "" && (
|
||||||
<ShadTooltip content={infoHtml.current}>
|
<ShadTooltip content={infoHtml.current}>
|
||||||
|
|
@ -176,7 +180,7 @@ export default function ParameterComponent({
|
||||||
<></>
|
<></>
|
||||||
) : (
|
) : (
|
||||||
<ShadTooltip
|
<ShadTooltip
|
||||||
style="tooltip-fixed-width custom-scroll"
|
style={refNumberComponents.current > 10 ? "tooltip-fixed-width custom-scroll overflow-y-scroll nowheel" : "tooltip-fixed-width"}
|
||||||
delayDuration={0}
|
delayDuration={0}
|
||||||
content={refHtml.current}
|
content={refHtml.current}
|
||||||
side={left ? "left" : "right"}
|
side={left ? "left" : "right"}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ export default function ModalField({
|
||||||
{display && (
|
{display && (
|
||||||
<div>
|
<div>
|
||||||
<span className="mx-2">{title}</span>
|
<span className="mx-2">{title}</span>
|
||||||
<span className="text-destructive">{required ? " *" : ""}</span>
|
<span className="text-status-red">{required ? " *" : ""}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ export default function CodeAreaModal({
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className="mt-1 h-full w-full overflow-x-clip overflow-y-scroll text-left custom-scroll">
|
<div className="mt-1 h-full w-full overflow-x-clip overflow-y-scroll text-left custom-scroll">
|
||||||
<h1 className="text-lg text-destructive">
|
<h1 className="text-lg text-status-red">
|
||||||
{error?.detail?.error}
|
{error?.detail?.error}
|
||||||
</h1>
|
</h1>
|
||||||
<div className="ml-2 w-full break-all text-sm text-status-red">
|
<div className="ml-2 w-full break-all text-sm text-status-red">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue