Skip to content

Commit 351fa16

Browse files
committed
fix: fix code
1 parent a6da3a4 commit 351fa16

File tree

3 files changed

+12
-19
lines changed

3 files changed

+12
-19
lines changed

src/lib/kit/components/AccordeonCard/AccordeonCard.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,6 @@ export const AccordeonCard: React.FC<AccordeonCardProps> = ({
8484
return 'subheader-1';
8585
}, [titleSize]);
8686

87-
const descriptionContent = React.useMemo(() => {
88-
if (!description) {
89-
return null;
90-
}
91-
92-
return <HTMLContent className={b('header-content-description')} html={description} />;
93-
}, [description]);
94-
9587
return (
9688
<div ref={accordeonRef} className={b({empty: Boolean(emptyBody)}, className)}>
9789
<div
@@ -103,7 +95,12 @@ export const AccordeonCard: React.FC<AccordeonCardProps> = ({
10395
>
10496
<div className={b('header-content')}>
10597
<Text variant={currentHeaderVariant}>{header}</Text>
106-
{descriptionContent}
98+
{description ? (
99+
<HTMLContent
100+
className={b('header-content-description')}
101+
html={description}
102+
/>
103+
) : null}
107104
</div>
108105
{!emptyBody && !alwaysOpen ? (
109106
<div className={b('header-toggle-btn')} onClick={preventEvent}>

src/lib/kit/components/Layouts/Row/Row.tsx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ const RowBase = <T extends FieldValue, S extends Spec>({
2929
const arrayItem = React.useMemo(() => isArrayItem(name), [name]);
3030
const generateButton = React.useMemo(() => withGenerateButton(spec), [spec]);
3131

32-
const verboseDescriptionContent = React.useMemo(() => {
33-
if (verboseDescription && spec.viewSpec.layoutDescription) {
34-
return <HTMLContent html={spec.viewSpec.layoutDescription} />;
35-
}
36-
37-
return null;
38-
}, [spec.viewSpec.layoutDescription, verboseDescription]);
39-
4032
return (
4133
<div className={b()}>
4234
<div className={b('left')}>
@@ -90,7 +82,12 @@ const RowBase = <T extends FieldValue, S extends Spec>({
9082
</Button>
9183
) : null}
9284
</div>
93-
{verboseDescriptionContent}
85+
{verboseDescription && spec.viewSpec.layoutDescription ? (
86+
<HTMLContent
87+
className={b('description')}
88+
html={spec.viewSpec.layoutDescription}
89+
/>
90+
) : null}
9491
</div>
9592
</div>
9693
);

src/lib/kit/components/ViewLayouts/ViewAccordeon/ViewAccordeon.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export const ViewAccordeon = <
2121
children,
2222
}: T): JSX.Element | null => {
2323
const {showLayoutDescription} = useDynamicFormsCtx();
24-
2524
const [open, setOpen] = React.useState(
2625
isBoolean(spec.viewSpec.layoutOpen) ? spec.viewSpec.layoutOpen : true,
2726
);

0 commit comments

Comments
 (0)