From 7106431156d316c1e5e959388915b7238073d394 Mon Sep 17 00:00:00 2001 From: Kyle Hickinson Date: Fri, 18 Oct 2019 10:08:17 -0400 Subject: [PATCH] Fix #1697: Update empty wallet copy and styling --- .../Localized Strings/Strings.swift | 5 +-- .../Settings/Wallet/WalletDetailsView.swift | 41 +++++-------------- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/BraveRewardsUI/Localized Strings/Strings.swift b/BraveRewardsUI/Localized Strings/Strings.swift index ac0c0591c..208d740f3 100644 --- a/BraveRewardsUI/Localized Strings/Strings.swift +++ b/BraveRewardsUI/Localized Strings/Strings.swift @@ -42,7 +42,7 @@ internal extension Strings { static let AddFundsBody = NSLocalizedString("BraveRewardsAddFundsBody", bundle: Bundle.RewardsUI, value: "Be sure to use the address below that matches the type of crypto you own. It will be converted automatically to BAT by Uphold and appear as an increased balance in your Brave Rewards wallet. Please allow up to one hour for your wallet balance to update.", comment: "") static let Site = NSLocalizedString("BraveRewardsSite", bundle: Bundle.RewardsUI, value: "Site", comment: "") static let TotalSites = NSLocalizedString("BraveRewardsTotalSites", bundle: Bundle.RewardsUI, value: "Total %ld", comment: "") - static let EmptyWalletBulletHeader = NSLocalizedString("BraveRewardsEmptyWalletBulletHeader", bundle: Bundle.RewardsUI, value: "3 ways to fill your wallet:", comment: "") + static let EmptyWalletBody = NSLocalizedString("BraveRewardsEmptyWalletBody", bundle: Bundle.RewardsUI, value: "Watch your balance grow as you view privacy preserving ads through Brave.", comment: "") static let BraveRewards = NSLocalizedString("BraveRewards", bundle: Bundle.RewardsUI, value: "Brave Rewards™", comment: "") static let PublisherSendTip = NSLocalizedString("BraveRewardsPublisherSendTip", bundle: Bundle.RewardsUI, value: "Send a tip…", comment: "") static let TippingWalletBalanceTitle = NSLocalizedString("BraveRewardsTippingWalletBalanceTitle", bundle: Bundle.RewardsUI, value: "wallet balance", comment: "") @@ -53,7 +53,7 @@ internal extension Strings { static let MinimumLengthChoices0 = NSLocalizedString("BraveRewardsMinimumLengthChoices0", bundle: Bundle.RewardsUI, value: "5 seconds", comment: "") static let SettingsAdsTitle = NSLocalizedString("BraveRewardsSettingsAdsTitle", bundle: Bundle.RewardsUI, value: "Ads", comment: "") static let NotificationRecurringTipTitle = NSLocalizedString("BraveRewardsNotificationRecurringTipTitle", bundle: Bundle.RewardsUI, value: "Recurring tips", comment: "") - static let EmptyWalletTitle = NSLocalizedString("BraveRewardsEmptyWalletTitle", bundle: Bundle.RewardsUI, value: "Sadly, no tokens yet.", comment: "") + static let EmptyWalletTitle = NSLocalizedString("BraveRewardsEmptyWalletTitle", bundle: Bundle.RewardsUI, value: "Your wallet is ready for action.", comment: "") static let RecurringTipTitle = NSLocalizedString("BraveRewardsRecurringTipTitle", bundle: Bundle.RewardsUI, value: "Recurring tip", comment: "") static let UnverifiedPublisherDisclaimer = NSLocalizedString("BraveRewardsUnverifiedPublisherDisclaimer", bundle: Bundle.RewardsUI, value: "This creator has not yet signed up to receive contributions from Brave users. Any tips you send will remain in your wallet until they verify.", comment: "") static let SettingsGrantClaimButtonTitle = NSLocalizedString("BraveRewardsSettingsGrantClaimButtonTitle", bundle: Bundle.RewardsUI, value: "Claim", comment: "") @@ -129,7 +129,6 @@ internal extension Strings { static let Remove = NSLocalizedString("BraveRewardsRemove", bundle: Bundle.RewardsUI, value: "Remove", comment: "") static let LearnMoreWhyBody = NSLocalizedString("BraveRewardsLearnMoreWhyBody", bundle: Bundle.RewardsUI, value: "With your old browser, you paid to browse the web by viewing ads with your valuable attention. You spent your valuable time downloading invasive ad technology that transmitted your valuable private data to advertisers — without your consent.\n\nToday, Brave welcomes you to the new Internet. One where your time is valued, your personal data is kept private, and you actually get paid for your attention.", comment: "") static let DisabledEnableButton = NSLocalizedString("BraveRewardsDisabledEnableButton", bundle: Bundle.RewardsUI, value: "Enable Brave Rewards", comment: "") - static let EmptyWalletBulletPoints = NSLocalizedString("BraveRewardsEmptyWalletBulletPoints", bundle: Bundle.RewardsUI, value: "• You can add funds.\n• You can earn tokens from viewing ads.\n• Occasionally, you'll be offered free token grants from Brave. Be sure to keep an eye out for the alert!", comment: "") static let TippingOverviewBody = NSLocalizedString("BraveRewardsTippingOverviewBody", bundle: Bundle.RewardsUI, value: "You can support this content creator by sending a tip. It’s a way of thanking them for making great content. Verified creators get paid for their tips during the first week of each calendar month.\n\nIf you like, you can schedule monthly tips to support this creator on a continuous basis.", comment: "") static let TippingSendTip = NSLocalizedString("BraveRewardsTippingSendTip", bundle: Bundle.RewardsUI, value: "Send my Tip", comment: "") static let TippingSendMonthlyTip = NSLocalizedString("BraveRewardsTippingSendMonthlyTip", bundle: Bundle.RewardsUI, value: "Set monthly tip", comment: "") diff --git a/BraveRewardsUI/Settings/Wallet/WalletDetailsView.swift b/BraveRewardsUI/Settings/Wallet/WalletDetailsView.swift index 203516b9e..08c4bfa76 100644 --- a/BraveRewardsUI/Settings/Wallet/WalletDetailsView.swift +++ b/BraveRewardsUI/Settings/Wallet/WalletDetailsView.swift @@ -66,42 +66,21 @@ extension WalletDetailsViewController.View { let titleLabel = UILabel().then { $0.text = Strings.EmptyWalletTitle $0.appearanceTextColor = SettingsUX.bodyTextColor - $0.font = .systemFont(ofSize: 22.0) + $0.font = .systemFont(ofSize: 22.0, weight: .medium) $0.textAlignment = .center $0.numberOfLines = 0 } - - /// Left-aligned bullet-points stack view - class BulletPointStackView: UIStackView { - override init(frame: CGRect) { - super.init(frame: frame) - axis = .vertical - spacing = 4.0 - alignment = .leading - - addArrangedSubview(UILabel().then { - $0.font = .systemFont(ofSize: 15.0, weight: .medium) - $0.appearanceTextColor = SettingsUX.subtitleTextColor - $0.text = Strings.EmptyWalletBulletHeader - }) - addArrangedSubview(UILabel().then { - $0.font = .systemFont(ofSize: 15.0) - $0.appearanceTextColor = SettingsUX.bodyTextColor - $0.text = Strings.EmptyWalletBulletPoints - $0.numberOfLines = 0 - }) - } - @available(*, unavailable) - required init(coder: NSCoder) { - fatalError() - } + let textLabel = UILabel().then { + $0.font = .systemFont(ofSize: 15.0, weight: .medium) + $0.appearanceTextColor = SettingsUX.subtitleTextColor + $0.textAlignment = .center + $0.text = Strings.EmptyWalletBody + $0.numberOfLines = 0 } - let bulletPointStackView = BulletPointStackView() - addSubview(imageView) addSubview(titleLabel) - addSubview(bulletPointStackView) + addSubview(textLabel) imageView.snp.makeConstraints { $0.centerX.equalToSuperview() @@ -111,10 +90,10 @@ extension WalletDetailsViewController.View { $0.leading.trailing.equalToSuperview().inset(30.0) $0.top.equalTo(imageView.snp.bottom).offset(30.0) } - bulletPointStackView.snp.makeConstraints { + textLabel.snp.makeConstraints { $0.leading.trailing.equalToSuperview().inset(40.0) $0.top.equalTo(titleLabel.snp.bottom).offset(30.0) - $0.bottom.equalToSuperview().inset(20.0) + $0.bottom.equalToSuperview().inset(40.0) } } }