-
Notifications
You must be signed in to change notification settings - Fork 114
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
[Horizon] Icon Buttons #3036
base: feature/horizon
Are you sure you want to change the base?
[Horizon] Icon Buttons #3036
Conversation
❌ XCTest failed: CoreTests/AssignmentCellViewModelTests/testSubmissionStatusAndIconAndColor
|
Updating the access levels for some of the items so they can be used in the project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, but i set some comments
packages/HorizonUI/Sources/HorizonUI/Sources/Components/Button/HorizonUI.ButtonStyles.swift
Show resolved
Hide resolved
packages/HorizonUI/Sources/HorizonUI/Sources/Components/Button/HorizonUI.ButtonStyles.swift
Show resolved
Hide resolved
packages/HorizonUI/Sources/HorizonUI/Sources/Components/Button/HorizonUI.ButtonStyles.swift
Outdated
Show resolved
Hide resolved
packages/HorizonUI/Sources/HorizonUI/Sources/Components/Button/HorizonUI.ButtonStyles.swift
Outdated
Show resolved
Hide resolved
packages/HorizonUI/Sources/HorizonUI/Sources/Components/Button/HorizonUI.ButtonStyles.swift
Outdated
Show resolved
Hide resolved
packages/HorizonUI/Sources/HorizonUI/Sources/Components/Button/HorizonUI.ButtonStyles.swift
Show resolved
Hide resolved
packages/HorizonUI/Sources/HorizonUI/Sources/Components/Button/HorizonUI.ButtonStyles.swift
Show resolved
Hide resolved
…erences to other values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work, is working fine for me, but i have one question and one suggestion
1- Question: In the case where the icon button is disabled but has a badge, should we set the opacity for the badge view or hide it? I couldn’t find this scenario in Figma. We can ask the team about it after your holiday.
2- Suggestion: What is your opinion on using a scenario for showing the icon button that makes it more readable and usable?
public extension HorizonUI {
struct IconButton: View {
let type: HorizonUI.ButtonStyles.ButtonType
let isSmall: Bool
let badgeNumber: String?
let icon: Image?
let onTap: () -> Void
public init(
type: HorizonUI.ButtonStyles.ButtonType,
isSmall: Bool = false,
badgeNumber: String? = nil,
icon: Image? = nil,
onTap: @escaping () -> Void
) {
self.type = type
self.isSmall = isSmall
self.badgeNumber = badgeNumber
self.icon = icon
self.onTap = onTap
}
public var body: some View {
Button("") {
onTap()
}
.buttonStyle(
HorizonUI.ButtonStyles.icon(type, isSmall: isSmall, badgeNumber: badgeNumber, icon: icon)
)
}
}
}
public func makeBody(configuration: Configuration) -> some View { | ||
ZStack { | ||
if let icon = icon { | ||
ZStack { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make if let icon
this is enough & create two functions for each branch as you did before, it was more readable
if let icon {
iconButton()
} else {
normalButton()
}
No description provided.