Skip to content

Commit

Permalink
refactor: Fix more issues identified by Sonarqube Refs #254220
Browse files Browse the repository at this point in the history
  • Loading branch information
dana-cfc4 committed Jun 19, 2023
1 parent cb9a81f commit bc34507
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
3 changes: 2 additions & 1 deletion src/ColumnsBlock/ColumnsBlockView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { getColumns } from './utils';
import { getStyle } from '@eeacms/volto-columns-block/Styles';

const getSide = (side, v) => {
return `${v?.[side] ? `${v[side]}${v.unit ? v.unit : 'px'}` : '0'}`;
const v_unit = v.unit ? v.unit : 'px';
return `${v?.[side] ? `${v[side]}${v_unit}` : '0'}`;
};

const getSides = (v) => {
Expand Down
24 changes: 6 additions & 18 deletions src/Widgets/Slider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,8 @@ export class Slider extends Component {
}}
style={{
...styles.inner,
...(this.props.style
...(this.props.style && this.props.style.inner
? this.props.style.inner
? this.props.style.inner
: {}
: {}),
}}
>
Expand All @@ -363,10 +361,8 @@ export class Slider extends Component {
style={{
...styles.track,
...(this.props.inverted ? styles.invertedTrack : {}),
...(this.props.style
...(this.props.style && this.props.style.track
? this.props.style.track
? this.props.style.track
: {}
: {}),
}}
/>
Expand All @@ -383,16 +379,12 @@ export class Slider extends Component {
? 'inverted-' + this.props.color
: this.props.color
],
...(this.props.style
...(this.props.style && this.props.style.trackFill
? this.props.style.trackFill
? this.props.style.trackFill
: {}
: {}),
...(this.props.disabled ? styles.disabledTrackFill : {}),
...(this.props.style
...(this.props.style && this.props.style.disabledTrackFill
? this.props.style.disabledTrackFill
? this.props.style.disabledTrackFill
: {}
: {}),
...{ width: this.state.position + this.state.offset + 'px' },
...(this.props.multiple && this.state.position.length > 0
Expand All @@ -413,10 +405,8 @@ export class Slider extends Component {
key={i}
style={{
...styles.knob,
...(this.props.style
...(this.props.style && this.props.style.knob
? this.props.style.knob
? this.props.style.knob
: {}
: {}),
...{ left: pos + 'px' },
}}
Expand All @@ -431,10 +421,8 @@ export class Slider extends Component {
onClick={this.handleKnobClick}
style={{
...styles.knob,
...(this.props.style
...(this.props.style && this.props.style.knob
? this.props.style.knob
? this.props.style.knob
: {}
: {}),
...{ left: this.state.position + 'px' },
}}
Expand Down

0 comments on commit bc34507

Please sign in to comment.