diff --git a/ios/MullvadVPN/Coordinators/LocationCoordinator.swift b/ios/MullvadVPN/Coordinators/LocationCoordinator.swift index e62defb9b4e1..ac8d3ef8f982 100644 --- a/ios/MullvadVPN/Coordinators/LocationCoordinator.swift +++ b/ios/MullvadVPN/Coordinators/LocationCoordinator.swift @@ -273,7 +273,7 @@ extension LocationCoordinator: @preconcurrency LocationViewControllerWrapperDele preferredStyle: UIDevice.current.userInterfaceIdiom == .pad ? .alert : .actionSheet ) actionSheet.overrideUserInterfaceStyle = .dark - actionSheet.view.tintColor = UIColor(red: 0.0, green: 0.59, blue: 1.0, alpha: 1) + actionSheet.view.tintColor = .AlertController.tintColor let addCustomListAction = UIAlertAction( title: NSLocalizedString( diff --git a/ios/MullvadVPN/Extensions/UIAlertController+InAppPurchase.swift b/ios/MullvadVPN/Extensions/UIAlertController+InAppPurchase.swift index b94b457b5a67..c7096d91f0c7 100644 --- a/ios/MullvadVPN/Extensions/UIAlertController+InAppPurchase.swift +++ b/ios/MullvadVPN/Extensions/UIAlertController+InAppPurchase.swift @@ -20,20 +20,26 @@ extension UIAlertController { value: "Add Time", comment: "" ) - let alert = UIAlertController(title: localizedString, message: nil, preferredStyle: .actionSheet) + let actionSheet = UIAlertController( + title: localizedString, + message: nil, + preferredStyle: UIDevice.current.userInterfaceIdiom == .pad ? .alert : .actionSheet + ) + actionSheet.overrideUserInterfaceStyle = .dark + actionSheet.view.tintColor = .AlertController.tintColor products.sortedByPrice().forEach { product in guard let localizedTitle = product.customLocalizedTitle else { return } let action = UIAlertAction(title: localizedTitle, style: .default, handler: { _ in - alert.dismiss(animated: true, completion: { + actionSheet.dismiss(animated: true, completion: { didRequestPurchase(product) }) }) action .accessibilityIdentifier = "\(AccessibilityIdentifier.purchaseButton.asString)_\(product.productIdentifier)" - alert.addAction(action) + actionSheet.addAction(action) } let cancelAction = UIAlertAction(title: NSLocalizedString( "PRODUCT_LIST_CANCEL_BUTTON", @@ -42,7 +48,7 @@ extension UIAlertController { comment: "" ), style: .cancel) cancelAction.accessibilityIdentifier = AccessibilityIdentifier.cancelPurchaseListButton.asString - alert.addAction(cancelAction) - return alert + actionSheet.addAction(cancelAction) + return actionSheet } } diff --git a/ios/MullvadVPN/UI appearance/UIColor+Palette.swift b/ios/MullvadVPN/UI appearance/UIColor+Palette.swift index df7c675a415a..6ee04da0455f 100644 --- a/ios/MullvadVPN/UI appearance/UIColor+Palette.swift +++ b/ios/MullvadVPN/UI appearance/UIColor+Palette.swift @@ -144,6 +144,10 @@ extension UIColor { static let selectedColor = successColor } + enum AlertController { + static let tintColor = UIColor(red: 0.0, green: 0.59, blue: 1.0, alpha: 1) + } + // Common colors static let primaryColor = UIColor(red: 0.16, green: 0.30, blue: 0.45, alpha: 1.0) static let secondaryColor = UIColor(red: 0.10, green: 0.18, blue: 0.27, alpha: 1.0)