Skip to content

Commit

Permalink
simply logo-only condition
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore committed Jan 21, 2025
1 parent 1f14a91 commit eef8280
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions badge-maker/lib/badge-renderers.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ class Badge {
const accessibleText = createAccessibleText({ label, message })

const hasLabel = label.length || labelColor
const logoOnly = hasLogo && !hasLabel && !message.length
if (labelColor == null) {
labelColor = '#555'
}
Expand All @@ -160,11 +159,8 @@ class Badge {
}
}
let rightWidth = messageWidth + 2 * horizPadding
if (logoOnly) {
const paddingRight = message.length ? horizPadding - 1 : 0
rightWidth += totalLogoWidth + paddingRight
} else if (hasLogo && !hasLabel) {
rightWidth += totalLogoWidth + horizPadding - 1
if (hasLogo && !hasLabel) {
rightWidth += totalLogoWidth + message.length ? horizPadding - 1 : 0
}

const width = leftWidth + rightWidth
Expand Down

0 comments on commit eef8280

Please sign in to comment.