mirror of
https://github.com/flarum/framework.git
synced 2025-05-23 23:29:57 +08:00
Massive JavaScript cleanup
- Use JSX for templates - Docblock/comment everything - Mostly passes ESLint (still some work to do) - Lots of renaming, refactoring, etc. CSS hasn't been updated yet.
This commit is contained in:
22
js/lib/components/FieldSet.js
Normal file
22
js/lib/components/FieldSet.js
Normal file
@ -0,0 +1,22 @@
|
||||
import Component from 'flarum/Component';
|
||||
import listItems from 'flarum/helpers/listItems';
|
||||
|
||||
/**
|
||||
* The `FieldSet` component defines a collection of fields, displayed in a list
|
||||
* underneath a title. Accepted properties are:
|
||||
*
|
||||
* - `className` The class name for the fieldset.
|
||||
* - `label` The title of this group of fields.
|
||||
*
|
||||
* The children should be an array of items to show in the fieldset.
|
||||
*/
|
||||
export default class FieldSet extends Component {
|
||||
view() {
|
||||
return (
|
||||
<fieldset className={this.props.className}>
|
||||
<legend>{this.props.label}</legend>
|
||||
<ul>{listItems(this.props.children)}</ul>
|
||||
</fieldset>
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user