Skip to content

Commit b593002

Browse files
committed
refactor: UIKit experimental wrappers for button and badge components
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
1 parent 10fba99 commit b593002

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

OUDS/Core/ComponentsUIKit/Sources/Actions/Button/_OUDSButton.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ extension OUDSUIKitBrige {
3636
action: @escaping () -> Void) -> UIViewController
3737
{
3838
OL.warning("Avoid UIKit wrapper and prefer SwiftUI component instead OUDSButton(icon:text:appearance:style:action)")
39-
let swiftUIButton = OUDSButton(icon: icon,
40-
text: text,
39+
let swiftUIButton = OUDSButton(text: text,
40+
icon: icon,
4141
appearance: appearance,
4242
style: style,
4343
action: action)

OUDS/Core/ComponentsUIKit/Sources/Indicators/_OUDSBadge.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,15 @@ extension OUDSUIKitBrige {
6161
/// **This is an experimental feature, feedback and support is appreciated**
6262
///
6363
/// - Parameters:
64-
/// - icon: The icon displayed in the badge
64+
/// - status: The status of this badge, with a predefined icon or not
6565
/// - accessibilityLabel: The accessibility label the badge should have, describing the icon or brining meanings
66-
/// - status: The status of this badge, default set to *neutral*
6766
/// - size: The size of this badge, default set to *medium*
68-
@MainActor public static func createBadge(icon: Image,
67+
@MainActor public static func createBadge(status: OUDSBadge.StatusWithIcon,
6968
accessibilityLabel: String,
70-
status: OUDSBadge.Status = .neutral,
7169
size: OUDSBadge.IllustrationSize = .medium) -> UIViewController
7270
{
7371
OL.warning("Avoid UIKit wrapper and prefer SwiftUI component instead OUDSBadge(icon:accessibilityLabel:status:size)")
74-
let swiftUIBadge = OUDSBadge(icon: icon, accessibilityLabel: accessibilityLabel, status: status, size: size)
72+
let swiftUIBadge = OUDSBadge(status: status, accessibilityLabel: accessibilityLabel, size: size)
7573
return wrap(component: swiftUIBadge)
7674
}
7775
}

0 commit comments

Comments
 (0)