1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 17:36:38 +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 ( return (
<div className={classList('Form', className)} {...attrs}> <div className={classList('Form', className)} {...attrs}>
{(label || description) && (
<div className="Form-header"> <div className="Form-header">
{label && <label>{label}</label>} {label && <label>{label}</label>}
{description && <p className="helpText">{description}</p>} {description && <p className="helpText">{description}</p>}
</div> </div>
)}
<div className="Form-body">{vnode.children}</div> <div className="Form-body">{vnode.children}</div>
</div> </div>
); );