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

Gh 2591/what is safe token #2618

Merged
merged 10 commits into from
Sep 7, 2022
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
30 changes: 23 additions & 7 deletions Multisig.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
0476915D2464034D00D73D8B /* Safe+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0476915B2464034D00D73D8B /* Safe+CoreDataClass.swift */; };
0478383A28C68E7300459F9B /* BorderedCheveronButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0478383928C68E7300459F9B /* BorderedCheveronButton.swift */; };
0478383C28C68E8200459F9B /* BorderedCheveronButton.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0478383B28C68E8200459F9B /* BorderedCheveronButton.xib */; };
0478383F28C699BA00459F9B /* WhatIsSafeTokenViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0478383D28C699BA00459F9B /* WhatIsSafeTokenViewController.swift */; };
0478384028C699BA00459F9B /* WhatIsSafeTokenViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0478383E28C699BA00459F9B /* WhatIsSafeTokenViewController.xib */; };
047A5B8F28A54FCB00BB8B2A /* SafeClaimingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047A5B8E28A54FCB00BB8B2A /* SafeClaimingService.swift */; };
047A5B9128A5582F00BB8B2A /* GuardiansRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047A5B9028A5582F00BB8B2A /* GuardiansRequest.swift */; };
048643B124DAB5D6003DD966 /* RegisterNotificationTokenRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048643B024DAB5D6003DD966 /* RegisterNotificationTokenRequest.swift */; };
Expand Down Expand Up @@ -174,6 +176,8 @@
04D1322E25E41E560032FA03 /* RejectionCreatedPiece.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04D131D925E416FC0032FA03 /* RejectionCreatedPiece.xib */; };
04D1323525E43C560032FA03 /* DetailRejectionInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D1323325E43C550032FA03 /* DetailRejectionInfoCell.swift */; };
04D1323625E43C560032FA03 /* DetailRejectionInfoCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04D1323425E43C550032FA03 /* DetailRejectionInfoCell.xib */; };
04D224B428C8B4FF00853E34 /* DetailedInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D224B228C8B4FF00853E34 /* DetailedInfoViewController.swift */; };
04D224B528C8B4FF00853E34 /* DetailedInfoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04D224B328C8B4FF00853E34 /* DetailedInfoViewController.xib */; };
04D968D4276B872D00CE4A9E /* TransactionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D968D2276B872D00CE4A9E /* TransactionViewController.swift */; };
04D968D5276B872D00CE4A9E /* TransactionViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 04D968D3276B872D00CE4A9E /* TransactionViewController.xib */; };
04E4CD65277752A500B558F4 /* TokenAmountInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E4CD64277752A500B558F4 /* TokenAmountInfoView.swift */; };
Expand Down Expand Up @@ -1060,6 +1064,8 @@
0476915B2464034D00D73D8B /* Safe+CoreDataClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Safe+CoreDataClass.swift"; sourceTree = "<group>"; };
0478383928C68E7300459F9B /* BorderedCheveronButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BorderedCheveronButton.swift; sourceTree = "<group>"; };
0478383B28C68E8200459F9B /* BorderedCheveronButton.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BorderedCheveronButton.xib; sourceTree = "<group>"; };
0478383D28C699BA00459F9B /* WhatIsSafeTokenViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhatIsSafeTokenViewController.swift; sourceTree = "<group>"; };
0478383E28C699BA00459F9B /* WhatIsSafeTokenViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = WhatIsSafeTokenViewController.xib; sourceTree = "<group>"; };
047A5B8E28A54FCB00BB8B2A /* SafeClaimingService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafeClaimingService.swift; sourceTree = "<group>"; };
047A5B9028A5582F00BB8B2A /* GuardiansRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuardiansRequest.swift; sourceTree = "<group>"; };
048643B024DAB5D6003DD966 /* RegisterNotificationTokenRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterNotificationTokenRequest.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1121,6 +1127,8 @@
04D131DA25E416FC0032FA03 /* RejectionCreatedPiece.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RejectionCreatedPiece.swift; sourceTree = "<group>"; };
04D1323325E43C550032FA03 /* DetailRejectionInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailRejectionInfoCell.swift; sourceTree = "<group>"; };
04D1323425E43C550032FA03 /* DetailRejectionInfoCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DetailRejectionInfoCell.xib; sourceTree = "<group>"; };
04D224B228C8B4FF00853E34 /* DetailedInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailedInfoViewController.swift; sourceTree = "<group>"; };
04D224B328C8B4FF00853E34 /* DetailedInfoViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DetailedInfoViewController.xib; sourceTree = "<group>"; };
04D968D2276B872D00CE4A9E /* TransactionViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionViewController.swift; sourceTree = "<group>"; };
04D968D3276B872D00CE4A9E /* TransactionViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TransactionViewController.xib; sourceTree = "<group>"; };
04E4CD64277752A500B558F4 /* TokenAmountInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokenAmountInfoView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2074,12 +2082,18 @@
0472B2B32869D5480049BA17 /* ClaimToken */ = {
isa = PBXGroup;
children = (
938D326E28C8808D00198B7E /* NavigatingDAOViewController.swift */,
938D326F28C8808D00198B7E /* NavigatingDAOViewController.xib */,
0472B2B12869D3510049BA17 /* ClaimSafeTokenFlow.swift */,
93C38DBF28C74CAA005188EC /* WhatIsSafeViewController.swift */,
93C38DC028C74CAA005188EC /* WhatIsSafeViewController.xib */,
04FEFE7E28C6304B0028A349 /* TokenDistributionViewController.swift */,
04FEFE7F28C6304B0028A349 /* TokenDistributionViewController.xib */,
0478383D28C699BA00459F9B /* WhatIsSafeTokenViewController.swift */,
0478383E28C699BA00459F9B /* WhatIsSafeTokenViewController.xib */,
938D326E28C8808D00198B7E /* NavigatingDAOViewController.swift */,
938D326F28C8808D00198B7E /* NavigatingDAOViewController.xib */,
04FEFE7A28C5FD570028A349 /* LegalDisclaimerViewController.swift */,
04FEFE7B28C5FD570028A349 /* LegalDisclaimerViewController.xib */,
6A6A105B2889A2B700B852D5 /* Views */,
0472B2B12869D3510049BA17 /* ClaimSafeTokenFlow.swift */,
0472B2B82869D66A0049BA17 /* ChooseDelegateIntroViewController.swift */,
0472B2B92869D66A0049BA17 /* ChooseDelegateIntroViewController.xib */,
0472B2C0286A49470049BA17 /* Select Guardian */,
Expand All @@ -2097,10 +2111,8 @@
045DBCF4289AF40D003C910C /* ReviewClaimSafeTokenTransactionViewController.swift */,
0A50DBDA28C898A900C0CEC6 /* ReviewClaimTokensHeaderCell.swift */,
0A50DBDB28C898A900C0CEC6 /* ReviewClaimTokensHeaderCell.xib */,
04FEFE7A28C5FD570028A349 /* LegalDisclaimerViewController.swift */,
04FEFE7B28C5FD570028A349 /* LegalDisclaimerViewController.xib */,
04FEFE7E28C6304B0028A349 /* TokenDistributionViewController.swift */,
04FEFE7F28C6304B0028A349 /* TokenDistributionViewController.xib */,
04D224B228C8B4FF00853E34 /* DetailedInfoViewController.swift */,
04D224B328C8B4FF00853E34 /* DetailedInfoViewController.xib */,
);
path = ClaimToken;
sourceTree = "<group>";
Expand Down Expand Up @@ -4388,6 +4400,7 @@
0A9E8E7825B9CA4200256AD3 /* BannerTableViewCell.xib in Resources */,
0A045075278DACBD00650F71 /* AmountAndValuePiece.xib in Resources */,
0AF1C8AB2541AE0600E28669 /* LoadingView.xib in Resources */,
04D224B528C8B4FF00853E34 /* DetailedInfoViewController.xib in Resources */,
0422007025EFDF4E00CAC173 /* TagView.xib in Resources */,
0A93DD662445CC8B00688050 /* LaunchScreen.storyboard in Resources */,
6AFD26ED2861B0DE00336FFE /* SafeTokenBanner.xib in Resources */,
Expand Down Expand Up @@ -4466,6 +4479,7 @@
0AF1C88E2541AD4200E28669 /* ScrollableEmptyView.xib in Resources */,
0A9366AD278F0175001918A9 /* ContainerTableViewCell.xib in Resources */,
0A74EEFE268DF37100EB0EFB /* RibbonViewController.xib in Resources */,
0478384028C699BA00459F9B /* WhatIsSafeTokenViewController.xib in Resources */,
0AC60C572549AF3900A63AE2 /* NoSafeBarView.xib in Resources */,
5562DD722693425E00B56722 /* NetworkIndicatorHeaderView.xib in Resources */,
0A8AEB2125A4764F002A3FE1 /* ActionDetailAddressCell.xib in Resources */,
Expand Down Expand Up @@ -4968,6 +4982,7 @@
0ACDBFFD248E4C5D002035A2 /* Configuration.swift in Sources */,
0A9A1A38257924C600B44405 /* DetailMultiAccountsCell.swift in Sources */,
04C5DF6B26FB451B0072476C /* KeyTypeTableViewCell.swift in Sources */,
04D224B428C8B4FF00853E34 /* DetailedInfoViewController.swift in Sources */,
0A106289248A892B00C1EE54 /* ERC721Metadata.swift in Sources */,
0A5C0C542818204F0061D96F /* EditConfirmationsViewController.swift in Sources */,
0A451C00252DDB67001DB7D2 /* ReloadButton.swift in Sources */,
Expand All @@ -4986,6 +5001,7 @@
0471B3BD262742CD001F2D3B /* UpdateAppViewController.swift in Sources */,
0AFD9DCC27BFE18800011CF1 /* SignatureRequestContentViewController.swift in Sources */,
55CEFC2024939525003B2B19 /* TrackingEvent.swift in Sources */,
0478383F28C699BA00459F9B /* WhatIsSafeTokenViewController.swift in Sources */,
0ADD19A6265E53BE00EB0F2B /* QRCodeView.swift in Sources */,
04D968D4276B872D00CE4A9E /* TransactionViewController.swift in Sources */,
6A6A10592889496100B852D5 /* ClaimGetStartedViewController.swift in Sources */,
Expand Down
6 changes: 6 additions & 0 deletions Multisig/UI/App/ViewControllerFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ enum ViewControllerFactory {
return UINavigationController(rootViewController: vc)
}

static func detailedInfoViewController(title: String, text: String?, attributedText: NSAttributedString?) -> DetailedInfoViewController {
let controller = DetailedInfoViewController(title: title, text: text, attributedText: attributedText)

return controller
}

static func addOwnerViewController(completion: @escaping () -> Void) -> UIViewController {
let controller = AddOwnerKeyViewController(completion: completion)
let nav = AddKeyNavigationController(rootViewController: controller)
Expand Down
24 changes: 22 additions & 2 deletions Multisig/UI/ClaimToken/ClaimSafeTokenFlow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ class ClaimSafeTokenFlow: UIFlow {

func showTokenDistribution() {
let vc = factory.chooseTokenDistribution { [unowned self] in
showWhatIsSafeToken()
}
show(vc)
}

func showWhatIsSafeToken() {
let vc = factory.whatIsSafeToken { [unowned self] in
showNavigatingDAO()
}
show(vc)
Expand Down Expand Up @@ -259,6 +266,14 @@ class ClaimSafeTokenFlowFactory {
return vc
}

func tokenDistribution(onNext: @escaping () -> ()) -> TokenDistributionViewController {
TokenDistributionViewController(onNext: onNext)
}

func whatIsSafe(onNext: @escaping () -> ()) -> WhatIsSafeViewController {
WhatIsSafeViewController(onNext: onNext)
}

func claimNotAvailable() -> ClaimNotAvailableViewController {
let vc = ClaimNotAvailableViewController()
return vc
Expand All @@ -284,8 +299,8 @@ class ClaimSafeTokenFlowFactory {
return vc
}

func chooseWhatIsSafe(completion: @escaping () -> ()) -> WhatIsSafeViewController {
let vc = WhatIsSafeViewController(completion: completion)
func chooseWhatIsSafe(onNext: @escaping () -> ()) -> WhatIsSafeViewController {
let vc = WhatIsSafeViewController(onNext: onNext)
return vc
}

Expand All @@ -294,6 +309,11 @@ class ClaimSafeTokenFlowFactory {
return vc
}

func whatIsSafeToken(onNext: @escaping () -> ()) -> WhatIsSafeTokenViewController {
let vc = WhatIsSafeTokenViewController(onNext: onNext)
return vc
}

func selectAmount(safe: Safe, delegate: Address?, guardian: Guardian?, controller: ClaimingAppController) -> ClaimTokensViewController {
let vc = ClaimTokensViewController(tokenDelegate: delegate, guardian: guardian, safe: safe, controller: controller)
return vc
Expand Down
34 changes: 34 additions & 0 deletions Multisig/UI/ClaimToken/DetailedInfoViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// DetailedInfoViewController.swift
// Multisig
//
// Created by Mouaz on 9/7/22.
// Copyright © 2022 Gnosis Ltd. All rights reserved.
//

import UIKit

class DetailedInfoViewController: UIViewController {
@IBOutlet weak var contentLabel: UILabel!
private var titleText: String!
private var text: String?
private var attributedText: NSAttributedString?

convenience init (title: String, text: String?, attributedText: NSAttributedString?) {
self.init(namedClass: DetailedInfoViewController.self)
self.titleText = title
self.text = text
self.attributedText = attributedText
}
override func viewDidLoad() {
super.viewDidLoad()

contentLabel.setStyle(.secondary)
title = titleText

contentLabel.text = text
if let attributedText = attributedText {
contentLabel.attributedText = attributedText
}
}
}
59 changes: 59 additions & 0 deletions Multisig/UI/ClaimToken/DetailedInfoViewController.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="20037" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="20020"/>
<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"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="DetailedInfoViewController" customModule="Multisig" customModuleProvider="target">
<connections>
<outlet property="contentLabel" destination="b9a-3R-pzx" id="wK2-7h-u9G"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ef1-cJ-Jvn">
<rect key="frame" x="0.0" y="44" width="414" height="818"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="b9a-3R-pzx">
<rect key="frame" x="16" y="20" width="382" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="b9a-3R-pzx" firstAttribute="leading" secondItem="6IO-yc-J4w" secondAttribute="leading" constant="16" id="IjO-3n-IfH"/>
<constraint firstItem="6IO-yc-J4w" firstAttribute="trailing" secondItem="b9a-3R-pzx" secondAttribute="trailing" constant="16" id="dvv-5S-hgY"/>
<constraint firstItem="b9a-3R-pzx" firstAttribute="top" secondItem="ilX-K6-aAf" secondAttribute="top" constant="20" id="muf-OX-uAS"/>
<constraint firstItem="b9a-3R-pzx" firstAttribute="bottom" secondItem="ilX-K6-aAf" secondAttribute="bottom" constant="-20" id="tbi-s2-mlp"/>
</constraints>
<viewLayoutGuide key="contentLayoutGuide" id="ilX-K6-aAf"/>
<viewLayoutGuide key="frameLayoutGuide" id="6IO-yc-J4w"/>
</scrollView>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="ef1-cJ-Jvn" secondAttribute="bottom" id="6Sk-2T-dQu"/>
<constraint firstItem="ef1-cJ-Jvn" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="Fn7-NT-T7t"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="ef1-cJ-Jvn" secondAttribute="trailing" id="eob-fE-o4g"/>
<constraint firstItem="ef1-cJ-Jvn" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="rlZ-sj-v9c"/>
</constraints>
<point key="canvasLocation" x="137.68115942028987" y="87.723214285714278"/>
</view>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
2 changes: 1 addition & 1 deletion Multisig/UI/ClaimToken/LegalDisclaimerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LegalDisclaimerViewController: UIViewController {
ViewControllerFactory.removeNavigationBarBorder(self)
navigationItem.largeTitleDisplayMode = .never

title = "Legal Disclaimer"
navigationItem.title = "Legal Disclaimer"
agreeButton.setText("Agree & Continue", .filled)
textLabel.attributedText = "This app is for our community to encourage Safe ecosystem contributors and users to unlock SafeDAO governance.\nTHIS APP IS PROVIDED “AS IS” AND “AS AVAILABLE,” AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.\nWe will not be liable for any loss, whether such loss is direct, indirect, special or consequential, suffered by any party as a result of their use of this app.\nBy accessing this app, you represent and warrant:\n- that you are of legal age and that you will comply with any laws applicable to you and not engage in any illegal activities;\n- that you are claiming Safe tokens to participate in the SafeDAO governance process and that they do not represent consideration for past or future services;\n- that you, the country you are a resident of and your wallet address is not on any sanctions lists maintained by the United Nations, Switzerland, the EU, UK or the US;\n- that you are responsible for any tax obligations arising out of the interaction with this app.\n\nNone of the information available on this app, or made otherwise available to you in relation to its use, constitutes any legal, tax, financial or other advice. Where in doubt as to the action you should take, please consult your own legal, financial, tax or other professional advisors.".highlightRange(
originalStyle: .secondary,
Expand Down
Loading