Skip to content

Commit

Permalink
removed unused code + fixed lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
patil-tejas committed Nov 7, 2024
1 parent a55f84c commit a044895
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 46 deletions.
43 changes: 0 additions & 43 deletions app/api/track-event/route.ts

This file was deleted.

2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { useState, useEffect } from "react";
import { useEffect } from "react";
import ContactPage from "@/components/main/contact/Contact";
import HeroSection from "@/components/main/hero/Hero";
import PricingSection from "@/components/Pricing/PricingSection";
Expand Down
1 change: 0 additions & 1 deletion components/main/navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useState } from "react";
import Link from "next/link";
import Container from "../../shared/Container";
import { menuItems } from "@/data/menuitems";
import { useEffect } from "react";
import { trackEvent } from "@/lib/analytics";

const Navigation = () => {
Expand Down
9 changes: 8 additions & 1 deletion lib/analytics.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import mixpanel from "mixpanel-browser";

interface TrackEventProperties {
[key: string]: string | number | boolean | object | null;
}

function getMixpanelToken(): string | undefined {
return process.env.NODE_ENV === "production"
? process.env.NEXT_PUBLIC_PROD_MIXPANEL_TOKEN
Expand All @@ -24,7 +28,10 @@ export function analyticsInit() {
}
}

export function trackEvent(eventName: string, properties?: any) {
export function trackEvent(
eventName: string,
properties?: TrackEventProperties
) {
try {
mixpanel.track(eventName, properties);
} catch (error) {
Expand Down

0 comments on commit a044895

Please sign in to comment.