TP-84819|handle click function passed (#12734)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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()}
|
||||
|
||||
Reference in New Issue
Block a user