Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit 514ebf1

Browse files
authored
Merge pull request #576 from wordpress-mobile/release/1.35.0
Release 1.35.0 -> trunk
2 parents 14b9724 + 219b9c2 commit 514ebf1

File tree

8 files changed

+29
-18
lines changed

8 files changed

+29
-18
lines changed

WordPressAuthenticator.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "WordPressAuthenticator"
3-
s.version = "1.34.0"
3+
s.version = "1.35.0"
44
s.summary = "WordPressAuthenticator implements an easy and elegant way to authenticate your WordPress Apps."
55

66
s.description = <<-DESC

WordPressAuthenticator/Authenticator/WordPressAuthenticatorDisplayStrings.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public extension WordPressAuthenticatorDisplayStrings {
166166
comment: "The button title text for opening the user's preferred email app."),
167167
createAccountButtonTitle: NSLocalizedString("Create Account",
168168
comment: "The button title text for creating a new account."),
169-
continueWithWPButtonTitle: NSLocalizedString("Continue with WordPress.com",
169+
continueWithWPButtonTitle: NSLocalizedString("Log in or sign up with WordPress.com",
170170
comment: "Button title. Takes the user to the login by email flow."),
171171
enterYourSiteAddressButtonTitle: NSLocalizedString("Enter your existing site address",
172172
comment: "Button title. Takes the user to the login by site address flow."),

WordPressAuthenticator/Extensions/WPStyleGuide+Login.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ extension WPStyleGuide {
184184
return NSAttributedString(attachment: googleAttachment)
185185
} else {
186186
// Create an attributed string that contains the Google icon + button text.
187-
googleAttachment.bounds = CGRect(x: 0, y: (NUXButton.titleFont.capHeight - Constants.googleIconButtonSize) / 2,
187+
let nuxButtonTitleFont = WPStyleGuide.mediumWeightFont(forStyle: .title3)
188+
googleAttachment.bounds = CGRect(x: 0, y: (nuxButtonTitleFont.capHeight - Constants.googleIconButtonSize) / 2,
188189
width: Constants.googleIconButtonSize, height: Constants.googleIconButtonSize)
189190

190191
let buttonString = NSMutableAttributedString(attachment: googleAttachment)

WordPressAuthenticator/NUX/NUXButton.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import WordPressKit
2929
return indicator
3030
}()
3131

32-
static let titleFont = WPStyleGuide.mediumWeightFont(forStyle: .title3)
32+
var titleFont = WPStyleGuide.mediumWeightFont(forStyle: .title3)
3333

3434
override open func layoutSubviews() {
3535
super.layoutSubviews()
@@ -76,6 +76,10 @@ import WordPressKit
7676
func didChangePreferredContentSize() {
7777
titleLabel?.adjustsFontForContentSizeCategory = true
7878
}
79+
80+
func customizeFont(_ font: UIFont) {
81+
titleFont = font
82+
}
7983

8084
/// Indicates if the current instance should be rendered with the "Primary" Style.
8185
///
@@ -158,7 +162,7 @@ import WordPressKit
158162
/// Setup: TitleLabel
159163
///
160164
private func configureTitleLabel() {
161-
titleLabel?.font = NUXButton.titleFont
165+
titleLabel?.font = self.titleFont
162166
titleLabel?.adjustsFontForContentSizeCategory = true
163167
titleLabel?.textAlignment = .center
164168
}

WordPressAuthenticator/NUX/NUXButtonViewController.swift

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ private struct NUXButtonConfig {
1414
let attributedTitle: NSAttributedString?
1515
let socialService: SocialServiceName?
1616
let isPrimary: Bool
17+
let configureBodyFontForTitle: Bool?
1718
let accessibilityIdentifier: String?
1819
let callback: CallBackType?
1920

20-
init(title: String? = nil, attributedTitle: NSAttributedString? = nil, socialService: SocialServiceName? = nil, isPrimary: Bool, accessibilityIdentifier: String? = nil, callback: CallBackType?) {
21+
init(title: String? = nil, attributedTitle: NSAttributedString? = nil, socialService: SocialServiceName? = nil, isPrimary: Bool, configureBodyFontForTitle: Bool? = nil, accessibilityIdentifier: String? = nil, callback: CallBackType?) {
2122
self.title = title
2223
self.attributedTitle = attributedTitle
2324
self.socialService = socialService
2425
self.isPrimary = isPrimary
26+
self.configureBodyFontForTitle = configureBodyFontForTitle
2527
self.accessibilityIdentifier = accessibilityIdentifier
2628
self.callback = callback
2729
}
@@ -79,6 +81,10 @@ open class NUXButtonViewController: UIViewController {
7981

8082
button.accessibilityIdentifier = buttonConfig.accessibilityIdentifier ?? accessibilityIdentifier(for: buttonConfig.title)
8183
button.isPrimary = buttonConfig.isPrimary
84+
if buttonConfig.configureBodyFontForTitle == true {
85+
button.customizeFont(WPStyleGuide.mediumWeightFont(forStyle: .body))
86+
}
87+
8288
button.isHidden = false
8389
} else {
8490
button?.isHidden = true
@@ -107,16 +113,16 @@ open class NUXButtonViewController: UIViewController {
107113
}
108114
}
109115

110-
func setupTopButton(title: String, isPrimary: Bool = false, accessibilityIdentifier: String? = nil, onTap callback: @escaping CallBackType) {
111-
topButtonConfig = NUXButtonConfig(title: title, isPrimary: isPrimary, accessibilityIdentifier: accessibilityIdentifier, callback: callback)
116+
func setupTopButton(title: String, isPrimary: Bool = false, configureBodyFontForTitle: Bool = false, accessibilityIdentifier: String? = nil, onTap callback: @escaping CallBackType) {
117+
topButtonConfig = NUXButtonConfig(title: title, isPrimary: isPrimary, configureBodyFontForTitle: configureBodyFontForTitle, accessibilityIdentifier: accessibilityIdentifier, callback: callback)
112118
}
113119

114120
func setupTopButtonFor(socialService: SocialServiceName, onTap callback: @escaping CallBackType) {
115121
topButtonConfig = buttonConfigFor(socialService: socialService, onTap: callback)
116122
}
117123

118-
func setupBottomButton(title: String, isPrimary: Bool = false, accessibilityIdentifier: String? = nil, onTap callback: @escaping CallBackType) {
119-
bottomButtonConfig = NUXButtonConfig(title: title, isPrimary: isPrimary, accessibilityIdentifier: accessibilityIdentifier, callback: callback)
124+
func setupBottomButton(title: String, isPrimary: Bool = false, configureBodyFontForTitle: Bool = false, accessibilityIdentifier: String? = nil, onTap callback: @escaping CallBackType) {
125+
bottomButtonConfig = NUXButtonConfig(title: title, isPrimary: isPrimary, configureBodyFontForTitle: configureBodyFontForTitle, accessibilityIdentifier: accessibilityIdentifier, callback: callback)
120126
}
121127

122128
func setupButtomButtonFor(socialService: SocialServiceName, onTap callback: @escaping CallBackType) {
@@ -135,7 +141,7 @@ open class NUXButtonViewController: UIViewController {
135141
func hideShadowView() {
136142
shadowView?.isHidden = true
137143
}
138-
144+
139145
// MARK: - Helpers
140146

141147
private func buttonConfigFor(socialService: SocialServiceName, onTap callback: @escaping CallBackType) -> NUXButtonConfig {

WordPressAuthenticator/Signin/LoginPrologueLoginMethodViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class LoginPrologueLoginMethodViewController: NUXViewController {
4949
return
5050
}
5151

52-
let wordpressTitle = NSLocalizedString("Continue with WordPress.com", comment: "Button title. Tapping begins our normal log in process.")
52+
let wordpressTitle = NSLocalizedString("Log in or sign up with WordPress.com", comment: "Button title. Tapping begins our normal log in process.")
5353
buttonViewController.setupTopButton(title: wordpressTitle, isPrimary: false, accessibilityIdentifier: "Log in with Email Button") { [weak self] in
5454

5555
guard let self = self else {
@@ -60,7 +60,7 @@ class LoginPrologueLoginMethodViewController: NUXViewController {
6060
self.dismiss(animated: true)
6161
self.emailTapped?()
6262
}
63-
63+
6464
buttonViewController.setupButtomButtonFor(socialService: .google, onTap: handleGoogleButtonTapped)
6565

6666
if !LoginFields().restrictToWPCom && selfHostedTapped != nil {

WordPressAuthenticator/Signin/LoginPrologueViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,10 @@ class LoginPrologueViewController: LoginViewController {
211211

212212
setButtonViewMargins(forWidth: view.frame.width)
213213

214-
buttonViewController.setupTopButton(title: loginTitle, isPrimary: true, accessibilityIdentifier: "Prologue Continue Button", onTap: loginTapCallback())
214+
buttonViewController.setupTopButton(title: loginTitle, isPrimary: true, configureBodyFontForTitle: true, accessibilityIdentifier: "Prologue Continue Button", onTap: loginTapCallback())
215215

216216
if configuration.enableUnifiedAuth {
217-
buttonViewController.setupBottomButton(title: siteAddressTitle, isPrimary: false, accessibilityIdentifier: "Prologue Self Hosted Button", onTap: siteAddressTapCallback())
217+
buttonViewController.setupBottomButton(title: siteAddressTitle, isPrimary: false, configureBodyFontForTitle: true, accessibilityIdentifier: "Prologue Self Hosted Button", onTap: siteAddressTapCallback())
218218
}
219219

220220
showCancelIfNeccessary(buttonViewController)

WordPressAuthenticator/Unified Auth/View Related/Reusable Views/SpacerTableViewCell.xib

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
77
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
88
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
99
</dependencies>
1010
<objects>
1111
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
1212
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
13-
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="16" id="KGk-i7-Jjw" customClass="SpacerTableViewCell" customModule="WordPressAuthenticator" customModuleProvider="target">
13+
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="SpacerTableViewCell" rowHeight="16" id="KGk-i7-Jjw" userLabel="SpacerTableViewCell" customClass="SpacerTableViewCell" customModule="WordPressAuthenticator">
1414
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
1515
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
1616
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">

0 commit comments

Comments
 (0)