Skip to content

Commit

Permalink
Fix the successful redeem as well
Browse files Browse the repository at this point in the history
  • Loading branch information
buggmagnet committed Sep 21, 2023
1 parent c8ddb7a commit 55263e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions ios/MullvadVPN/UI appearance/UIMetrics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ enum UIMetrics {
static let cornerRadius = 8.0
static let preferredContentSize = CGSize(width: 280, height: 260)
static let contentLayoutMargins = NSDirectionalEdgeInsets(top: 16, leading: 16, bottom: 16, trailing: 16)
static let successfulRedeemMargins = NSDirectionalEdgeInsets(top: 16, leading: 8, bottom: 16, trailing: 8)
}

enum AccountDeletion {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,18 @@ class AddCreditSucceededViewController: UIViewController, RootContainment {

override func viewDidLoad() {
super.viewDidLoad()
addSubviews()
addConstraints()
configureUI()
addDismissButtonHandler()
}

private func addSubviews() {
for subview in [statusImageView, titleLabel, messageLabel, dismissButton] {
view.addSubview(subview)
private func configureUI() {
let contentHolderView = UIView(frame: .zero)

view.addConstrainedSubviews([contentHolderView]) {
contentHolderView.pinEdgesToSuperview(.all(UIMetrics.SettingsRedeemVoucher.successfulRedeemMargins))
}
}

private func addConstraints() {
view.addConstrainedSubviews([statusImageView, titleLabel, messageLabel, dismissButton]) {
contentHolderView.addConstrainedSubviews([statusImageView, titleLabel, messageLabel, dismissButton]) {
statusImageView.pinEdgesToSuperviewMargins(PinnableEdges([.top(0)]))
statusImageView.centerXAnchor.constraint(equalTo: view.centerXAnchor)

Expand Down

0 comments on commit 55263e1

Please sign in to comment.