Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
No Bug: Add non breaking space for "Learn more" strings. (#2236)
Browse files Browse the repository at this point in the history
  • Loading branch information
iccub authored and jhreis committed Jan 28, 2020
1 parent 79c920e commit cc7fee5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Client/Frontend/NTP/NTPNotificationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ class NTPNotificationViewController: TranslucentBottomSheet {

switch state {
case .getPaidTurnRewardsOn, .getPaidTurnAdsOn:
let learnMore = Strings.learnMore
let learnMore = Strings.learnMore.withNonBreakingSpace
config.bodyText =
(text: "\(Strings.NTP.getPaidToSeeThisImage)\n\(learnMore)",
(text: "\(Strings.NTP.getPaidToSeeThisImage) \(learnMore)",
urlInfo: [learnMore: "learn-more"],
action: { [weak self] action in
self?.learnMoreHandler?()
Expand All @@ -100,10 +100,10 @@ class NTPNotificationViewController: TranslucentBottomSheet {
self?.close()
})
case .gettingPaidAlready:
let learnMore = Strings.learnMore
let learnMore = Strings.learnMore.withNonBreakingSpace

config.bodyText =
(text: "\(Strings.NTP.youArePaidToSeeThisImage)\n\(learnMore)",
(text: "\(Strings.NTP.youArePaidToSeeThisImage) \(learnMore)",
urlInfo: [learnMore: "learn-more"],
action: { [weak self] action in
self?.learnMoreHandler?()
Expand Down
4 changes: 4 additions & 0 deletions Shared/Extensions/StringExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,8 @@ extension String {
attributedString.addAttributes(boldFontAttribute, range: range)
return attributedString
}

public var withNonBreakingSpace: String {
self.replacingOccurrences(of: " ", with: "\u{00a0}")
}
}

0 comments on commit cc7fee5

Please sign in to comment.