Manos Chorianopoulos

add dynamic userTag at wallet

...@@ -54,18 +54,28 @@ import UIKit ...@@ -54,18 +54,28 @@ import UIKit
54 // profileImage.load(link: profile_image ?? "", placeholder: UIImage(), cache: URLCache()) 54 // profileImage.load(link: profile_image ?? "", placeholder: UIImage(), cache: URLCache())
55 profileNameLabel.text = "Γιώργος Γεωργίου" 55 profileNameLabel.text = "Γιώργος Γεωργίου"
56 56
57 - // TODO: dynamic 57 + let userTag = swiftApi().getUserTag()
58 - questionnaireButton.setTitle("Traveller", for: .normal) 58 + if (userTag != "") {
59 + questionnaireButton.setTitle(userTag, for: .normal)
59 questionnaireButton.titleLabel?.font = UIFont.systemFont(ofSize: 13, weight: .semibold) 60 questionnaireButton.titleLabel?.font = UIFont.systemFont(ofSize: 13, weight: .semibold)
60 -// questionnaireButton.sizeToFit() 61 + questionnaireButton.setTitleColor(.white, for: .normal)
62 + // questionnaireButton.sizeToFit()
61 questionnaireButton.frame = CGRect(x: 0.0, y: 0.0, width: questionnaireButton.intrinsicContentSize.width, height: questionnaireButton.intrinsicContentSize.height) 63 questionnaireButton.frame = CGRect(x: 0.0, y: 0.0, width: questionnaireButton.intrinsicContentSize.width, height: questionnaireButton.intrinsicContentSize.height)
62 questionnaireButton.applyGradient(colours: [UIColor(red: 0.40, green: 0.77, blue: 0.28, alpha: 1.00), UIColor(red: 0.10, green: 0.66, blue: 0.72, alpha: 1.00)], gradient: GradientOrientation.horizontal, cornerRadius: 7.0) 64 questionnaireButton.applyGradient(colours: [UIColor(red: 0.40, green: 0.77, blue: 0.28, alpha: 1.00), UIColor(red: 0.10, green: 0.66, blue: 0.72, alpha: 1.00)], gradient: GradientOrientation.horizontal, cornerRadius: 7.0)
63 - // Shadow Color and Radius 65 + // Shadow Color
64 questionnaireButton.layer.shadowColor = UIColor(red: 0.33, green: 0.38, blue: 0.43, alpha: 1.00).cgColor 66 questionnaireButton.layer.shadowColor = UIColor(red: 0.33, green: 0.38, blue: 0.43, alpha: 1.00).cgColor
65 questionnaireButton.layer.shadowOffset = CGSize(width: 0.0, height: 2.0) 67 questionnaireButton.layer.shadowOffset = CGSize(width: 0.0, height: 2.0)
66 questionnaireButton.layer.shadowOpacity = 1.0 68 questionnaireButton.layer.shadowOpacity = 1.0
67 questionnaireButton.layer.shadowRadius = 0.0 69 questionnaireButton.layer.shadowRadius = 0.0
68 questionnaireButton.layer.masksToBounds = false 70 questionnaireButton.layer.masksToBounds = false
71 + } else {
72 + questionnaireButton.setTitle("+Προτιμήσεις", for: .normal)
73 + questionnaireButton.titleLabel?.font = UIFont.systemFont(ofSize: 13, weight: .semibold)
74 + questionnaireButton.setTitleColor(UIColor(red: 0.31, green: 0.62, blue: 0.18, alpha: 1.00), for: .normal)
75 + questionnaireButton.backgroundColor = UIColor(red: 0.90, green: 0.90, blue: 0.90, alpha: 1.00)
76 + questionnaireButton.frame = CGRect(x: 0.0, y: 0.0, width: questionnaireButton.intrinsicContentSize.width, height: questionnaireButton.intrinsicContentSize.height)
77 + }
78 +
69 questionnaireButton.layer.cornerRadius = 7.0 79 questionnaireButton.layer.cornerRadius = 7.0
70 80
71 dfyEarnView.layer.cornerRadius = 5.0 81 dfyEarnView.layer.cornerRadius = 5.0
......