Skip to content

Commit

Permalink
adding gtm on Accordion
Browse files Browse the repository at this point in the history
  • Loading branch information
TalBenAvi committed May 6, 2024
1 parent d90736e commit 0ab5543
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions workspaces/website/src/components/Accordion/PageAccordion.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

//todo: Rewrite this component post launch

import React from "react";
Expand All @@ -11,6 +10,7 @@ import {
Icon,
Box,
} from "@chakra-ui/react";
import { EVENT_CATEGORY, gtmEvent } from "src/utils/utils";

type RootProps = {
children: React.ReactNode;
Expand All @@ -29,7 +29,11 @@ type ItemProps = {
};
const Item = ({ label, children }: ItemProps) => {
return (
<AccordionItem>
<AccordionItem
onClick={() =>
gtmEvent(label.replace(/ /g, "_"), EVENT_CATEGORY.BUTTON_CLICK)
}
>
{({ isExpanded }) => (
<>
<AccordionButton>
Expand Down

0 comments on commit 0ab5543

Please sign in to comment.