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-2672 Add redeem deadline warning #2673

Merged
merged 3 commits into from
Sep 15, 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
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ extension ClaimTokensViewController: UITableViewDelegate, UITableViewDataSource
inputAmount = cell.value
claimButton.isEnabled = (error == nil) && claimButtonEnabled
}
cell.set(redeemDeadlineLabelVisible: !data.isRedeemed)
return cell

case .selectedDelegate:
Expand All @@ -384,6 +385,8 @@ extension ClaimTokensViewController: UITableViewDelegate, UITableViewDataSource

var totalValue: String
var availableRange: Range<Sol.UInt128>

var isRedeemed: Bool
}

func displayValues(from claimData: ClaimingAppController.ClaimingData) -> DisplayValues {
Expand All @@ -409,6 +412,8 @@ extension ClaimTokensViewController: UITableViewDelegate, UITableViewDataSource
)
}

let isRedeemed = claimData.isRedeemed

// components and total of vested amount
let userVestedAmount: Sol.UInt128? = claimData.availableAmount(for: userAllocation, at: timestamp)
let ecoVestedAmount: Sol.UInt128? = claimData.availableAmount(for: ecosystemAllocation, at: timestamp)
Expand Down Expand Up @@ -486,7 +491,8 @@ extension ClaimTokensViewController: UITableViewDelegate, UITableViewDataSource
unvestedAmountTooltip: unvestedAmountTooltip,
unvestedStyle: lightBoxStyle,
totalValue: allocationText,
availableRange: availableRange
availableRange: availableRange,
isRedeemed: isRedeemed
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import UIKit
class ClaimedAmountInputCell: UITableViewCell {
@IBOutlet private weak var titleLabel: UILabel!
@IBOutlet private weak var descriptionLabel: UILabel!
@IBOutlet private weak var redeemWarningLabel: UILabel!
@IBOutlet private weak var amountTextField: TokenAmountField!
private var maxButton: UIButton!


private let fieldDelegate = TokenAmountTextDelegate()

var didEndValidating: (_ error: String?) -> Void = { _ in } {
Expand Down Expand Up @@ -44,6 +46,8 @@ class ClaimedAmountInputCell: UITableViewCell {
descriptionLabel.text = "Select all tokens or custom amount."
descriptionLabel.setStyle(.secondary)

redeemWarningLabel.setStyle(.footnote2.color(UIColor(hex: "#B2BBC0")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be its own style? smallprint for example?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used in two places already:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Label style is defined in figma as footnote2 with #B2BBC0 color. Let's revisit this later if we have more usages of this style and color combination. cc @TanyaEfremova


amountTextField.setToken(image: UIImage(named: "ico-safe-token-logo-circle"))

maxButton = UIButton(type: .custom)
Expand All @@ -61,6 +65,9 @@ class ClaimedAmountInputCell: UITableViewCell {
fieldDelegate.setMaxValue()
}

func set(redeemDeadlineLabelVisible: Bool) {
redeemWarningLabel.isHidden = !redeemDeadlineLabelVisible
}
}

import Solidity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,35 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="177" id="KGk-i7-Jjw" customClass="ClaimedAmountInputCell" customModule="Multisig" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="342" height="177"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="269" id="KGk-i7-Jjw" customClass="ClaimedAmountInputCell" customModule="Multisig" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="342" height="269"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="342" height="177"/>
<rect key="frame" x="0.0" y="0.0" width="342" height="269"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="ZwF-jm-pAN">
<rect key="frame" x="16" y="16" width="310" height="153"/>
<rect key="frame" x="16" y="16" width="310" height="245"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="fa3-MW-662">
<rect key="frame" x="0.0" y="0.0" width="310" height="81"/>
<rect key="frame" x="0.0" y="0.0" width="310" height="49"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="How much you want to claim?" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0Yd-3F-yKi">
<rect key="frame" x="0.0" y="0.0" width="310" height="52.5"/>
<rect key="frame" x="0.0" y="0.0" width="310" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Select all tokens or custom amount. " lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WT8-h6-7ZD">
<rect key="frame" x="0.0" y="60.5" width="310" height="20.5"/>
<rect key="frame" x="0.0" y="28.5" width="310" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="b8F-4l-TfE">
<rect key="frame" x="0.0" y="97" width="310" height="56"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="b8F-4l-TfE">
<rect key="frame" x="0.0" y="65" width="310" height="180"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wzZ-3z-4pk" customClass="TokenAmountField" customModule="Multisig" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="310" height="56"/>
Expand All @@ -48,9 +48,19 @@
<constraint firstAttribute="height" constant="56" placeholder="YES" id="9Tl-rl-PPN"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UM1-DA-GJh">
<rect key="frame" x="0.0" y="64" width="310" height="116"/>
<string key="text">Execute at least one claim of any amount of tokens until 27.12.22 10:00 CET or your allocation will be transferred back to the SafeDAO treasury.</string>
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
<constraints>
<constraint firstItem="b8F-4l-TfE" firstAttribute="top" secondItem="ZwF-jm-pAN" secondAttribute="top" constant="65" id="MOR-kw-yon"/>
</constraints>
</stackView>
</subviews>
<constraints>
Expand All @@ -64,9 +74,10 @@
<connections>
<outlet property="amountTextField" destination="wzZ-3z-4pk" id="Qxy-U3-rOx"/>
<outlet property="descriptionLabel" destination="WT8-h6-7ZD" id="Q2T-N7-YZV"/>
<outlet property="redeemWarningLabel" destination="UM1-DA-GJh" id="CGK-ve-A1h"/>
<outlet property="titleLabel" destination="0Yd-3F-yKi" id="PFo-Co-mpS"/>
</connections>
<point key="canvasLocation" x="147.82608695652175" y="175.78125"/>
<point key="canvasLocation" x="147.82608695652175" y="206.58482142857142"/>
</tableViewCell>
</objects>
<resources>
Expand Down