WalletActiveCouponsTableViewCell.swift 3.76 KB
//
//  WalletActiveCouponsTableViewCell.swift
//  SwiftWarplyFramework
//
//  Created by Manos Chorianopoulos on 23/10/23.
//

import UIKit

@objc public class WalletActiveCouponsTableViewCell: UITableViewCell {
    @IBOutlet weak var dfyViewParent: UIView!
    @IBOutlet weak var dfyView: UIView!
    @IBOutlet weak var dfyImage: UIImageView!
    @IBOutlet weak var dfyLabel: UILabel!
    @IBOutlet weak var dfyCountView: UIView!
    @IBOutlet weak var dfyCountLabel: UILabel!
    
    @IBOutlet weak var smView: UIView!
    @IBOutlet weak var smImage: UIImageView!
    @IBOutlet weak var smLabel: UILabel!
    @IBOutlet weak var smCountView: UIView!
    @IBOutlet weak var smCountLabel: UILabel!
    
    @IBOutlet weak var gfyView: UIView!
    @IBOutlet weak var gfyImage: UIImageView!
    @IBOutlet weak var gfyLabel: UILabel!
    @IBOutlet weak var gfyCountView: UIView!
    @IBOutlet weak var gfyCountLabel: UILabel!
    
    
    public override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        
        // DFY Banner
        dfyViewParent.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1.00)
        dfyViewParent.layer.cornerRadius = 16.0
        dfyViewParent.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
        dfyViewParent.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
        dfyViewParent.layer.shadowOpacity = 1.0
        dfyViewParent.layer.shadowRadius = 1.0
        
        dfyView.backgroundColor = UIColor(red: 0.46, green: 0.75, blue: 0.45, alpha: 0.05)
        dfyView.layer.cornerRadius = 16.0
        
        dfyImage.image = UIImage(named: "wallet_banner_dfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
        
        dfyLabel.text = "DEALS FOR YOU"
        
        dfyCountView.layer.cornerRadius = 4.0
        dfyCountView.backgroundColor = UIColor(red: 0.92, green: 0.75, blue: 0.41, alpha: 1.00)
        
        // SM Banner
        smView.backgroundColor = UIColor(red: 1.00, green: 0.99, blue: 0.97, alpha: 1.00)
        smView.layer.cornerRadius = 16.0
        smView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
        smView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
        smView.layer.shadowOpacity = 1.0
        smView.layer.shadowRadius = 1.0
        
        smImage.image = UIImage(named: "wallet_banner_sm", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
        
        smLabel.text = "SUPERMARKET DEALS"
        
        smCountView.layer.cornerRadius = 4.0
        smCountView.backgroundColor = UIColor(red: 0.92, green: 0.75, blue: 0.41, alpha: 1.00)
        
        // GFY Banner
        gfyView.backgroundColor = UIColor(red: 0.96, green: 0.97, blue: 0.98, alpha: 1.00)
        gfyView.layer.cornerRadius = 16.0
        gfyView.layer.shadowColor = UIColor(red: 0.00, green: 0.00, blue: 0.00, alpha: 0.2).cgColor
        gfyView.layer.shadowOffset = CGSize(width: 0.0, height: 1.0)
        gfyView.layer.shadowOpacity = 1.0
        gfyView.layer.shadowRadius = 1.0
        
        gfyImage.image = UIImage(named: "wallet_banner_gfy", in: MyEmptyClass.resourceBundle(), compatibleWith: nil)
        
        gfyLabel.text = "GIFTS FOR YOU"
        
        gfyCountView.layer.cornerRadius = 4.0
        gfyCountView.backgroundColor = UIColor(red: 0.92, green: 0.75, blue: 0.41, alpha: 1.00)
    }

    public override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    func configureCell(dfyCount: Int, smCount: Int, gfyCount: Int) {
        dfyCountLabel.text = String(dfyCount)
        smCountLabel.text = String(smCount)
        gfyCountLabel.text = String(gfyCount)
    }

}