Use 0-prefix format for who-called.co.uk lookup URLs

- swap +44 prefix to 0 before lookup
- applied to messages and contacts dropdown menus
This commit is contained in:
jp
2026-08-13 20:04:00 +01:00
parent efc7e91651
commit 3155020f67
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(digits);
const lookup = encodeURIComponent(digits.startsWith("+44") ? "0" + digits.slice(3) : 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://who-called.co.uk/search?q=" + lookup}
href={"https://who-called.co.uk/Number/" + 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(digits);
const lookup = encodeURIComponent(digits.startsWith("+44") ? "0" + digits.slice(3) : 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://who-called.co.uk/search?q=" + lookup}
href={"https://who-called.co.uk/Number/" + lookup}
target="_blank"
rel="noreferrer"
style={{ display: "block", borderRadius: 0, border: "none", width: "100%", justifyContent: "flex-start" }}