mirror of
https://github.com/NovaGM/ModuleBuilder.git
synced 2024-08-15 00:23:33 +00:00
[PCCompat > Components > Settings] Add ButtonItem
This commit is contained in:
parent
6c1379811a
commit
1eabecc0c9
2 changed files with 37 additions and 0 deletions
36
moduleWrappers/powercord/components/settings/buttonItem.js
Normal file
36
moduleWrappers/powercord/components/settings/buttonItem.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
const { React } = goosemodScope.webpackModules.common;
|
||||
|
||||
import FormItem from './formItem';
|
||||
|
||||
const OriginalButton = goosemod.webpackModules.findByProps('Sizes', 'Colors', 'Looks', 'DropdownSizes');
|
||||
|
||||
const Tooltip = goosemodScope.webpackModules.findByDisplayName('Tooltip');
|
||||
|
||||
|
||||
export default class TextInput extends React.PureComponent {
|
||||
render() {
|
||||
const title = this.props.children;
|
||||
delete this.props.children;
|
||||
|
||||
return React.createElement(FormItem, {
|
||||
title,
|
||||
note: this.props.note,
|
||||
required: this.props.required
|
||||
},
|
||||
|
||||
React.createElement(Tooltip, {
|
||||
text: this.props.tooltipText,
|
||||
position: this.props.tooltipPosition,
|
||||
shouldShow: this.props.tooltipText !== ''
|
||||
}, () => React.createElement(OriginalButton,
|
||||
{
|
||||
color: this.props.success ? OriginalButton.Colors.GREEN : (this.props.color || Buttons.Colors.BRAND),
|
||||
disabled: this.props.disabled,
|
||||
onClick: () => this.props.onClick(),
|
||||
style: { marginLeft: 5 }
|
||||
},
|
||||
this.props.button
|
||||
))
|
||||
);
|
||||
}
|
||||
}
|
|
@ -2,5 +2,6 @@ export { default as FormItem } from './formItem';
|
|||
export { default as TextInput } from './textInput';
|
||||
export { default as SliderInput } from './sliderInput';
|
||||
export { default as Divider } from './divider';
|
||||
export { default as ButtonItem } from './buttonItem';
|
||||
|
||||
export const SwitchItem = goosemodScope.webpackModules.findByDisplayName('SwitchItem');
|
Loading…
Reference in a new issue