From 846dea24db34b5bb781153b6b129a2bd0693e88b Mon Sep 17 00:00:00 2001 From: Anton Date: Sat, 22 Jul 2023 07:28:50 +0200 Subject: [PATCH] lowercase tags effect marker color --- src/Components/Map/Layer.tsx | 2 +- src/Components/Map/Tags.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Components/Map/Layer.tsx b/src/Components/Map/Layer.tsx index c8cb7b6a..a77828a5 100644 --- a/src/Components/Map/Layer.tsx +++ b/src/Components/Map/Layer.tsx @@ -31,7 +31,7 @@ export const Layer = (props: LayerProps) => { const getTags = (item: Item) => { console.log(item.text); const regex = /(^|\B)#(?![0-9_]+\b)([a-zA-Z0-9_]{1,30})(\b|\r)/g; - const strings = item.text.match(regex); + const strings = item.text.toLocaleLowerCase().match(regex); console.log(strings); const tags: Tag[] = []; strings?.map(tag => { diff --git a/src/Components/Map/Tags.tsx b/src/Components/Map/Tags.tsx index 0b504657..ef5c0593 100644 --- a/src/Components/Map/Tags.tsx +++ b/src/Components/Map/Tags.tsx @@ -7,6 +7,7 @@ export function Tags({data} : {data: Tag[]}) { const addTag = useAddTag(); useEffect(() => { data.map(tag => { + tag.id = tag.id.toLocaleLowerCase(); addTag(tag) }) }, [addTag, data])