From 374fd57dbc7ac56fc06db19d676c7af2c73e9edd Mon Sep 17 00:00:00 2001 From: Vijay <74645268+vijaysingh2219@users.noreply.github.com> Date: Thu, 11 Apr 2024 03:48:56 +0530 Subject: [PATCH] Replaced button with react-router-dom's Link component for better navigation. --- src/components/player/base/BackLink.tsx | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/components/player/base/BackLink.tsx b/src/components/player/base/BackLink.tsx index 23bcb668..251a673c 100644 --- a/src/components/player/base/BackLink.tsx +++ b/src/components/player/base/BackLink.tsx @@ -1,36 +1,21 @@ -import React from "react"; import { useTranslation } from "react-i18next"; -import { useNavigate } from "react-router-dom"; +import { Link } from "react-router-dom"; import { Icon, Icons } from "@/components/Icon"; export function BackLink(props: { url: string }) { const { t } = useTranslation(); - const navigate = useNavigate(); - const handleClick = (event: React.MouseEvent) => { - event.preventDefault(); - // Check if center mouse button is clicked - if (event.button === 1) { - // Open the URL in a new tab - window.open(props.url, "_blank"); - } else { - // Navigate normally for other clicks - navigate(props.url); - } - }; return (
- +
); }