Skip to content

Commit

Permalink
[Theming] Update theming for web_default theme option in sample app (#36
Browse files Browse the repository at this point in the history
)

* [Theming] Update theming for web_default theme option in sample app

* Use .stop icon on .web theme

* Make the X icon smaller

* Remove unused gradient asset
  • Loading branch information
markmur authored Oct 20, 2023
1 parent 5e39326 commit 38f217c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,10 @@ extension Configuration.ColorScheme {
var navigationBarAppearance: UINavigationBarAppearance {
switch self {
case .web:
UIBarButtonItem.appearance().tintColor = .white
let navBarAppearance = UINavigationBarAppearance()
navBarAppearance.backgroundImage = UIImage(named: "WebBrowserBarBackground")
navBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
navBarAppearance.backgroundColor = UIColor(red: 0.19, green: 0.05, blue: 0.48, alpha: 1.00)
return navBarAppearance
default:
let navBarAppearance = UINavigationBarAppearance()
Expand Down
16 changes: 13 additions & 3 deletions Sources/ShopifyCheckout/CheckoutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,19 @@ class CheckoutViewController: UIViewController, UIAdaptivePresentationController

private let checkoutURL: URL

private lazy var closeBarButtonItem = UIBarButtonItem(
barButtonSystemItem: .close, target: self, action: #selector(close)
)
private lazy var closeBarButtonItem: UIBarButtonItem = {
switch ShopifyCheckout.configuration.colorScheme {
case .web:
let closeIcon = UIImage(systemName: "xmark")?
.withConfiguration(UIImage.SymbolConfiguration(pointSize: 14, weight: .regular))
.withTintColor(.white, renderingMode: .alwaysOriginal)
return UIBarButtonItem(image: closeIcon, style: .plain, target: self, action: #selector(close))
default:
return UIBarButtonItem(
barButtonSystemItem: .close, target: self, action: #selector(close)
)
}
}()

// MARK: Initializers

Expand Down

0 comments on commit 38f217c

Please sign in to comment.