1
0
mirror of https://github.com/XFox111/my-website.git synced 2026-04-22 07:28:01 +03:00

feat: customized Clarity analytics

This commit is contained in:
2024-08-21 00:23:50 +00:00
parent 67222999a9
commit 416e862959
3 changed files with 26 additions and 8 deletions
+8 -2
View File
@@ -7,7 +7,7 @@ import projects from "@/_data/projects";
import shared from "@/_styles/gallery.module.scss";
import { ArrowRight24Regular } from "@fluentui/react-icons";
import Image from "next/image";
import React, { useState } from "react";
import React, { useCallback, useState } from "react";
import { networkFor } from "react-social-icons";
import cls from "./ProjectsSection.module.scss";
@@ -15,6 +15,12 @@ const ProjectsSection: React.FC = () =>
{
const [selection, setSelection] = useState<number | undefined>(undefined);
const select = useCallback((index: number | undefined) =>
{
setSelection(index);
window.clarity?.("set", "checked", "projects");
}, []);
return (
<section id="projects" className={ cls.section }>
<div className={ shared.list }>
@@ -25,7 +31,7 @@ const ProjectsSection: React.FC = () =>
className={ `${shared.listItem} ${cls.listItem}` }
appearance={ selection === index ? "primary" : "secondary" }
data-selected={ selection === index }
onClick={ () => setSelection(selection == index ? undefined : index) }
onClick={ () => select(selection == index ? undefined : index) }
aria-label={ `"${project.title}". ${project.subtitle}` }>
<div className={ shared.content }>