File tree Expand file tree Collapse file tree 2 files changed +33
-8
lines changed
apps/dashboard/src/app/account/contracts Expand file tree Collapse file tree 2 files changed +33
-8
lines changed Original file line number Diff line number Diff line change 11"use client" ;
22
33import { Button } from "@/components/ui/button" ;
4+ import { TrackedLinkTW } from "@/components/ui/tracked-link" ;
45import { ImportModal } from "components/contract-components/import-contract/modal" ;
56import { DownloadIcon , PlusIcon } from "lucide-react" ;
6- import Link from "next/link" ;
77import { useState } from "react" ;
8+ import { useTrack } from "../../../hooks/analytics/useTrack" ;
89
910export function DeployedContractsPageHeader ( props : {
1011 teamId : string ;
1112 projectId : string ;
1213} ) {
1314 const [ importModalOpen , setImportModalOpen ] = useState ( false ) ;
15+ const trackEvent = useTrack ( ) ;
1416
1517 return (
1618 < div className = "border-b" >
@@ -33,16 +35,28 @@ export function DeployedContractsPageHeader(props: {
3335 < Button
3436 className = "gap-2 bg-card"
3537 variant = "outline"
36- onClick = { ( ) => setImportModalOpen ( true ) }
38+ onClick = { ( ) => {
39+ trackEvent ( {
40+ action : "click" ,
41+ category : "contracts" ,
42+ label : "import-contract" ,
43+ } ) ;
44+ setImportModalOpen ( true ) ;
45+ } }
3746 >
3847 < DownloadIcon className = "size-4" />
3948 Import contract
4049 </ Button >
4150 < Button asChild className = "gap-2" >
42- < Link href = "/explore" >
51+ < TrackedLinkTW
52+ href = "/explore"
53+ category = "contracts"
54+ label = "deploy-contract"
55+ target = "_blank"
56+ >
4357 < PlusIcon className = "size-4" />
4458 Deploy contract
45- </ Link >
59+ </ TrackedLinkTW >
4660 </ Button >
4761 </ div >
4862 </ div >
Original file line number Diff line number Diff line change 11"use client" ;
22
33import { Button } from "@/components/ui/button" ;
4+ import { TrackedLinkTW } from "@/components/ui/tracked-link" ;
45import { ArrowUpRightIcon , DownloadIcon } from "lucide-react" ;
5- import Link from "next/link" ;
66import { useState } from "react" ;
77import { ImportModal } from "../../../../components/contract-components/import-contract/modal" ;
8+ import { useTrack } from "../../../../hooks/analytics/useTrack" ;
89
910export function DeployViaCLIOrImportCard ( props : {
1011 teamId : string ;
1112 projectId : string ;
1213} ) {
14+ const trackEvent = useTrack ( ) ;
1315 const [ importModalOpen , setImportModalOpen ] = useState ( false ) ;
1416
1517 return (
@@ -38,18 +40,27 @@ export function DeployViaCLIOrImportCard(props: {
3840 className = "gap-2 bg-background lg:px-10"
3941 asChild
4042 >
41- < Link
43+ < TrackedLinkTW
4244 href = "https://portal.thirdweb.com/contracts/deploy/overview"
4345 target = "_blank"
46+ category = "contracts-banner"
47+ label = "deploy-via-cli"
4448 >
4549 Deploy via CLI
4650 < ArrowUpRightIcon className = "size-4" />
47- </ Link >
51+ </ TrackedLinkTW >
4852 </ Button >
4953 < Button
5054 variant = "outline"
5155 className = "gap-2 bg-background"
52- onClick = { ( ) => setImportModalOpen ( true ) }
56+ onClick = { ( ) => {
57+ setImportModalOpen ( true ) ;
58+ trackEvent ( {
59+ category : "contracts-banner" ,
60+ action : "click" ,
61+ label : "import-contract" ,
62+ } ) ;
63+ } }
5364 >
5465 < DownloadIcon className = "size-4" />
5566 Import Contract
You can’t perform that action at this time.
0 commit comments