Clean up modals

This commit is contained in:
nielsandriesse 2020-09-04 13:09:54 +10:00
parent 582bf7105d
commit 6986c96ec4
2 changed files with 6 additions and 5 deletions

View file

@ -9,11 +9,11 @@ class Modal : BaseVC {
result.backgroundColor = Colors.modalBackground
result.layer.cornerRadius = Values.modalCornerRadius
result.layer.masksToBounds = false
result.layer.borderColor = Colors.modalBorder.cgColor
result.layer.borderColor = isLightMode ? UIColor.white.cgColor : Colors.modalBorder.cgColor
result.layer.borderWidth = Values.borderThickness
result.layer.shadowColor = UIColor.black.cgColor
result.layer.shadowRadius = 8
result.layer.shadowOpacity = 0.64
result.layer.shadowRadius = isLightMode ? 2 : 8
result.layer.shadowOpacity = isLightMode ? 0.1 : 0.64
return result
}()
@ -31,7 +31,8 @@ class Modal : BaseVC {
// MARK: Lifecycle
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = UIColor(hex: 0x000000).withAlphaComponent(Values.modalBackgroundOpacity)
let alpha = isLightMode ? CGFloat(0.1) : Values.modalBackgroundOpacity
view.backgroundColor = UIColor(hex: 0x000000).withAlphaComponent(alpha)
cancelButton.addTarget(self, action: #selector(close), for: UIControl.Event.touchUpInside)
let swipeGestureRecognizer = UISwipeGestureRecognizer(target: self, action: #selector(close))
swipeGestureRecognizer.direction = .down

View file

@ -62,7 +62,7 @@ final class SeedModal : Modal {
// Set up explanation label
let disclaimerLabel = UILabel()
disclaimerLabel.textColor = Colors.text.withAlphaComponent(Values.unimportantElementOpacity)
disclaimerLabel.font = .systemFont(ofSize: Values.verySmallFontSize)
disclaimerLabel.font = .systemFont(ofSize: 10)
disclaimerLabel.text = NSLocalizedString("modal_seed_disclaimer", comment: "")
disclaimerLabel.numberOfLines = 0
disclaimerLabel.lineBreakMode = .byWordWrapping