From 3ecb32d585c8f99e3a3815bd3c9fce3ff25667df Mon Sep 17 00:00:00 2001 From: Mikael Brevik Date: Wed, 18 Dec 2024 11:15:29 +0100 Subject: [PATCH] fix: missing props passed to tag causing aria issue --- .../sections/contact-box/ContactSelector.tsx | 44 +++++++++---------- .../contact-box/contact-box.module.css | 5 +++ src/components/tag/index.tsx | 1 + 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/components/sections/contact-box/ContactSelector.tsx b/src/components/sections/contact-box/ContactSelector.tsx index 5bdb25905..e48b4fb1f 100644 --- a/src/components/sections/contact-box/ContactSelector.tsx +++ b/src/components/sections/contact-box/ContactSelector.tsx @@ -1,9 +1,10 @@ "use client"; -import { use, useState } from "react"; +import { use } from "react"; import EmployeeCard from "src/components/employeeCard/EmployeeCard"; import { Tag } from "src/components/tag"; +import useTabs from "src/utils/hooks/useTabs"; import styles from "./contact-box.module.css"; import { EmployeeAndMetadata } from "./types"; @@ -22,10 +23,7 @@ export default function ContactSelector({ background = "dark", }: ContactSelectorProps) { const contactPoints = use(contactPointsPromise); - - const [selectedTag, setSelectedTag] = useState( - contactPoints[0]?.tagSlug, - ); + const { tabListRef, selectedTabIndex } = useTabs(); if (!contactPoints.length) { return null; @@ -33,30 +31,32 @@ export default function ContactSelector({ return (
-
- {contactPoints.map((contactPoint) => ( - setSelectedTag(contactPoint.tagSlug)} - text={contactPoint.tag} - /> +
    + {contactPoints.map((contactPoint, index) => ( +
  • + +
  • ))} -
+
- {contactPoints.map((contactPoint) => ( + {contactPoints.map((contactPoint, index) => (