Manos Chorianopoulos

CouponBarcodeView fixes

......@@ -56,7 +56,7 @@ extension CouponBarcodeView {
static func convertDateFormat(inputDate: String) -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd hh:mm"
dateFormatter.dateFormat = "yyyy-MM-dd hh:mm:ss"
if let date = dateFormatter.date(from: inputDate) {
dateFormatter.dateFormat = "dd/MM/yyyy"
let resultString = dateFormatter.string(from: date)
......@@ -97,6 +97,8 @@ extension CouponBarcodeView {
var body: some View {
let couponData = coupon["coupon_data"] as? [String: Any] ?? ["":""]
GeometryReader { geometry in
ScrollView(showsIndicators: false) {
VStack(alignment: .leading) {
......@@ -111,6 +113,7 @@ extension CouponBarcodeView {
.multilineTextAlignment(.leading)
.padding(.horizontal)
.padding(.top, self.uiscreen.height * 0.04)
.frame(maxHeight: .infinity)
Text(coupon["short_description"] as? String ?? "")
.fontWeight(.regular)
......@@ -131,7 +134,7 @@ extension CouponBarcodeView {
VStack(alignment: .center) {
VStack {
Text(coupon["coupon"] as? String ?? "")
Text(couponData["coupon"] as? String ?? "")
.fontWeight(.bold)
.font(.system(size: 27))
.foregroundColor(Color(red: 0.2549019607843137, green: 0.3333333333333333, blue: 0.39215686274509803))
......@@ -146,7 +149,7 @@ extension CouponBarcodeView {
}
.frame(maxWidth: .infinity)
if (CharacterSet.decimalDigits.isSuperset(of: CharacterSet(charactersIn: coupon["coupon"] as? String ?? ""))) {
if (CharacterSet.decimalDigits.isSuperset(of: CharacterSet(charactersIn: couponData["coupon"] as? String ?? ""))) {
VStack(alignment: .center) {
VStack {}
.frame(height: 1)
......@@ -194,7 +197,7 @@ extension CouponBarcodeView {
// .aspectRatio(contentMode: .fit)
// .frame(width: self.uiscreen.width, height: self.uiscreen.height * 0.1)
Text(coupon["coupon"] as? String ?? "")
Text(couponData["coupon"] as? String ?? "")
.fontWeight(.regular)
.font(.system(size: 22))
.foregroundColor(Color(red: 0.2549019607843137, green: 0.3333333333333333, blue: 0.39215686274509803))
......@@ -215,7 +218,7 @@ extension CouponBarcodeView {
Text("Το κουπόνι ισχύει έως " + CouponBarcodeView.couponContainer.convertDateFormat(inputDate: coupon["expiration"] as? String ?? ""))
Text("Το κουπόνι ισχύει έως " + CouponBarcodeView.couponContainer.convertDateFormat(inputDate: couponData["expiration"] as? String ?? ""))
.fontWeight(.medium)
.font(.system(size: 14))
.foregroundColor(Color(red: 0.2549019607843137, green: 0.3333333333333333, blue: 0.39215686274509803))
......@@ -296,7 +299,7 @@ extension CouponBarcodeView {
}
.frame(width:self.uiscreen.width)
.frame(minHeight: geometry.size.height)
// .frame(minHeight: geometry.size.height)
.padding(.bottom, self.uiscreen.height * 0.03)
}
.frame(width:self.uiscreen.width)
......