Update 0BDFDB.plugin.js
This commit is contained in:
parent
89fc29e3f0
commit
757ba209be
|
@ -6203,16 +6203,16 @@ module.exports = (_ => {
|
||||||
let childComponent = InternalComponents.LibraryComponents[this.props.type];
|
let childComponent = InternalComponents.LibraryComponents[this.props.type];
|
||||||
if (!childComponent) return null;
|
if (!childComponent) return null;
|
||||||
if (this.props.mini && childComponent.Sizes) this.props.size = childComponent.Sizes.MINI || childComponent.Sizes.MIN;
|
if (this.props.mini && childComponent.Sizes) this.props.size = childComponent.Sizes.MINI || childComponent.Sizes.MIN;
|
||||||
|
let margin = this.props.margin != null ? this.props.margin : (this.props.mini ? 0 : 8);
|
||||||
return BDFDB.ReactUtils.createElement("div", {
|
return BDFDB.ReactUtils.createElement("div", {
|
||||||
className: BDFDB.DOMUtils.formatClassName(this.props.className, BDFDB.disCN.settingsrow, this.props.disabled && BDFDB.disCN.settingsrowdisabled),
|
className: BDFDB.DOMUtils.formatClassName(this.props.className, BDFDB.disCN.settingsrow, BDFDB.disCN.settingsrowcontainer, this.props.disabled && BDFDB.disCN.settingsrowdisabled, margin != null && (BDFDB.DiscordClasses[`marginbottom${margin}`] && BDFDB.disCN[`marginbottom${margin}`] || margin == 0 && BDFDB.disCN.marginreset)),
|
||||||
id: this.props.id,
|
id: this.props.id,
|
||||||
style: {marginBottom: this.props.margin != null ? this.props.margin : (this.props.mini ? 0 : 8)},
|
|
||||||
children: [
|
children: [
|
||||||
this.props.dividerTop ? BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.FormComponents.FormDivider, {
|
this.props.dividerTop ? BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.FormComponents.FormDivider, {
|
||||||
className: this.props.mini ? BDFDB.disCN.marginbottom4 : BDFDB.disCN.marginbottom8
|
className: this.props.mini ? BDFDB.disCN.marginbottom4 : BDFDB.disCN.marginbottom8
|
||||||
}) : null,
|
}) : null,
|
||||||
BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Flex, {
|
BDFDB.ReactUtils.createElement("div", {
|
||||||
align: InternalComponents.LibraryComponents.Flex.Align.CENTER,
|
className: BDFDB.disCN.settingsrowlabel,
|
||||||
children: [
|
children: [
|
||||||
this.props.label ? (this.props.tag ? BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.FormComponents.FormTitle, {
|
this.props.label ? (this.props.tag ? BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.FormComponents.FormTitle, {
|
||||||
className: BDFDB.DOMUtils.formatClassName(this.props.labelClassName, BDFDB.disCN.flexchild, BDFDB.disCN.marginreset),
|
className: BDFDB.DOMUtils.formatClassName(this.props.labelClassName, BDFDB.disCN.flexchild, BDFDB.disCN.marginreset),
|
||||||
|
@ -6690,9 +6690,10 @@ module.exports = (_ => {
|
||||||
let fill = animation.state.to({
|
let fill = animation.state.to({
|
||||||
output: [props.uncheckedColor, props.checkedColor]
|
output: [props.uncheckedColor, props.checkedColor]
|
||||||
});
|
});
|
||||||
|
let mini = props.size == InternalComponents.LibraryComponents.Switch.Sizes.MINI;
|
||||||
|
|
||||||
return BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Animations.animated.div, {
|
return BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Animations.animated.div, {
|
||||||
className: BDFDB.DOMUtils.formatClassName(props.className, BDFDB.disCN.switch),
|
className: BDFDB.DOMUtils.formatClassName(props.className, BDFDB.disCN.switch, mini && BDFDB.disCN.switchmini),
|
||||||
onMouseDown: _ => {
|
onMouseDown: _ => {
|
||||||
return !props.disabled && state[1](true);
|
return !props.disabled && state[1](true);
|
||||||
},
|
},
|
||||||
|
@ -6717,7 +6718,7 @@ module.exports = (_ => {
|
||||||
style: {
|
style: {
|
||||||
left: animation.state.to({
|
left: animation.state.to({
|
||||||
range: [0, .3, .7, 1],
|
range: [0, .3, .7, 1],
|
||||||
output: [-3, 1, 8, 12]
|
output: mini ? [-1, 2, 6, 9] : [-3, 1, 8, 12]
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
|
Loading…
Reference in New Issue