Manos Chorianopoulos

add BannerCarousel action

...@@ -794,7 +794,28 @@ extension MyRewardsViewController: MyRewardsBannerOffersScrollTableViewCellDeleg ...@@ -794,7 +794,28 @@ extension MyRewardsViewController: MyRewardsBannerOffersScrollTableViewCellDeleg
794 } 794 }
795 795
796 func didSelectBannerCarouselItem(_ index: Int) { 796 func didSelectBannerCarouselItem(_ index: Int) {
797 - // TODO: handle carousel item tap 797 + guard index < self.carouselItems.count else { return }
798 + let carouselItem = self.carouselItems[index]
799 +
800 + guard let url = carouselItem._url, !url.isEmpty else { return }
801 +
802 + if url.contains("Offers?") {
803 + // TODO: handle category navigation (category uuid not yet implemented)
804 +
805 + } else if url.contains("singleOffer") {
806 + let uuid = carouselItem._uuid
807 + guard !uuid.isEmpty else { return }
808 + guard let matched = self.couponSets.first(where: { $0._uuid == uuid }) else {
809 + print("⚠️ [MyRewardsVC] No couponset found for uuid: \(uuid)")
810 + return
811 + }
812 + openCouponsetViewController(with: matched)
813 +
814 + } else if url.contains("index.html") {
815 + let vc = SwiftWarplyFramework.CampaignViewController(nibName: "CampaignViewController", bundle: Bundle.frameworkBundle)
816 + vc.campaignUrl = url
817 + self.navigationController?.pushViewController(vc, animated: true)
818 + }
798 } 819 }
799 820
800 // func didTapProfileButton() { 821 // func didTapProfileButton() {
......