TP-84819|handle click function passed (#12734)

This commit is contained in:
Somarapu Vamshi
2024-09-24 21:43:19 +05:30
committed by GitHub
parent 33efd97899
commit 52d614464c
2 changed files with 6 additions and 0 deletions

View File

@@ -41,6 +41,8 @@ const TitleWidget = ({
handleClick(cta);
} else if (widgetData?.actions && handleActions) {
handleActions(null, widgetData?.actions);
} else if (widgetData?.cta && handleClick) {
handleClick(widgetData?.cta);
}
};

View File

@@ -18,6 +18,7 @@ const ListItemComponent = ({
item,
handleActions,
handleWidgetClick,
handleClick,
}: {
item: ListItem;
handleActions: (
@@ -25,6 +26,7 @@ const ListItemComponent = ({
actionPayloadList: GenericActionPayload | undefined,
) => void;
handleWidgetClick: (item: ListItem) => void;
handleClick?: (cta: CtaData) => void;
}) => {
useEffect(() => {
item.onViewEvent && sendAsAnalyticsEvent(item.onViewEvent);
@@ -35,6 +37,7 @@ const ListItemComponent = ({
widgetData={item}
widgetStyle={styles.itemRowContainer}
handleActions={handleActions}
handleClick={handleClick}
widgetIndex={Number(item.id)}
/>
</TouchableOpacity>
@@ -110,6 +113,7 @@ const TitleWithListWidget = ({
item={item}
handleActions={throttledHandleActions}
handleWidgetClick={throttledHandleWidgetClick}
handleClick={handleClick}
/>
)}
keyExtractor={(item, index) => item.id || index.toString()}