Skip to content

Commit

Permalink
Remove unused imports and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
porter-stripe committed May 7, 2024
1 parent ad19603 commit 14a856c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,32 @@
// Created by Nick Porter on 5/7/24.
//

import Foundation
@_spi(STP) import StripeCore
@_spi(STP) import StripePayments
@_spi(STP) import StripePaymentsUI
@_spi(STP) import StripeUICore
import Foundation
import UIKit

/// A view controller that shows a list of saved payment methods in a vertical orientation
class VerticalSavedPaymentOptionsViewController: UIViewController {

private let configuration: PaymentSheet.Configuration

// MARK: - UI properties

lazy var navigationBar: SheetNavigationBar = {
let navBar = SheetNavigationBar(isTestMode: configuration.apiClient.isTestmode,
appearance: configuration.appearance)
navBar.setStyle(.back)
navBar.delegate = self
return navBar
}()

private lazy var headerLabel: UILabel = {
let label = PaymentSheetUI.makeHeaderLabel(appearance: configuration.appearance)
label.text = .Localized.select_your_payment_method
return label
}()

private lazy var stackView: UIStackView = {
let stackView = UIStackView(arrangedSubviews: [headerLabel])
stackView.directionalLayoutMargins = PaymentSheetUI.defaultMargins
Expand All @@ -41,16 +39,16 @@ class VerticalSavedPaymentOptionsViewController: UIViewController {
stackView.spacing = PaymentSheetUI.defaultPadding
return stackView
}()

init(configuration: PaymentSheet.Configuration) {
self.configuration = configuration
super.init(nibName: nil, bundle: nil)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = configuration.appearance.colors.background
Expand All @@ -60,7 +58,6 @@ class VerticalSavedPaymentOptionsViewController: UIViewController {
}
}


// MARK: - BottomSheetContentViewController
extension VerticalSavedPaymentOptionsViewController: BottomSheetContentViewController {
var allowsDragToDismiss: Bool {
Expand All @@ -87,8 +84,8 @@ extension VerticalSavedPaymentOptionsViewController: SheetNavigationBarDelegate
func sheetNavigationBarDidClose(_ sheetNavigationBar: SheetNavigationBar) {
// no-op we are in 'back' style mode
}

func sheetNavigationBarDidBack(_ sheetNavigationBar: SheetNavigationBar) {
let _ = bottomSheetController?.popContentViewController()
_ = bottomSheetController?.popContentViewController()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import StripeCoreTestUtils
import XCTest

final class VerticalSavedPaymentOptionsViewControllerSnapshotTests: STPSnapshotTestCase {

func test_VerticalSavedPaymentOptionsViewControllerSnapshotTestsDarkMode() {
_test_VerticalSavedPaymentOptionsViewControllerSnapshotTests(darkMode: true)
}
Expand Down

0 comments on commit 14a856c

Please sign in to comment.