1
0
mirror of https://github.com/flarum/core.git synced 2025-08-07 17:07:19 +02:00

chore: do not render form header when label or description is not present (#4035)

This commit is contained in:
Ngô Quốc Đạt
2024-09-28 23:07:46 +07:00
committed by GitHub
parent 6444ccd6a5
commit 40a84fc3d8

View File

@@ -14,10 +14,12 @@ export default class Form<CustomAttrs extends IFormAttrs = IFormAttrs> extends C
return (
<div className={classList('Form', className)} {...attrs}>
<div className="Form-header">
{label && <label>{label}</label>}
{description && <p className="helpText">{description}</p>}
</div>
{(label || description) && (
<div className="Form-header">
{label && <label>{label}</label>}
{description && <p className="helpText">{description}</p>}
</div>
)}
<div className="Form-body">{vnode.children}</div>
</div>
);