Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TEMPURA-2060] Contribute to Backpack library Badge icon with Painter #2157

Merged
merged 5 commits into from
Nov 28, 2024

Conversation

anton-sobolev-skyscanner
Copy link
Contributor

@anton-sobolev-skyscanner anton-sobolev-skyscanner commented Nov 28, 2024

Copied functional from BpkButton to BpkBadge to add support for custom Badge icons. Compose only

Before Now
Screenshot_20241128_095339 Screenshot_20241128_104440

Remember to include the following changes:

  • Component README.md
  • Tests

If you are curious about how we review, please read through the code review guidelines

@anton-sobolev-skyscanner anton-sobolev-skyscanner added minor A new & backwards compatible feature/component bpk Label used for backpack dependency updates labels Nov 28, 2024
Copy link
Contributor

github-actions bot commented Nov 28, 2024

Warnings
⚠️

One or more package files were created, but BpkComposeComponentUsageDetector.kt wasn't updated. If your component is an equivalent of a core component please add it to the detector.

Generated by 🚫 Danger Kotlin against 2a6ebab


private val BadgeShape = RoundedCornerShape(BpkBorderRadius.Xs)

private fun Modifier.defaultIconSize(size: BpkIconSize): Modifier =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think this is needed? badges should only ever have one icon size, so we don't need the BpkIconSize prop here - they're always small

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -95,6 +97,14 @@ private fun BadgeRow(
else -> BpkIcon.TickCircle
},
)

BpkBadge(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please regenerate the docs screenshots as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Row(
modifier = modifier
.semantics(mergeDescendants = true) { }
.border(1.dp, type.borderColor, BadgeShape)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not new, but while we're here: BpkBorderSize.Sm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@marianeum marianeum merged commit d46678c into main Nov 28, 2024
6 checks passed
@marianeum marianeum deleted the tempura/TEMPURA-2060_compose_badge_custom_icon branch November 28, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bpk Label used for backpack dependency updates minor A new & backwards compatible feature/component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants