Skip to content

Commit

Permalink
fixup! chore(readonly-boolean): add new private component
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiarokh committed Feb 5, 2024
1 parent 8675e12 commit 32e988a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/readonly-boolean/readonly-boolean.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ export class ReadonlyBoolean {
private renderIcon() {
let icon;
if (this.value) {
icon = this.readonlyProps.trueIcon || 'ok';
icon = this.readonlyProps?.trueIcon || 'ok';
} else {
icon = this.readonlyProps.falseIcon || 'minus';
icon = this.readonlyProps?.falseIcon || 'minus';
}

const iconName = getIconName(icon);
Expand Down Expand Up @@ -82,7 +82,11 @@ export class ReadonlyBoolean {
private renderLabel() {
let label;

if (this.readonlyProps.trueLabel && this.readonlyProps.falseLabel) {
if (
this.readonlyProps &&
this.readonlyProps.trueLabel &&
this.readonlyProps.falseLabel
) {
label = this.value

Check failure on line 90 in src/components/readonly-boolean/readonly-boolean.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected newline between test and consequent of ternary expression
? this.readonlyProps.trueLabel

Check failure on line 91 in src/components/readonly-boolean/readonly-boolean.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected newline between consequent and alternate of ternary expression
: this.readonlyProps.falseLabel;
Expand Down

0 comments on commit 32e988a

Please sign in to comment.