-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reader: Logged-out experience #23781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c40cb22
Remove remaining isLoggedIn usages from ReaderStreamVC
kean fd1959c
Fix alignment of Reader expand/collapse buttons
kean 374d5a6
Make isCompact private
kean c5f436b
Reset Reader selection state on logout
kean d8178c4
Add logged-out experience for iPhone
kean eaf0dcd
Hide Reader, Notifications on iPad
kean 63bd2f6
Revert pbxproj change
kean File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
36 changes: 36 additions & 0 deletions
36
WordPress/Classes/ViewRelated/Reader/Controllers/ReaderLoggedOutViewController.swift
This file contains hidden or 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,36 @@ | ||
| import UIKit | ||
| import SwiftUI | ||
| import WordPressUI | ||
|
|
||
| final class ReaderLoggedOutViewController: UIViewController { | ||
| override func viewDidLoad() { | ||
| super.viewDidLoad() | ||
|
|
||
| view.backgroundColor = .systemBackground | ||
|
|
||
| let stateView = UIHostingView(view: EmptyStateView { | ||
| Label(Strings.title, systemImage: "person.crop.circle.badge.plus") | ||
| } description: { | ||
| Text(Strings.details) | ||
| } actions: { | ||
| Button(Strings.signIn) { [weak self] in | ||
| self?.buttonSignInTapped() | ||
| }.buttonStyle(.primary) | ||
| }) | ||
|
|
||
| view.addSubview(stateView) | ||
| stateView.pinEdges() | ||
| } | ||
|
|
||
| private func buttonSignInTapped() { | ||
| Task { | ||
| await WordPressDotComAuthenticator().signIn(from: self, context: .default) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| private enum Strings { | ||
| static let title = NSLocalizedString("reader.loggedOut.title", value: "Join the conversation", comment: "Reader logged-out screen title") | ||
| static let details = NSLocalizedString("reader.loggedOut.details", value: "Sign in with a WordPress.com account to follow your favorite blogs", comment: "Reader logged-out screen details") | ||
| static let signIn = NSLocalizedString("reader.loggedOut.signIn", value: "Sign In", comment: "Reader logged-out screen sign in button") | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for not using
UIHostingViewController, which may require less set up code?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason is this:
I needed a reference to the containing
UIViewControllerto have something I could start the login from. There are other ways to workaround this, but I found this to be the least worst.