From 61f90265b24b636903e5d969336f3ed33e6126c5 Mon Sep 17 00:00:00 2001 From: Bruno Muniz Azevedo Filho <bruno@elixxir.io> Date: Wed, 17 Aug 2022 16:52:41 -0300 Subject: [PATCH] Update ui for terms feature --- .../ReportingFeature/FetchBannedList.swift | 2 +- .../Controllers/SettingsController.swift | 4 +-- Sources/Shared/Views/CapsuleButton.swift | 2 +- Sources/TermsFeature/RadioButton.swift | 4 +-- Sources/TermsFeature/RadioTextComponent.swift | 2 +- .../TermsConditionsController.swift | 24 ++++++++++++-- .../TermsFeature/TermsConditionsView.swift | 32 +++++-------------- 7 files changed, 37 insertions(+), 33 deletions(-) diff --git a/Sources/ReportingFeature/FetchBannedList.swift b/Sources/ReportingFeature/FetchBannedList.swift index 4ab2b3ee..2620b15c 100644 --- a/Sources/ReportingFeature/FetchBannedList.swift +++ b/Sources/ReportingFeature/FetchBannedList.swift @@ -18,7 +18,7 @@ public struct FetchBannedList { extension FetchBannedList { public static let live = FetchBannedList { completion in - let url = URL(string: "https://elixxir-bins.s3.us-west-1.amazonaws.com/client/bannedUsers/bannedTesting.csv")! + let url = URL(string: "https://elixxir-bins.s3.us-west-1.amazonaws.com/client/bannedUsers/banned.csv")! let session = URLSession.shared let request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalAndRemoteCacheData) let task = session.dataTask(with: request) { data, response, error in diff --git a/Sources/SettingsFeature/Controllers/SettingsController.swift b/Sources/SettingsFeature/Controllers/SettingsController.swift index 52e78e17..e58a3470 100644 --- a/Sources/SettingsFeature/Controllers/SettingsController.swift +++ b/Sources/SettingsFeature/Controllers/SettingsController.swift @@ -136,7 +136,7 @@ public final class SettingsController: UIViewController { title: Localized.Settings.Drawer.title(Localized.Settings.privacyPolicy), subtitle: Localized.Settings.Drawer.subtitle(Localized.Settings.privacyPolicy), actionTitle: Localized.ChatList.Dashboard.open) { - guard let url = URL(string: "https://xx.network/privategrity-corporation-privacy-policy") else { return } + guard let url = URL(string: "https://elixxir.io/privategrity-corporation-privacy-policy/") else { return } UIApplication.shared.open(url, options: [:]) } }.store(in: &cancellables) @@ -149,7 +149,7 @@ public final class SettingsController: UIViewController { title: Localized.Settings.Drawer.title(Localized.Settings.disclosures), subtitle: Localized.Settings.Drawer.subtitle(Localized.Settings.disclosures), actionTitle: Localized.ChatList.Dashboard.open) { - guard let url = URL(string: "https://xx.network/privategrity-corporation-terms-of-use") else { return } + guard let url = URL(string: "https://elixxir.io/privategrity-corporation-terms-of-use/") else { return } UIApplication.shared.open(url, options: [:]) } }.store(in: &cancellables) diff --git a/Sources/Shared/Views/CapsuleButton.swift b/Sources/Shared/Views/CapsuleButton.swift index 96ef2e09..4d681dc3 100644 --- a/Sources/Shared/Views/CapsuleButton.swift +++ b/Sources/Shared/Views/CapsuleButton.swift @@ -30,7 +30,7 @@ public extension CapsuleButtonStyle { borderWidth: 0, borderColor: nil, titleColor: Asset.brandPrimary.color, - disabledTitleColor: Asset.neutralWhite.color + disabledTitleColor: Asset.neutralWhite.color.withAlphaComponent(0.5) ) static let brandColored = CapsuleButtonStyle( diff --git a/Sources/TermsFeature/RadioButton.swift b/Sources/TermsFeature/RadioButton.swift index 43b873ac..201aa3b9 100644 --- a/Sources/TermsFeature/RadioButton.swift +++ b/Sources/TermsFeature/RadioButton.swift @@ -11,12 +11,12 @@ final class RadioButton: UIControl { containerView.layer.borderWidth = 1 containerView.layer.cornerRadius = 15 containerView.layer.masksToBounds = true - containerView.layer.borderColor = UIColor.gray.cgColor + containerView.layer.borderColor = Asset.neutralWhite.color.cgColor filledView.isHidden = true filledView.layer.cornerRadius = 10 filledView.layer.masksToBounds = true - filledView.backgroundColor = Asset.brandPrimary.color + filledView.backgroundColor = Asset.neutralWhite.color containerView.isUserInteractionEnabled = false filledView.isUserInteractionEnabled = false diff --git a/Sources/TermsFeature/RadioTextComponent.swift b/Sources/TermsFeature/RadioTextComponent.swift index 64c7b1cf..8f6509f2 100644 --- a/Sources/TermsFeature/RadioTextComponent.swift +++ b/Sources/TermsFeature/RadioTextComponent.swift @@ -13,7 +13,7 @@ final class RadioTextComponent: UIView { super.init(frame: .zero) titleLabel.numberOfLines = 0 - titleLabel.textColor = Asset.neutralBody.color + titleLabel.textColor = Asset.neutralWhite.color titleLabel.font = Fonts.Mulish.regular.font(size: 13.0) addSubview(titleLabel) diff --git a/Sources/TermsFeature/TermsConditionsController.swift b/Sources/TermsFeature/TermsConditionsController.swift index b06152ee..b11ef152 100644 --- a/Sources/TermsFeature/TermsConditionsController.swift +++ b/Sources/TermsFeature/TermsConditionsController.swift @@ -31,8 +31,28 @@ public final class TermsConditionsController: UIViewController { public override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) navigationItem.backButtonTitle = "" - statusBarController.style.send(.darkContent) - navigationController?.navigationBar.customize(translucent: true) + navigationController?.navigationBar.customize( + translucent: true, + tint: Asset.neutralWhite.color + ) + } + + public override func viewDidLayoutSubviews() { + super.viewDidLayoutSubviews() + + let gradient = CAGradientLayer() + gradient.colors = [ + UIColor(red: 122/255, green: 235/255, blue: 239/255, alpha: 1).cgColor, + UIColor(red: 56/255, green: 204/255, blue: 232/255, alpha: 1).cgColor, + UIColor(red: 63/255, green: 186/255, blue: 253/255, alpha: 1).cgColor, + UIColor(red: 98/255, green: 163/255, blue: 255/255, alpha: 1).cgColor + ] + + gradient.startPoint = CGPoint(x: 0, y: 0) + gradient.endPoint = CGPoint(x: 1, y: 1) + + gradient.frame = screenView.bounds + screenView.layer.insertSublayer(gradient, at: 0) } public override func viewDidLoad() { diff --git a/Sources/TermsFeature/TermsConditionsView.swift b/Sources/TermsFeature/TermsConditionsView.swift index fb7d1198..2f3ff8fa 100644 --- a/Sources/TermsFeature/TermsConditionsView.swift +++ b/Sources/TermsFeature/TermsConditionsView.swift @@ -2,8 +2,8 @@ import UIKit import Shared final class TermsConditionsView: UIView { - let titleLabel = UILabel() let nextButton = CapsuleButton() + let logoImageView = UIImageView() let showTermsButton = CapsuleButton() let radioComponent = RadioTextComponent() @@ -11,30 +11,15 @@ final class TermsConditionsView: UIView { super.init(frame: .zero) backgroundColor = Asset.neutralWhite.color - let attString = NSMutableAttributedString(string: Localized.Terms.title) - let paragraph = NSMutableParagraphStyle() - paragraph.alignment = .left - paragraph.lineHeightMultiple = 1.15 - - attString.addAttribute(.paragraphStyle, value: paragraph) - attString.addAttribute(.foregroundColor, value: Asset.neutralActive.color) - attString.addAttribute(.font, value: Fonts.Mulish.bold.font(size: 34.0) as Any) - - attString.addAttributes(attributes: [ - .font: Fonts.Mulish.bold.font(size: 34.0) as Any, - .foregroundColor: Asset.brandPrimary.color - ], betweenCharacters: "#") - - titleLabel.numberOfLines = 0 - titleLabel.attributedText = attString - + logoImageView.contentMode = .center + logoImageView.image = Asset.onboardingLogoStart.image radioComponent.titleLabel.text = Localized.Terms.radio nextButton.isEnabled = false - nextButton.set(style: .brandColored, title: Localized.Terms.accept) - showTermsButton.set(style: .seeThrough, title: Localized.Terms.show) + nextButton.set(style: .white, title: Localized.Terms.accept) + showTermsButton.set(style: .seeThroughWhite, title: Localized.Terms.show) - addSubview(titleLabel) + addSubview(logoImageView) addSubview(nextButton) addSubview(radioComponent) addSubview(showTermsButton) @@ -45,10 +30,9 @@ final class TermsConditionsView: UIView { required init?(coder: NSCoder) { nil } private func setupConstraints() { - titleLabel.snp.makeConstraints { + logoImageView.snp.makeConstraints { $0.top.equalTo(safeAreaLayoutGuide).offset(30) - $0.left.equalToSuperview().offset(38) - $0.right.equalToSuperview().offset(-44) + $0.centerX.equalToSuperview() } radioComponent.snp.makeConstraints { -- GitLab