Skip to content

Commit

Permalink
feat: move ga4 click event in ResultCard
Browse files Browse the repository at this point in the history
  • Loading branch information
bringvotrevin committed Sep 26, 2023
1 parent 6d3c295 commit 4112475
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/components/common/ResultCard/ResultCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@ const ResultCard = (props: ResultCardProps) => {
const { id: roomId } = useParams();

const handleLinkClick = (event: React.MouseEvent<HTMLButtonElement>) => {
event.stopPropagation();
window.open(props.link);
};

const handleClickResultCard = () => {
ReactGA.event({
category: 'click',
action: '1등_카드',
label: '투표 결과 화면(1등)',
});
event.stopPropagation();
window.open(props.link);
};

const handleClickOverallRanking = () => {
Expand Down Expand Up @@ -64,7 +61,7 @@ const ResultCard = (props: ResultCardProps) => {
</S.RankingWrapper>
);
return (
<S.RestaurantDetail onClick={handleClickResultCard}>
<S.RestaurantDetail>
{props.winnerNum === 1 ? oneWinner : multipleWinner}
<span className="line"></span>
<S.RestaurantName onClick={handleLinkClick}>
Expand Down

0 comments on commit 4112475

Please sign in to comment.