From 344a3067fade77c0b848456b3bbb3fd580ba26ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A2u=20Cao?=
Date: Sun, 12 Apr 2026 16:06:02 +0400
Subject: [PATCH] Add WhatsApp numbers/links
---
app/components/place-details.gjs | 29 +++++++++++++++
app/icons/whatsapp.svg | 4 +-
app/utils/icons.js | 3 ++
.../components/place-details-test.gjs | 37 +++++++++++++++++++
4 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/app/components/place-details.gjs b/app/components/place-details.gjs
index 26794f0..664a8fc 100644
--- a/app/components/place-details.gjs
+++ b/app/components/place-details.gjs
@@ -155,6 +155,15 @@ export default class PlaceDetails extends Component {
);
}
+ if (type === 'whatsapp') {
+ return htmlSafe(
+ parts.map((p) => {
+ const safeTel = p.replace(/[\s-]+/g, '');
+ return `${p}`;
+ }).join('
')
+ );
+ }
+
if (type === 'url') {
return htmlSafe(
parts
@@ -184,6 +193,17 @@ export default class PlaceDetails extends Component {
return this.formatMultiLine(rawValues.join(';'), 'phone');
}
+ get whatsapp() {
+ const rawValues = [
+ this.tags.whatsapp,
+ this.tags['contact:whatsapp'],
+ ].filter(Boolean);
+
+ if (rawValues.length === 0) return null;
+
+ return this.formatMultiLine(rawValues.join(';'), 'whatsapp');
+ }
+
get email() {
const val = this.tags.email || this.tags['contact:email'];
return this.formatMultiLine(val, 'email');
@@ -358,6 +378,15 @@ export default class PlaceDetails extends Component {
{{/if}}
+ {{#if this.whatsapp}}
+
+
+
+ {{this.whatsapp}}
+
+
+ {{/if}}
+
{{#if this.website}}
diff --git a/app/icons/whatsapp.svg b/app/icons/whatsapp.svg
index 85109bf..1e0b1b5 100644
--- a/app/icons/whatsapp.svg
+++ b/app/icons/whatsapp.svg
@@ -1,4 +1,4 @@
-