-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: google analytics
- Loading branch information
Showing
16 changed files
with
179 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/grants/components/grant-list/grant-list-item-link-wrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use client'; | ||
|
||
import Link from 'next/link'; | ||
import React from 'react'; | ||
|
||
import { sendGAEvent } from '@next/third-parties/google'; | ||
|
||
import { GA_EVENT, ROUTE_SECTIONS } from '@/shared/core/constants'; | ||
|
||
import { GRANT_TEST_IDS } from '@/grants/core/constants'; | ||
|
||
interface Props { | ||
slug: string; | ||
children: React.ReactNode; | ||
} | ||
|
||
export const GrantListItemLinkWrapper = ({ slug, children }: Props) => { | ||
const sendAnalytics = () => { | ||
sendGAEvent('event', GA_EVENT.GRANTS.GRANT_ITEM_CLICK, { | ||
value: slug, | ||
}); | ||
}; | ||
|
||
return ( | ||
<Link | ||
prefetch | ||
href={`/${ROUTE_SECTIONS.GRANT_IMPACT}/${slug}`} | ||
className="flex flex-wrap items-center justify-between rounded-2xl bg-gradient-to-r from-[#191919] to-[#0D0D0D] p-4 text-13 text-white transition-all duration-300 md:p-5 lg:flex-nowrap" | ||
data-uuid={slug} | ||
data-testid={GRANT_TEST_IDS.GRANT_ITEM} | ||
onClick={sendAnalytics} | ||
> | ||
{children} | ||
</Link> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use client'; | ||
|
||
import { sendGAEvent } from '@next/third-parties/google'; | ||
import { Button } from '@nextui-org/react'; | ||
|
||
import { GA_EVENT } from '@/shared/core/constants'; | ||
|
||
interface Props { | ||
slug: string; | ||
} | ||
|
||
export const ViewImpactButton = ({ slug }: Props) => { | ||
const sendAnalytics = () => { | ||
sendGAEvent('event', GA_EVENT.GRANTS.VIEW_IMPACT, { value: slug }); | ||
}; | ||
|
||
return ( | ||
<div className="flex w-full lg:hidden"> | ||
<Button | ||
className="mx-auto w-full rounded-xl border border-white/20 font-semibold" | ||
variant="bordered" | ||
onClick={sendAnalytics} | ||
> | ||
<span>View Impact</span> | ||
</Button> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.