Remove null check for 'component.definition.styles (#1183)

* Remove null check for 'component.definition.styles

* Update Toggle.jsx

* Update Toggle.jsx
This commit is contained in:
Ksathwik03 2021-10-21 21:21:45 -05:00 committed by GitHub
parent a7502e5f03
commit 918e8b9304
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,9 +37,9 @@ export const ToggleSwitch = ({
const toggleSwitchColorProperty = component.definition.styles.toggleSwitchColor;
const toggleSwitchColor = toggleSwitchColorProperty ? toggleSwitchColorProperty.value : '#3c92dc';
const textColor = textColorProperty ? textColorProperty.value : '#000';
const widgetVisibility = component.definition.styles?.visibility?.value ?? true;
const disabledState = component.definition.styles?.disabledState?.value ?? false;
const widgetVisibility = component.definition.styles.visibility?.value ?? true;
const disabledState = component.definition.styles.disabledState?.value ?? false;
const parsedDisabledState =
typeof disabledState !== 'boolean' ? resolveWidgetFieldValue(disabledState, currentState) : disabledState;