From de9e26a241a096052bc44c8b7389d873f6ef0c57 Mon Sep 17 00:00:00 2001 From: kimatata <117462761+kimatata@users.noreply.github.com> Date: Tue, 29 Apr 2025 18:38:09 +0900 Subject: [PATCH] fix: button links not responding when touched on a mobile device (#217) --- frontend/components/ClientLink.tsx | 10 ++++ .../src/app/[locale]/HeaderNavbarMenu.tsx | 7 +-- frontend/src/app/[locale]/PaneMainTitle.tsx | 60 ++++++++++--------- .../src/app/[locale]/account/AccountPage.tsx | 15 +++-- .../src/app/[locale]/account/authPage.tsx | 15 +++-- .../[folderId]/cases/TestCaseTable.tsx | 19 +++--- 6 files changed, 72 insertions(+), 54 deletions(-) create mode 100644 frontend/components/ClientLink.tsx diff --git a/frontend/components/ClientLink.tsx b/frontend/components/ClientLink.tsx new file mode 100644 index 0000000..83db74d --- /dev/null +++ b/frontend/components/ClientLink.tsx @@ -0,0 +1,10 @@ +'use client'; +import { forwardRef } from 'react'; +import { Link } from '@/src/i18n/routing'; +type Props = React.ComponentPropsWithoutRef; +const ClientLink = forwardRef(({ href, ...props }, ref) => ( + +)); +ClientLink.displayName = 'ClientLink'; + +export default ClientLink; diff --git a/frontend/src/app/[locale]/HeaderNavbarMenu.tsx b/frontend/src/app/[locale]/HeaderNavbarMenu.tsx index 40e7bb2..1091d9e 100644 --- a/frontend/src/app/[locale]/HeaderNavbarMenu.tsx +++ b/frontend/src/app/[locale]/HeaderNavbarMenu.tsx @@ -101,12 +101,7 @@ export default function HeaderNavbarMenu({ messages, locale }: Props) { {commonLinks.map((link) => link.isExternal ? ( - } - > + {link.label} diff --git a/frontend/src/app/[locale]/PaneMainTitle.tsx b/frontend/src/app/[locale]/PaneMainTitle.tsx index c2865b8..ec1e178 100644 --- a/frontend/src/app/[locale]/PaneMainTitle.tsx +++ b/frontend/src/app/[locale]/PaneMainTitle.tsx @@ -1,9 +1,9 @@ -import { title, subtitle } from '@/components/primitives'; import { Button, Link as NextUiLink } from '@heroui/react'; import { MoveUpRight } from 'lucide-react'; -import { Link } from '@/src/i18n/routing'; import { useTranslations } from 'next-intl'; +import { title, subtitle } from '@/components/primitives'; import { LocaleCodeType } from '@/types/locale'; +import ClientLink from '@/components/ClientLink'; type Props = { locale: LocaleCodeType; @@ -34,35 +34,37 @@ export default function MainTitle({ locale }: Props) {

{t('integrate_and_manage')}

- - - + - - - + - - - +
); diff --git a/frontend/src/app/[locale]/account/AccountPage.tsx b/frontend/src/app/[locale]/account/AccountPage.tsx index dd9a580..06e7d35 100644 --- a/frontend/src/app/[locale]/account/AccountPage.tsx +++ b/frontend/src/app/[locale]/account/AccountPage.tsx @@ -86,11 +86,16 @@ export default function AccountPage({ messages, locale }: Props) { ) : ( <> {messages.notOwnAnyProjects} - - - + )} diff --git a/frontend/src/app/[locale]/account/authPage.tsx b/frontend/src/app/[locale]/account/authPage.tsx index 6ff9cec..34a8df5 100644 --- a/frontend/src/app/[locale]/account/authPage.tsx +++ b/frontend/src/app/[locale]/account/authPage.tsx @@ -97,11 +97,16 @@ export default function AuthPage({ isSignup, messages, locale }: Props) {

{messages.title}

- - - +
diff --git a/frontend/src/app/[locale]/projects/[projectId]/folders/[folderId]/cases/TestCaseTable.tsx b/frontend/src/app/[locale]/projects/[projectId]/folders/[folderId]/cases/TestCaseTable.tsx index e22040e..d776422 100644 --- a/frontend/src/app/[locale]/projects/[projectId]/folders/[folderId]/cases/TestCaseTable.tsx +++ b/frontend/src/app/[locale]/projects/[projectId]/folders/[folderId]/cases/TestCaseTable.tsx @@ -14,8 +14,8 @@ import { Selection, SortDescriptor, } from '@heroui/react'; -import { Link, NextUiLinkClasses } from '@/src/i18n/routing'; import { Plus, MoreVertical, Trash } from 'lucide-react'; +import { Link } from '@/src/i18n/routing'; import { CaseType, CasesMessages } from '@/types/case'; import { PriorityMessages } from '@/types/priority'; import TestCasePriority from '@/components/TestCasePriority'; @@ -82,14 +82,15 @@ export default function TestCaseTable({ return {cellValue as number}; case 'title': return ( - ); case 'priority':