Use who-called.co.uk for phone lookup in dropdown menus

- search by sanitised digits only
- applied to both messages and contacts pages
This commit is contained in:
jp
2026-08-13 20:01:37 +01:00
parent 03d1db3418
commit efc7e91651
2 changed files with 4 additions and 4 deletions

View File

@ -85,7 +85,7 @@ function DeleteBtn({ id, name }: { id: number; name?: string }) {
function ContactMenu({ number, name }: { number?: string; name?: string }) {
const [open, setOpen] = useState(false);
const digits = (number || "").replace(/[^\d+]/g, "");
const lookup = encodeURIComponent(name || number || "");
const lookup = encodeURIComponent(digits);
return (
<>
<button className="btn" style={{ padding: "4px 8px", lineHeight: 1 }} onClick={() => setOpen(!open)}></button>
@ -121,7 +121,7 @@ function ContactMenu({ number, name }: { number?: string; name?: string }) {
)}
<a
className="btn"
href={"https://www.google.com/search?q=" + lookup}
href={"https://who-called.co.uk/search?q=" + lookup}
target="_blank"
rel="noreferrer"
style={{ display: "block", borderRadius: 0, border: "none", width: "100%", justifyContent: "flex-start" }}

View File

@ -156,7 +156,7 @@ export default function MessagesPage() {
function MsgContactMenu({ number, name, callerid }: { number?: string; name?: string; callerid?: string }) {
const [open, setOpen] = useState(false);
const digits = (number || "").replace(/[^\d+]/g, "");
const lookup = encodeURIComponent(name || number || callerid || "");
const lookup = encodeURIComponent(digits);
return (
<>
<button className="btn" style={{ padding: "4px 8px", lineHeight: 1 }} onClick={() => setOpen(!open)}></button>
@ -192,7 +192,7 @@ function MsgContactMenu({ number, name, callerid }: { number?: string; name?: st
)}
<a
className="btn"
href={"https://www.google.com/search?q=" + lookup}
href={"https://who-called.co.uk/search?q=" + lookup}
target="_blank"
rel="noreferrer"
style={{ display: "block", borderRadius: 0, border: "none", width: "100%", justifyContent: "flex-start" }}