mirror of
https://github.com/flarum/framework.git
synced 2025-02-15 01:22:52 +08:00
chore: do not render form header when label or description is not present (#4035)
This commit is contained in:
parent
6444ccd6a5
commit
40a84fc3d8
|
@ -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>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user