File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import Link, { LinkVariant } from '@/dls/Link/Link';
55import useGetStreakWithMetadata from '@/hooks/auth/useGetStreakWithMetadata' ;
66import useIsLoggedIn from '@/hooks/auth/useIsLoggedIn' ;
77import DiamondIcon from '@/icons/diamond.svg' ;
8+ import { logButtonClick } from '@/utils/eventLogger' ;
89import {
910 getReadingGoalNavigationUrl ,
1011 getReadingGoalProgressNavigationUrl ,
@@ -26,6 +27,13 @@ const Banner = ({ text, ctaButtonText }: BannerProps) => {
2627 const ctaLink =
2728 isLoggedIn && hasGoal ? getReadingGoalProgressNavigationUrl ( ) : getReadingGoalNavigationUrl ( ) ;
2829
30+ const handleButtonClick = ( ) => {
31+ logButtonClick ( 'banner_cta' , {
32+ hasGoal,
33+ isLoggedIn,
34+ } ) ;
35+ } ;
36+
2937 return (
3038 < div className = { styles . container } data-testid = "banner" >
3139 < p className = { styles . text } > { text } </ p >
@@ -35,6 +43,7 @@ const Banner = ({ text, ctaButtonText }: BannerProps) => {
3543 variant = { LinkVariant . Blend }
3644 className = { styles . cta }
3745 ariaLabel = { ctaButtonText }
46+ onClick = { handleButtonClick }
3847 >
3948 < IconContainer
4049 icon = { < DiamondIcon aria-hidden = "true" /> }
You can’t perform that action at this time.
0 commit comments