Skip to content

Commit fbe2a87

Browse files
authored
Merge pull request #81 from shanuchauhan1211/main
Integrated Aptabase in Koder's site
2 parents af0fdcd + b96cd04 commit fbe2a87

File tree

8 files changed

+82
-19
lines changed

8 files changed

+82
-19
lines changed

components/Footer.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ import AnimatedBorder from "./AnimatedBorder";
66
import { footerButtons, socialMediaHandles, socialMediaTealIcons } from "../helper/constant";
77
import AppContext from "./AppContext";
88
import Link from "next/link";
9-
9+
import { useAptabase } from '@aptabase/react';
1010
const Footer = () => {
11+
const { trackEvent } = useAptabase();
1112
const [onHover, setOnHover] = useState(false);
1213
const [hoverOnMob, setHoverOnMob] = useState(false);
1314
const [hoverOnSocialMedia, setHoverOnSocialMedia] = useState<any>(false);
@@ -54,6 +55,7 @@ const Footer = () => {
5455
key={i}
5556
className="h-7 cursor-pointer brightness-50 hover:brightness-100"
5657
onClick={() => {
58+
trackEvent('Social_Media', { Social_Media:item.title });
5759
window.open(item.url, "_blank");
5860
}}
5961
onMouseEnter={() => setHoverOnSocialMedia(i)}
@@ -119,6 +121,7 @@ const Footer = () => {
119121
key={j}
120122
className="relative group text-[0.9rem] md:text-[1.2rem] text-main-light_white mt-3 cursor-pointer font-miligramTextBook font-light hover:text-white w-fit"
121123
onClick={() => {
124+
trackEvent('Footer_Button', { List_Item:item.title });
122125
handleNavigateTo(item);
123126
}}
124127
>

components/Navbar.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import dynamic from "next/dynamic";
33
import Link from "next/link";
44
import Image from "next/image";
55
import { useRouter } from "next/router";
6-
6+
import { useAptabase } from '@aptabase/react';
77
import { discordSvg, discordWhite, logo } from "../assets/index";
88

99
const Button = dynamic(() => import("./Button"), {
@@ -15,6 +15,7 @@ const AnimatedBorder = dynamic(() => import("./AnimatedBorder"), {
1515
});
1616

1717
const Navbar = () => {
18+
const { trackEvent } = useAptabase();
1819
const router = useRouter();
1920
const currentRoute = router?.pathname;
2021
const handleNavigate = (href: string) => {
@@ -71,6 +72,7 @@ const Navbar = () => {
7172
<Button
7273
OnClick={() => {
7374
handleNavigate("/start-project");
75+
trackEvent('Start-Project');
7476
}}
7577
text="Get Started"
7678
className="font-miligramMedium text-[0.8rem] xxl:text-[1rem] bg-main-greenOpt-200 border-[1px] border-main-lightTeal text-main-lightTeal px-4 py-[0.4rem] sm:py-[0.55rem] sm:px-8 rounded-lg hover:bg-main-lightTeal hover:text-white"

components/pages-components/project-page-components/Form.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import TextArea from "../jobs/TextArea";
1010
import { PropagateLoader } from "react-spinners";
1111
import { projectDataSchema } from "../../../helper/validate";
1212
import { pricingList, timeLineList } from "../../../helper/constant";
13-
13+
import { useAptabase } from '@aptabase/react';
1414
interface Form {
1515
[key: string]: string;
1616
}
@@ -65,6 +65,7 @@ const Form = ({
6565
const elm = document.getElementById("abproject");
6666
elm.focus();
6767
}, []);
68+
const { trackEvent } = useAptabase();
6869
return (
6970
<Formik
7071
className="w-[97%] mx-auto mt-10 font-miligramMedium"
@@ -243,7 +244,7 @@ const Form = ({
243244
disabled={showLoader}
244245
styleObj={showLoader ? { pointerEvents: "none" } : {}}
245246
type="submit"
246-
OnClick={handleSubmit}
247+
OnClick={()=>{handleSubmit() ; trackEvent('Start-Project',{label:"Start-project_Submit-Button"});}}
247248
className="mx-auto text-[0.8rem] xxl:text-[1rem] py-[0.4rem] sm:py-[0.6rem] w-[7.3rem] sm:w-[9.5rem] block mt-16 bg-main-greenOpt-200 font-miligramMedium text-main-lightTeal rounded-lg border-[1px] border-main-lightTeal hover:bg-main-lightTeal hover:text-white"
248249
text="Submit"
249250
/>

components/section-components/pricing/PricingCard.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import Image from "next/image";
3-
3+
import { useAptabase } from '@aptabase/react';
44
import Button from "../../Button";
55
import { useRouter } from "next/router";
66
import { check, mostPopular } from "../../../assets";
@@ -24,6 +24,8 @@ const PricingCard = ({
2424
const handleNavigate = (href: string) => {
2525
router.push(href);
2626
};
27+
const { trackEvent } = useAptabase();
28+
2729
return (
2830
<div
2931
data-aos={aos}
@@ -60,6 +62,7 @@ const PricingCard = ({
6062
</div>
6163
<Button
6264
OnClick={() => {
65+
trackEvent('Pricing_Selected_Price', {Seleted_price:price});
6366
setAppContext(`${exactPrice}`);
6467
handleNavigate("start-project");
6568
}}

helper/constant.ts

+4
Original file line numberDiff line numberDiff line change
@@ -268,18 +268,22 @@ export const timeLineList = ["<1 week", "<1 month", "<6 months", ">6 months"];
268268

269269
export const socialMediaHandles = [
270270
{
271+
title:"LinkedIn",
271272
src: linkedinWhite,
272273
url: "https://www.linkedin.com/authwall?trk=bf&trkInfo=AQHkkfNKVtVB3QAAAYR0x2dA3c0i5YfwfSFl2SuYAa1O1u3Qo-Dauem_n-eeuKG0gRp9COXnLYet0RNUvrEAzdsDukF7eZB3SRKXii0KQI2nAu_xwR1gAz33Uh6Sw2J26qwLlxQ=&original_referer=&sessionRedirect=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fkoders-in",
273274
},
274275
{
276+
title:"GitHUb",
275277
src: githubWhite,
276278
url: "https://github.com/koders-in",
277279
},
278280
{
281+
title:"Twitter",
279282
src: twitterWhite,
280283
url: "https://twitter.com/KodersKorp",
281284
},
282285
{
286+
title:"Discord",
283287
src: discordWhiteLogo,
284288
url: "https://discord.com/invite/u3P2a8FpWD",
285289
},

0 commit comments

Comments
 (0)