From fa23c13db1f7c4d21d624923db02d2d81ec0e868 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 3 Sep 2025 17:07:09 -0700 Subject: [PATCH] Modernize Link components to Next.js 13+ patterns (#431) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Removed legacy behavior from Link components - Fixed onClick warnings with next-intl Link wrapper - Fixed tab switching on party page - Fixed JobSkillItem router undefined error ## Changes - Removed `legacyBehavior` prop and nested `` tags from all Link components - Updated GridTabsCompact to use next-intl's Link wrapper correctly - Fixed PartyPageClient tab switching by mapping string values to GridType enum - Removed broken locale assignment code in JobSkillItem ## Test plan - [x] No more console warnings about onClick and legacyBehavior - [x] Tab switching works correctly on party page - [x] No router undefined errors in JobSkillItem - [x] All navigation links work as expected 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude --- app/[locale]/p/[party]/PartyPageClient.tsx | 14 +++++++++++- app/components/Header.tsx | 2 -- components/Header/index.tsx | 2 -- components/about/LinkItem/index.tsx | 17 ++++++--------- components/job/JobSkillItem/index.tsx | 2 -- components/party/PartyHeader/index.tsx | 8 +++---- pages/_app.tsx | 25 ++++++++++------------ 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/app/[locale]/p/[party]/PartyPageClient.tsx b/app/[locale]/p/[party]/PartyPageClient.tsx index 345a3183..333307dc 100644 --- a/app/[locale]/p/[party]/PartyPageClient.tsx +++ b/app/[locale]/p/[party]/PartyPageClient.tsx @@ -34,7 +34,19 @@ const PartyPageClient: React.FC = ({ party, raidGroups }) => { // Handle tab change const handleTabChanged = (value: string) => { - const tabType = parseInt(value) as GridType + let tabType: GridType + switch (value) { + case 'characters': + tabType = GridType.Character + break + case 'summons': + tabType = GridType.Summon + break + case 'weapons': + default: + tabType = GridType.Weapon + break + } setSelectedTab(tabType) } diff --git a/app/components/Header.tsx b/app/components/Header.tsx index 513e3fa1..9c6f77b0 100644 --- a/app/components/Header.tsx +++ b/app/components/Header.tsx @@ -204,7 +204,6 @@ const Header = () => { {t('menu.profile')} @@ -300,7 +299,6 @@ const Header = () => { {t('menu.profile')} diff --git a/components/Header/index.tsx b/components/Header/index.tsx index 2b0d5af6..5bce6983 100644 --- a/components/Header/index.tsx +++ b/components/Header/index.tsx @@ -200,7 +200,6 @@ const Header = () => { {t('menu.profile')} @@ -296,7 +295,6 @@ const Header = () => { {t('menu.profile')} diff --git a/components/about/LinkItem/index.tsx b/components/about/LinkItem/index.tsx index ccd40c66..28c98cbc 100644 --- a/components/about/LinkItem/index.tsx +++ b/components/about/LinkItem/index.tsx @@ -1,5 +1,4 @@ import { ComponentProps } from 'react' -import Link from 'next/link' import classNames from 'classnames' import ShareIcon from '~public/icons/Share.svg' @@ -21,15 +20,13 @@ const LinkItem = ({ icon, title, link, className, ...props }: Props) => { return (
- - -
- {icon} -

{title}

-
- -
- + +
+ {icon} +

{title}

+
+ +
) } diff --git a/components/job/JobSkillItem/index.tsx b/components/job/JobSkillItem/index.tsx index 8f8aebd7..2da276a8 100644 --- a/components/job/JobSkillItem/index.tsx +++ b/components/job/JobSkillItem/index.tsx @@ -47,8 +47,6 @@ const JobSkillItem = React.forwardRef( // Set up translation const t = useTranslations('common') const locale = (getCookie('NEXT_LOCALE') as string) || 'en' - ? router.locale - : 'en' // States: Component const [alertOpen, setAlertOpen] = useState(false) diff --git a/components/party/PartyHeader/index.tsx b/components/party/PartyHeader/index.tsx index b6e759ba..10fe7b66 100644 --- a/components/party/PartyHeader/index.tsx +++ b/components/party/PartyHeader/index.tsx @@ -221,8 +221,8 @@ const PartyHeader = (props: Props) => { ) => { return (
- - {userBlock(username, picture, element)} + + {userBlock(username, picture, element)}
) @@ -231,8 +231,8 @@ const PartyHeader = (props: Props) => { const linkedRaidBlock = (raid: Raid) => { return (
- - {raid.name[locale]} + + {raid.name[locale]}
) diff --git a/pages/_app.tsx b/pages/_app.tsx index 99e7cec2..8864abd0 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,6 +1,5 @@ import { appWithTranslation } from 'next-i18next' import Head from 'next/head' -import Link from 'next/link' import localFont from 'next/font/local' import { useIsomorphicLayoutEffect } from 'react-use' import { useTranslation } from 'next-i18next' @@ -125,19 +124,17 @@ function MyApp({ Component, pageProps }: AppProps) {

{t('errors.server_unavailable.discord')}

- - -
- -

granblue-tools

-
- -
- + +
+ +

granblue-tools

+
+ +