Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

A11y improvements

Tim Wilson5b8f84583cec
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/program-card.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/program-card.tsx
index 2ae968fdca..0065b25c76 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/program-card.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/program-card.tsx
@@ -17,20 +17,25 @@ import { useRouter } from "next/navigation";
const getClickHandlers = (
url: string | undefined,
router: ReturnType<typeof useRouter>,
-) => ({
- onClick: url
- ? (e) => {
- if (isClickOnInteractiveChild(e)) return;
- e.metaKey || e.ctrlKey ? window.open(url, "_blank") : router.push(url);
+) =>
+ url
+ ? {
+ onClick: (e) => {
+ if (isClickOnInteractiveChild(e)) return;
+ e.metaKey || e.ctrlKey
+ ? window.open(url, "_blank")
+ : router.push(url);
+ },
+ onAuxClick: (e) => {
+ if (isClickOnInteractiveChild(e)) return;
+ window.open(url, "_blank");
+ },
+ role: "link",
+ tabIndex: 0,
+ onKeyDown: (e) =>
+ e.target === e.currentTarget && e.key === "Enter" && router.push(url),
}
- : undefined,
- onAuxClick: url
- ? (e) => {
- if (isClickOnInteractiveChild(e)) return;
- window.open(url, "_blank");
- }
- : undefined,
-});
+ : {};
export function ProgramCard({ program }: { program?: NetworkProgramProps }) {
const { queryParams } = useRouterStuff();