Skip to content
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

MOB-1983 - Updated UI of final onboarding screen #511

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ struct CryptoSender: CryptoSenderProtocol {

let wallet: UDWallet

func canSendCrypto(token: CryptoSender.SupportedToken, chainType: BlockchainType) -> Bool {
func canSendCrypto(token: CryptoSender.SupportedToken, chain: ChainSpec) -> Bool {
true
}

func sendCrypto(crypto: CryptoSendingSpec, chain: ChainSpec, toAddress: HexAddress) async throws -> String {
""
}

func computeGasFeeFrom(maxCrypto: CryptoSendingSpec, on chain: ChainSpec, toAddress: HexAddress) async throws -> EVMTokenAmount {
func computeGasFeeFrom(maxCrypto: CryptoSendingSpec, on chain: ChainSpec, toAddress: HexAddress) async throws -> EVMCoinAmount {
.init(wei: 12300)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
2917EDDF2A6F25AB004EAB31 /* Web3PromiseKit in Frameworks */ = {isa = PBXBuildFile; productRef = 2917EDDE2A6F25AB004EAB31 /* Web3PromiseKit */; };
291A9C6A29E444CF00527FF1 /* WC_v1+v2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 291A9C6929E444CF00527FF1 /* WC_v1+v2.swift */; };
291AD2452BD5265E006B8096 /* EVMCryptoSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = 291AD2442BD5265E006B8096 /* EVMCryptoSender.swift */; };
291AD2462BD5265E006B8096 /* EVMCryptoSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = 291AD2442BD5265E006B8096 /* EVMCryptoSender.swift */; };
291AD2472BD5265E006B8096 /* EVMCryptoSender.swift in Sources */ = {isa = PBXBuildFile; fileRef = 291AD2442BD5265E006B8096 /* EVMCryptoSender.swift */; };
295506F02954D14400EDA42D /* WCConnectedAppsStorageV2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 295506EF2954D14400EDA42D /* WCConnectedAppsStorageV2.swift */; };
2959AC4729A61916006387DD /* UDWallet+SigningTransaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2959AC4629A61916006387DD /* UDWallet+SigningTransaction.swift */; };
296BB61F2A309DD90068EEEC /* Encrypting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 296BB61E2A309DD90068EEEC /* Encrypting.swift */; };
Expand Down Expand Up @@ -9922,7 +9920,6 @@
C66FFD052B01E2EE00988A6F /* CoreDataMessagingStorageServiceTests.swift in Sources */,
C617CFA82B9EDA2F00663516 /* TestableWalletNFTsService.swift in Sources */,
C60610E829A7469A005DC0D5 /* WCRequestsHandlingServiceTests.swift in Sources */,
291AD2462BD5265E006B8096 /* EVMCryptoSender.swift in Sources */,
C6DF9875290F83020098733A /* UnsConfigManagerTests.swift in Sources */,
C6DF986B290F83020098733A /* WalletAutonamingTests.swift in Sources */,
C6DF9871290F83020098733A /* ResolutionInitTests.swift in Sources */,
Expand Down Expand Up @@ -10313,7 +10310,6 @@
C6D646A82B1ED15A00D724AC /* PublicProfileCryptoListView.swift in Sources */,
C630E4AD2B7F4B8D008F3269 /* FlippedUpsideDownModifier.swift in Sources */,
C6D646E22B1ED49D00D724AC /* TableViewSelectionCell.swift in Sources */,
291AD2472BD5265E006B8096 /* EVMCryptoSender.swift in Sources */,
C6FBCAA32B91C6AC00BA39DF /* HomeExploreRecentProfilesSectionView.swift in Sources */,
C6C8F8262B217CDD00A9834D /* UDWallet+RecoveryType.swift in Sources */,
C6D647182B1ED83800D724AC /* CollectionTextFooterReusableView.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22155" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22131"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand Down Expand Up @@ -35,29 +35,10 @@
</connections>
</button>
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="Cqb-Qe-4Vj">
<rect key="frame" x="16" y="672" width="358" height="60"/>
<rect key="frame" x="16" y="699" width="358" height="33"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Av5-8E-VN5">
<rect key="frame" x="0.0" y="0.0" width="277" height="60"/>
<subviews>
<view contentMode="scaleToFill" horizontalHuggingPriority="251" placeholderIntrinsicWidth="20" placeholderIntrinsicHeight="20" translatesAutoresizingMaskIntoConstraints="NO" id="0Ed-WU-IVh" customClass="UDCheckBox" customModule="domains_manager_ios" customModuleProvider="target">
<rect key="frame" x="10" y="10" width="257" height="40"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<connections>
<action selector="didTapSwitch:" destination="Y6W-OH-hqX" eventType="valueChanged" id="Ea2-AS-DVv"/>
</connections>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="0Ed-WU-IVh" secondAttribute="trailing" constant="10" id="GYO-0e-Jfg"/>
<constraint firstItem="0Ed-WU-IVh" firstAttribute="top" secondItem="Av5-8E-VN5" secondAttribute="top" constant="10" id="WQS-8F-oZ8"/>
<constraint firstAttribute="bottom" secondItem="0Ed-WU-IVh" secondAttribute="bottom" constant="10" id="kbl-ax-c9i"/>
<constraint firstItem="0Ed-WU-IVh" firstAttribute="leading" secondItem="Av5-8E-VN5" secondAttribute="leading" constant="10" id="ue2-AU-C2r"/>
</constraints>
</view>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" text="Agreement" textAlignment="natural" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kO4-gW-kLR">
<rect key="frame" x="277" y="13.666666666666629" width="81" height="33"/>
<rect key="frame" x="0.0" y="0.0" width="358" height="33"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="textColor" systemColor="labelColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
Expand Down Expand Up @@ -126,8 +107,6 @@
<connections>
<outlet property="agreementStackView" destination="Cqb-Qe-4Vj" id="kvQ-FR-1YN"/>
<outlet property="agreementTextView" destination="kO4-gW-kLR" id="Df5-o0-9Pv"/>
<outlet property="checkbox" destination="0Ed-WU-IVh" id="JkQ-D2-m2H"/>
<outlet property="checkboxContainer" destination="Av5-8E-VN5" id="6Im-dX-fuH"/>
<outlet property="confettiImageView" destination="G4f-ZS-o71" id="NfR-0q-rzZ"/>
<outlet property="getStartedButton" destination="4Nx-Hs-8Tp" id="THg-SA-8Ws"/>
<outlet property="subtitleLabel" destination="hVr-d4-qGj" id="5oa-xm-2SU"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ final class HappyEndViewController: BaseViewController {
@IBOutlet private weak var confettiImageView: ConfettiImageView!
@IBOutlet private weak var agreementTextView: UITextView!
@IBOutlet private weak var getStartedButton: MainButton!
@IBOutlet private weak var checkboxContainer: UIView!
@IBOutlet private weak var checkbox: UDCheckBox!
@IBOutlet private weak var agreementStackView: UIStackView!

private let termsOfUseText = String.Constants.termsOfUse.localized()
Expand Down Expand Up @@ -77,22 +75,11 @@ extension HappyEndViewController: HappyEndViewControllerProtocol {

// MARK: - Actions
private extension HappyEndViewController {
@IBAction func didTapSwitch(_ sender: UDCheckBox) {
presenter.agreementSwitchValueChanged(isOn: sender.isOn)
logButtonPressedAnalyticEvents(button: .agreeCheckbox, parameters: [.isOn : String(checkbox.isOn)])
}

@IBAction func didTapGetStartedButton(_ sender: MainButton) {
presenter.actionButtonPressed()
logButtonPressedAnalyticEvents(button: .getStarted)
}

@objc func didTapCheckboxContainer() {
UDVibration.buttonTap.vibrate()
presenter.agreementSwitchValueChanged(isOn: checkbox.isOn)
logButtonPressedAnalyticEvents(button: .agreeCheckbox, parameters: [.isOn : String(checkbox.isOn)])
}

@objc func didTapAgreementTextView(_ tapGesture: UITapGestureRecognizer) {
let point = tapGesture.location(in: agreementTextView)
if let detectedWord = getWordAtPosition(point) {
Expand All @@ -104,8 +91,6 @@ private extension HappyEndViewController {
let url = String.Links.privacyPolicy.url {
logButtonPressedAnalyticEvents(button: .privacyPolicy)
WebViewController.show(in: self, withURL: url)
} else {
didTapCheckboxContainer()
}
}
}
Expand All @@ -127,22 +112,21 @@ private extension HappyEndViewController {
func setup() {
getStartedButton.isEnabled = false
localizeContent()
checkboxContainer.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTapCheckboxContainer)))
agreementTextView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTapAgreementTextView)))

checkbox.accessibilityIdentifier = "Happy End Agree Checkbox"
getStartedButton.accessibilityIdentifier = "Happy End Get Started Button"
}

func localizeContent() {
agreementTextView.isUserInteractionEnabled = true
agreementTextView.textAlignment = .center
agreementTextView.setAttributedTextWith(text: String.Constants.agreeToTUAndPP.localized(),
font: .currentFont(withSize: 14, weight: .medium),
textColor: .foregroundDefault)
textColor: .foregroundSecondary)
agreementTextView.updateAttributesOf(text: termsOfUseText,
textColor: .foregroundAccent)
textColor: .foregroundDefault)
agreementTextView.updateAttributesOf(text: privacyPolicyText,
textColor: .foregroundAccent)
textColor: .foregroundDefault)
}
}

Expand All @@ -162,3 +146,11 @@ extension HappyEndViewController {
actionButtonTitle: String.Constants.goToDomains.localized())
}
}

@available(iOS 17, *)
#Preview {
let vc = HappyEndViewController.instance()
let presenter = OnboardingHappyEndViewPresenter(view: vc)
vc.presenter = presenter
return vc
}
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@

// All done screen
"YOU_ARE_ALL_DONE_TITLE" = "You're all done!";
"YOU_ARE_ALL_DONE_SUBTITLE" = "Manage your Web3 domains on the go";
"YOU_ARE_ALL_DONE_SUBTITLE" = "Manage your NFT domains on the go.";
"GET_STARTED" = "Get started";
"AGREE_TO_TU_AND_PP" = "I agree to the Terms of use and Privacy policy";
"TERMS_OF_USE" = "Terms of use";
"PRIVACY_POLICY" = "Privacy policy";
"AGREE_TO_TU_AND_PP" = "By using Unstoppable App, you agree to accept our\nTerms of Use and Privacy Policy.";
"TERMS_OF_USE" = "Terms of Use";
"PRIVACY_POLICY" = "Privacy Policy";

// Connect wallet
"CONNECT_WALLET_TITLE" = "Import your domains";
Expand Down