From 9e6a8f823111d02b15a7885ce62a7dd549687f44 Mon Sep 17 00:00:00 2001 From: adevopg Date: Tue, 14 Jul 2026 14:46:17 +0000 Subject: [PATCH] Quitar URLs javascript: (React 19 las bloquea) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit React 19 bloquea href="javascript:void(0)". SiteHeader: DESCONECTAR ahora enlaza a /{locale}/log-out (ruta real), el menú hamburguesa y el logo pequeño usan role/button o href real. PostActions (foro): editar/eliminar pasan a role=button. Se elimina el logout por fetch del header (lo hace la ruta /log-out). Co-Authored-By: Claude Opus 4.8 (1M context) --- web-next/components/PostActions.tsx | 4 ++-- web-next/components/SiteHeader.tsx | 25 +++++++------------------ 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/web-next/components/PostActions.tsx b/web-next/components/PostActions.tsx index 54d9ff7..a531b9b 100644 --- a/web-next/components/PostActions.tsx +++ b/web-next/components/PostActions.tsx @@ -120,11 +120,11 @@ export function PostActions({ return (
- setEditing(true)} className="second-brown"> + setEditing(true)} className="second-brown" style={{ cursor: 'pointer' }}> {t('edit')} {' '} - { if (!busy) remove() }} className="second-brown"> + { if (!busy) remove() }} className="second-brown" style={{ cursor: 'pointer' }}> {t('delete')} {error && {error}} diff --git a/web-next/components/SiteHeader.tsx b/web-next/components/SiteHeader.tsx index f1fcca7..184c604 100644 --- a/web-next/components/SiteHeader.tsx +++ b/web-next/components/SiteHeader.tsx @@ -1,8 +1,8 @@ 'use client' import { useState } from 'react' +import { useLocale } from 'next-intl' import { Link } from '@/i18n/navigation' -import { useRouter } from '@/i18n/navigation' const SERVER_NAME = 'NovaWoW' @@ -26,28 +26,19 @@ export function SiteHeader({ realmHref: string playersHref: string }) { - const router = useRouter() + const locale = useLocale() const [open, setOpen] = useState(false) - async function logout(e: React.MouseEvent) { - e.preventDefault() - await fetch('/api/auth/logout', { method: 'POST', credentials: 'same-origin' }) - router.push('/') - router.refresh() - } - return (
@@ -152,7 +141,7 @@ export function SiteHeader({ title={SERVER_NAME} /> - +