mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
32 lines
No EOL
1.2 KiB
JavaScript
32 lines
No EOL
1.2 KiB
JavaScript
const { React } = goosemodScope.webpackModules.common;
|
|
|
|
import Divider from './divider';
|
|
|
|
const OriginalFormItem = goosemodScope.webpackModules.findByDisplayName('FormItem');
|
|
const OriginalFormText = goosemodScope.webpackModules.findByDisplayName('FormText');
|
|
|
|
const Flex = goosemodScope.webpackModules.findByDisplayName('Flex');
|
|
const Margins = goosemodScope.webpackModules.findByProps('marginTop20', 'marginBottom20');
|
|
const FormClasses = goosemodScope.webpackModules.findByProps('formText', 'description');
|
|
|
|
export default class FormItem extends React.PureComponent {
|
|
render() {
|
|
return React.createElement(OriginalFormItem, {
|
|
title: this.props.title,
|
|
required: this.props.required,
|
|
className: [Flex.Direction.VERTICAL, Flex.Justify.START, Flex.Align.STRETCH, Flex.Wrap.NO_WRAP, Margins.marginBottom20].join(' '),
|
|
onClick: () => {
|
|
this.props.onClick();
|
|
}
|
|
},
|
|
|
|
this.props.children,
|
|
|
|
this.props.note && React.createElement(OriginalFormText, {
|
|
className: FormClasses.description + (this.props.noteHasMargin ? (' ' + Margins.marginTop8) : '')
|
|
}, this.props.note),
|
|
|
|
React.createElement(Divider)
|
|
);
|
|
}
|
|
} |