From 462d9056f40c85550ceaed45b4e4b1c6d76d8203 Mon Sep 17 00:00:00 2001
From: Anton Tranelis <31516529+antontranelis@users.noreply.github.com>
Date: Tue, 11 Nov 2025 14:49:39 +0100
Subject: [PATCH] fix(lib): set login link in placeholder text (#432)
---
.../Subcomponents/ItemPopupComponents/TextView.tsx | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx
index 03076bed..67968ff2 100644
--- a/lib/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx
+++ b/lib/src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx
@@ -5,6 +5,7 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import Markdown from 'react-markdown'
+import { Link as RouterLink } from 'react-router-dom'
import remarkBreaks from 'remark-breaks'
import { useAddFilterTag } from '#components/Map/hooks/useFilter'
@@ -46,7 +47,9 @@ export const TextView = ({
innerText = replacedText = rawText
} else if (text === undefined) {
// Field was omitted by backend (no permission)
- innerText = replacedText = `Login to see this ${item?.layer?.item_default_name ?? 'item'}`
+ innerText = replacedText = `[Login](/login) to see this ${
+ item?.layer?.item_default_name ?? 'item'
+ }`
} else if (text === null || text === '') {
// Field is not set or empty - show nothing
innerText = ''
@@ -127,7 +130,12 @@ export const TextView = ({
else return children
}
- // Default: Link
+ // Internal Link (React Router)
+ if (href.startsWith('/')) {
+ return {children}
+ }
+
+ // External Link
return (
{children}