-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/adyer/mbl-1965
- Loading branch information
Showing
103 changed files
with
1,537 additions
and
1,274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+163 Bytes
(100%)
...ewControllerTests/testView_CurrentUser_IsBacker.lang_de_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.53 KB
(99%)
...ePledgeViewControllerTests/testView_CurrentUser_IsBacker.lang_en_device_pad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+90 Bytes
(100%)
...ewControllerTests/testView_CurrentUser_IsBacker.lang_es_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.72 KB
(99%)
...ePledgeViewControllerTests/testView_CurrentUser_IsBacker.lang_fr_device_pad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+137 Bytes
(100%)
...ewControllerTests/testView_CurrentUser_IsBacker.lang_ja_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+403 Bytes
(100%)
...cker_LocalPickupsForAddonsAndBaseReward_Success.lang_de_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+84 Bytes
(100%)
...User_IsBacker_LocalPickupsForAddonsAndBaseReward_Success.lang_en_device_pad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+301 Bytes
(100%)
...cker_LocalPickupsForAddonsAndBaseReward_Success.lang_es_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+320 Bytes
(100%)
...User_IsBacker_LocalPickupsForAddonsAndBaseReward_Success.lang_fr_device_pad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+575 Bytes
(100%)
...cker_LocalPickupsForAddonsAndBaseReward_Success.lang_ja_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-260 Bytes
(100%)
...Backer_PledgeOverTime_PaymentSchedule_Collapsed.lang_de_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-223 Bytes
(100%)
...ntUser_IsBacker_PledgeOverTime_PaymentSchedule_Collapsed.lang_en_device_pad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+167 Bytes
(100%)
...Backer_PledgeOverTime_PaymentSchedule_Collapsed.lang_es_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+357 Bytes
(100%)
...ntUser_IsBacker_PledgeOverTime_PaymentSchedule_Collapsed.lang_fr_device_pad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+405 Bytes
(100%)
...Backer_PledgeOverTime_PaymentSchedule_Collapsed.lang_ja_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-275 Bytes
(100%)
...sBacker_PledgeOverTime_PaymentSchedule_Expanded.lang_de_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5 Bytes
(100%)
...entUser_IsBacker_PledgeOverTime_PaymentSchedule_Expanded.lang_en_device_pad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+118 Bytes
(100%)
...sBacker_PledgeOverTime_PaymentSchedule_Expanded.lang_es_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+508 Bytes
(100%)
...entUser_IsBacker_PledgeOverTime_PaymentSchedule_Expanded.lang_fr_device_pad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+330 Bytes
(100%)
...sBacker_PledgeOverTime_PaymentSchedule_Expanded.lang_ja_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-161 Bytes
(100%)
...ests/testView_CurrentUser_IsNotBacker_IsCreator.lang_en_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-381 Bytes
(100%)
...PledgeViewControllerTests/testView_ErroredBacking.lang_de_device_phone4inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-73 Bytes
(100%)
...edgeViewControllerTests/testView_ErroredBacking.lang_en_device_phone4_7inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-97 Bytes
(100%)
...edgeViewControllerTests/testView_ErroredBacking.lang_es_device_phone5_5inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-899 Bytes
(99%)
...edgeViewControllerTests/testView_ErroredBacking.lang_fr_device_phone5_8inch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+303 Bytes
(100%)
.../ManagePledgeViewControllerTests/testView_ErroredBacking.lang_ja_device_pad.png
Oops, something went wrong.
Binary file modified
BIN
-211 Bytes
(100%)
...agePledgeViewControllerTests/testView_GooglePay.lang_en_device_phone4_7inch.png
Oops, something went wrong.
Binary file modified
BIN
-185 Bytes
(100%)
...eViewControllerTests/testView_NoReward_ApplePay.lang_en_device_phone4_7inch.png
Oops, something went wrong.
92 changes: 92 additions & 0 deletions
92
Kickstarter-iOS/Features/ManagePledge/Views/BadgeView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import Library | ||
import UIKit | ||
|
||
private enum Constants { | ||
/// Spacing & Padding | ||
public static let badgeTopButtonPadding = 6.0 | ||
public static let badgeLeadingTrailingPadding = 8.0 | ||
public static let defaultStackViewSpacing = Styles.grid(1) | ||
|
||
/// Corner radius | ||
public static let defaultCornerRadius = Styles.grid(1) | ||
} | ||
|
||
final class BadgeView: UIView { | ||
// MARK: - Properties | ||
|
||
private lazy var badgeLabel: UILabel = { UILabel(frame: .zero) }() | ||
|
||
// MARK: - Lifecycle | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
|
||
self.configureSubviews() | ||
self.bindStyles() | ||
self.setupConstraints() | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder _: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
// MARK: - Configuration | ||
|
||
private func configureSubviews() { | ||
self.addSubview(self.badgeLabel) | ||
} | ||
|
||
private func setupConstraints() { | ||
self.badgeLabel.translatesAutoresizingMaskIntoConstraints = false | ||
self.badgeLabel.setContentHuggingPriority(.required, for: .horizontal) | ||
self.badgeLabel.setContentCompressionResistancePriority(.required, for: .horizontal) | ||
self.badgeLabel.setContentHuggingPriority(.required, for: .vertical) | ||
self.badgeLabel.setContentCompressionResistancePriority(.required, for: .vertical) | ||
|
||
NSLayoutConstraint.activate([ | ||
self.badgeLabel.topAnchor.constraint( | ||
equalTo: self.topAnchor, | ||
constant: Constants.badgeTopButtonPadding | ||
), | ||
self.badgeLabel.bottomAnchor.constraint( | ||
equalTo: self.bottomAnchor, | ||
constant: -Constants.badgeTopButtonPadding | ||
), | ||
self.badgeLabel.leadingAnchor.constraint( | ||
equalTo: self.leadingAnchor, | ||
constant: Constants.badgeLeadingTrailingPadding | ||
), | ||
self.badgeLabel.trailingAnchor.constraint( | ||
equalTo: self.trailingAnchor, | ||
constant: -Constants.badgeLeadingTrailingPadding | ||
) | ||
]) | ||
} | ||
|
||
public func configure(with text: String) { | ||
self.badgeLabel.text = text | ||
} | ||
|
||
// MARK: - Styles | ||
|
||
override func bindStyles() { | ||
super.bindStyles() | ||
|
||
applyBadgeViewStyle(self) | ||
applyBadgeLabelStyle(self.badgeLabel) | ||
} | ||
} | ||
|
||
private func applyBadgeViewStyle(_ view: UIView) { | ||
view.backgroundColor = .ksr_create_100 | ||
view.rounded(with: Constants.defaultCornerRadius) | ||
} | ||
|
||
private func applyBadgeLabelStyle(_ label: UILabel) { | ||
label.font = UIFont.ksr_subhead().bolded | ||
label.textColor = .ksr_create_700 | ||
label.textAlignment = .center | ||
label.numberOfLines = 1 | ||
label.adjustsFontForContentSizeCategory = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.