From 4cee6ec579e22a9d8d97e25c01c6cd8d2cea5c80 Mon Sep 17 00:00:00 2001 From: Aleksei Tsikov Date: Fri, 6 Sep 2024 12:36:49 +0100 Subject: [PATCH] Add informational banners variants to upsell promotional banner options --- src/types.ts | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/src/types.ts b/src/types.ts index d4c1d48..ab7eb08 100644 --- a/src/types.ts +++ b/src/types.ts @@ -747,7 +747,15 @@ export interface UpsellModulePromotionalBannerInstance { destroy: () => void } -export interface WidgetUpsellPromotionalBannerOptions { +export type WidgetUpsellPromotionalBannerOptions = + | WidgetUpsellPromotionalBannerSignUpBannerOptions + | WidgetUpsellPromotionalBannerInformationalBannerOptions + | WidgetUpsellPromotionalBannerInformationalLinkOptions + | WidgetUpsellPromotionalBannerInformationalIconOptions + +export interface WidgetUpsellPromotionalBannerSignUpBannerOptions { + /** Promotional banner which allows your customer to join Revolut and get rewards if applicable */ + variant?: 'sign_up' /** Unique id of transaction user has just performed */ transactionId: string /** Max cashback amount */ @@ -765,6 +773,33 @@ export interface WidgetUpsellPromotionalBannerOptions { } } +export interface WidgetUpsellPromotionalBannerInformationalBannerOptions { + /** Promotional banner with a summary of Revolut Pay benefits, allowing to view more details on click */ + variant: 'banner' + /** Max cashback amount */ + amount?: number + /** Cashback currency */ + currency: string +} + +export interface WidgetUpsellPromotionalBannerInformationalLinkOptions { + /** Promotional banner displayed as a link, allowing to view Revolut Pay details on click */ + variant: 'link' + /** Max cashback amount */ + amount?: number + /** Cashback currency */ + currency: string +} + +export interface WidgetUpsellPromotionalBannerInformationalIconOptions { + /** Promotional banner displayed as an icon, allowing to view Revolut Pay details on click */ + variant: 'icon' + /** Max cashback amount */ + amount?: number + /** Cashback currency */ + currency: string +} + export interface UpsellModuleEnrollmentConfirmationBannerInstance { mount: ( target: string | HTMLElement, @@ -783,7 +818,7 @@ export interface WidgetUpsellEnrollmentConfirmationBannerOptions { /** Whether promotional banner should be shown if user has not enrolled */ promotionalBanner?: boolean /** Style object for promotional banner customisation */ - promotionalBannerStyle?: WidgetUpsellPromotionalBannerOptions['style'] + promotionalBannerStyle?: WidgetUpsellPromotionalBannerSignUpBannerOptions['style'] } export interface RevolutUpsellModuleOptions {