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

qa for icon button #423

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions Sources/Public/Components/IconButton/NatIconButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ public final class NatIconButton: UIView {
@objc func tapHandler(_ sender: UIGestureRecognizer) {
guard currentState == .enabled else { return }
self.action?()
let opacity = getTokenFromTheme(\.opacityDisabledLow)
let color = getUIColorFromTokens(\.colorHighlight).withAlphaComponent(opacity)
addPulseLayerAnimated(
at: centerBounds,
in: layer,
withColor: color,
removeAfterAnimation: true
)
removePulseLayer(layer: layer)
}

Expand All @@ -130,22 +138,10 @@ public final class NatIconButton: UIView {
super.touchesBegan(touches, with: event)

guard currentState == .enabled else { return }

let opacity = getTokenFromTheme(\.opacityDisabledLow)
let color = getUIColorFromTokens(\.colorHighlight).withAlphaComponent(opacity)

addPulseLayerAnimated(
at: centerBounds,
in: layer,
withColor: color,
removeAfterAnimation: true
)
}

public override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesEnded(touches, with: event)

removePulseLayer(layer: layer)
}
}

Expand Down