Manos Chorianopoulos

add BannerCarousel action

......@@ -794,7 +794,28 @@ extension MyRewardsViewController: MyRewardsBannerOffersScrollTableViewCellDeleg
}
func didSelectBannerCarouselItem(_ index: Int) {
// TODO: handle carousel item tap
guard index < self.carouselItems.count else { return }
let carouselItem = self.carouselItems[index]
guard let url = carouselItem._url, !url.isEmpty else { return }
if url.contains("Offers?") {
// TODO: handle category navigation (category uuid not yet implemented)
} else if url.contains("singleOffer") {
let uuid = carouselItem._uuid
guard !uuid.isEmpty else { return }
guard let matched = self.couponSets.first(where: { $0._uuid == uuid }) else {
print("⚠️ [MyRewardsVC] No couponset found for uuid: \(uuid)")
return
}
openCouponsetViewController(with: matched)
} else if url.contains("index.html") {
let vc = SwiftWarplyFramework.CampaignViewController(nibName: "CampaignViewController", bundle: Bundle.frameworkBundle)
vc.campaignUrl = url
self.navigationController?.pushViewController(vc, animated: true)
}
}
// func didTapProfileButton() {
......