Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import XCTest
public class ChooseLayoutScreen: ScreenObject {

private let closeButtonGetter: (XCUIApplication) -> XCUIElement = {
$0.buttons["Close"]
$0.buttons["close-button"]
}

private let createBlankPageButtonGetter: (XCUIApplication) -> XCUIElement = {
Expand Down
7 changes: 6 additions & 1 deletion WordPress/Classes/Services/PageCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ class PageCoordinator {

private static func showLayoutPicker(from controller: UIViewController, forBlog blog: Blog, _ completion: @escaping TemplateSelectionCompletion) {
let rootViewController = GutenbergLayoutPickerViewController(blog: blog, completion: completion)
let navigationController = GutenbergLightNavigationController(rootViewController: rootViewController)
let navigationController: UINavigationController
if #available(iOS 26, *) {
navigationController = UINavigationController(rootViewController: rootViewController)
} else {
navigationController = GutenbergLightNavigationController(rootViewController: rootViewController)
}
navigationController.modalPresentationStyle = .pageSheet

controller.present(navigationController, animated: true, completion: nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,9 @@ class CollapsableHeaderViewController: UIViewController, NoResultsViewHost {

// MARK: - Static Helpers
public static func closeButton(target: Any?, action: Selector) -> UIBarButtonItem {
let closeButton = UIButton(frame: CGRect(x: 0, y: 0, width: 30, height: 30))
closeButton.layer.cornerRadius = 15
closeButton.accessibilityLabel = NSLocalizedString("Close", comment: "Dismisses the current screen")
let closeButton = UIBarButtonItem(barButtonSystemItem: .close, target: target, action: action)
closeButton.accessibilityIdentifier = "close-button"
closeButton.setImage(UIImage.gridicon(.crossSmall), for: .normal)
closeButton.addTarget(target, action: action, for: .touchUpInside)

closeButton.tintColor = .secondaryLabel
closeButton.backgroundColor = UIColor { (traitCollection: UITraitCollection) -> UIColor in
if traitCollection.userInterfaceStyle == .dark {
return UIColor.systemFill
} else {
return UIColor.quaternarySystemFill
}
}

return UIBarButtonItem(customView: closeButton)
return closeButton
}

// MARK: - Initializers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ class PreviewDeviceSelectionViewController: UIViewController {

effectView.contentView.pinSubviewToAllEdges(tableView)

tableView.separatorEffect = UIVibrancyEffect(blurEffect: blurEffect)

tableView.register(UITableViewCell.self, forCellReuseIdentifier: "Cell")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,12 @@ extension SiteDesignContentCollectionViewController: CategorySectionTableViewCel
completion: completion
)

let navController = GutenbergLightNavigationController(rootViewController: previewVC)
let navController: UINavigationController
if #available(iOS 26, *) {
navController = UINavigationController(rootViewController: previewVC)
} else {
navController = GutenbergLightNavigationController(rootViewController: previewVC)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This if check is duplicated in a few places. Maybe we can update GutenbergLightNavigationController to only execute the customizing appearance code on pre-iOS 26 devices?

}
navController.modalPresentationStyle = .pageSheet
navigationController?.present(navController, animated: true) {
// deselect so no border is shown on dismissal of the preview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct PostAction: ActionSheetItem {

func makeButton() -> ActionSheetButton {
return ActionSheetButton(
title: NSLocalizedString("Blog post", comment: "Create new Blog Post button title"),
title: Strings.post,
image: UIImage(named: "wpl-posts")?.withRenderingMode(.alwaysTemplate) ?? .init(),
identifier: "blogPostButton",
action: {
Expand All @@ -28,7 +28,7 @@ struct PostFromAudioAction: ActionSheetItem {

func makeButton() -> ActionSheetButton {
return ActionSheetButton(
title: NSLocalizedString("createFAB.postFromAudio", value: "Post from Audio", comment: "Create new Blog Post from Audio button title"),
title: Strings.postFromAudio,
image: .gridicon(.microphone),
identifier: "blogPostFromAudioButton",
action: {
Expand All @@ -46,7 +46,7 @@ struct PageAction: ActionSheetItem {

func makeButton() -> ActionSheetButton {
return ActionSheetButton(
title: NSLocalizedString("Site page", comment: "Create new Site Page button title"),
title: Strings.page,
image: UIImage(named: "wpl-pages")?.withRenderingMode(.alwaysTemplate) ?? .init(),
identifier: "sitePageButton",
action: {
Expand All @@ -55,3 +55,9 @@ struct PageAction: ActionSheetItem {
})
}
}

private enum Strings {
static let post = NSLocalizedString("createSheet.post", value: "Post", comment: "Create Sheet button title")
static let postFromAudio = NSLocalizedString("createSheet.postFromAudio", value: "Post from Audio", comment: "Create Sheet button title")
static let page = NSLocalizedString("createSheet.page", value: "Page", comment: "Create Sheet button title")
}