From 61d60682a68ce8679ab836d2ff05ad8d0dbbef56 Mon Sep 17 00:00:00 2001 From: Artemy Date: Wed, 24 Jan 2024 15:31:45 +0300 Subject: [PATCH] Update components.js --- src/components.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components.js b/src/components.js index 80a5bac..aa18666 100644 --- a/src/components.js +++ b/src/components.js @@ -7,14 +7,14 @@ export function countryPopup(country, properties) { return `
${img(country.img)} ${title(country.name)} + ${tags(properties.tags)}
- ${JSON.parse(properties.tags || "[]").join(", ")} - ${l("founded")}: ${new Date(country.date).toLocaleDateString()} + ${l("founded")}: ${new Date(country.date).toLocaleDateString()}
${ country.description ? `
${converter.makeHtml(country.description)}
` : "" - } + }
${l("area")}: ${properties.area} ${l("km")}²
@@ -27,6 +27,14 @@ export function countryPopup(country, properties) {
`; } +function tags(tags) { + let tagstxt = JSON.parse(tags || "[]").join(", "); + + return tagstxt + ? `
${tagstxt}
` + : ""; +} + function img(url) { return `
`; }