Skip to content

Commit

Permalink
Apply padding to button and remove minimum height of 50
Browse files Browse the repository at this point in the history
  • Loading branch information
levieggertcru committed Aug 15, 2024
1 parent c827f83 commit fb76a20
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import Foundation
import UIKit

class MobileContentButtonView: MobileContentView {

private static let buttonHeight: CGFloat = 50


private let viewModel: MobileContentButtonViewModel
private let buttonView: UIView = UIView()
private let buttonTitle: UILabel = UILabel()
private let buttonImagePaddingToButtonTitle: CGFloat = 12
private let minimumButtonHeight: CGFloat = 21
private let buttonTopAndBottomPaddingToTitle: CGFloat = 8

private var buttonTitleSizeToFitSize: CGSize?
private var buttonImageView: UIImageView?
Expand Down Expand Up @@ -92,7 +92,7 @@ class MobileContentButtonView: MobileContentView {
_ = buttonView.constrainBottomToView(view: self)

_ = buttonView.addHeightConstraint(
constant: Self.buttonHeight,
constant: minimumButtonHeight,
relatedBy: .greaterThanOrEqual,
priority: 1000
)
Expand All @@ -106,9 +106,9 @@ class MobileContentButtonView: MobileContentView {
// buttonTitle
buttonView.addSubview(buttonTitle)
buttonTitle.translatesAutoresizingMaskIntoConstraints = false
_ = buttonTitle.constrainTopToView(view: buttonView)
_ = buttonTitle.constrainBottomToView(view: buttonView)

_ = buttonTitle.constrainTopToView(view: buttonView, constant: buttonTopAndBottomPaddingToTitle)
_ = buttonTitle.constrainBottomToView(view: buttonView, constant: buttonTopAndBottomPaddingToTitle)
if let buttonImageView = buttonImageView, let buttonIcon = viewModel.icon, let buttonIconSize = getButtonIconSize(), let buttonTitleWidth = getButtonTitleWidth() {

buttonTitle.constrainCenterHorizontallyInView(view: buttonView)
Expand Down

0 comments on commit fb76a20

Please sign in to comment.