forked from wordpress-mobile/WordPress-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request wordpress-mobile#20812 from wordpress-mobile/task/…
…20762-blaze-campaigns-list-skeleton-ui Blaze Manage Campaigns: Add skeleton UI for the campaigns list screen
- Loading branch information
Showing
4 changed files
with
95 additions
and
4 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
WordPress/Classes/ViewRelated/Blaze Campaigns/BlazeCampaignsViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import UIKit | ||
|
||
final class BlazeCampaignsViewController: UIViewController { | ||
|
||
// MARK: - Views | ||
|
||
private lazy var plusButton: UIBarButtonItem = { | ||
let button = UIBarButtonItem(image: UIImage(systemName: "plus"), | ||
style: .plain, | ||
target: self, | ||
action: #selector(plusButtonTapped)) | ||
return button | ||
}() | ||
|
||
// MARK: - Properties | ||
|
||
private var blog: Blog | ||
|
||
// MARK: - Initializers | ||
|
||
init(blog: Blog) { | ||
self.blog = blog | ||
super.init(nibName: nil, bundle: nil) | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
// This VC is designed to be initialized programmatically. | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
// MARK: - View lifecycle | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
setupView() | ||
setupNavBar() | ||
} | ||
|
||
// MARK: - Private helpers | ||
|
||
private func setupView() { | ||
view.backgroundColor = .DS.Background.primary | ||
} | ||
|
||
private func setupNavBar() { | ||
title = Strings.navigationTitle | ||
navigationItem.rightBarButtonItem = plusButton | ||
} | ||
|
||
@objc private func plusButtonTapped() { | ||
// TODO: Track event | ||
BlazeFlowCoordinator.presentBlaze(in: self, source: .campaignsList, blog: blog) | ||
} | ||
} | ||
|
||
extension BlazeCampaignsViewController { | ||
|
||
private enum Strings { | ||
static let navigationTitle = NSLocalizedString("blaze.campaigns.title", value: "Blaze Campaigns", comment: "Title for the screen that allows users to manage their Blaze campaigns.") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters