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:
@ -85,7 +85,7 @@ function DeleteBtn({ id, name }: { id: number; name?: string }) {
|
|||||||
function ContactMenu({ number, name }: { number?: string; name?: string }) {
|
function ContactMenu({ number, name }: { number?: string; name?: string }) {
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const digits = (number || "").replace(/[^\d+]/g, "");
|
const digits = (number || "").replace(/[^\d+]/g, "");
|
||||||
const lookup = encodeURIComponent(digits);
|
const lookup = encodeURIComponent(digits.startsWith("+44") ? "0" + digits.slice(3) : digits);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<button className="btn" style={{ padding: "4px 8px", lineHeight: 1 }} onClick={() => setOpen(!open)}>⋮</button>
|
<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
|
<a
|
||||||
className="btn"
|
className="btn"
|
||||||
href={"https://who-called.co.uk/search?q=" + lookup}
|
href={"https://who-called.co.uk/Number/" + lookup}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
style={{ display: "block", borderRadius: 0, border: "none", width: "100%", justifyContent: "flex-start" }}
|
style={{ display: "block", borderRadius: 0, border: "none", width: "100%", justifyContent: "flex-start" }}
|
||||||
|
|||||||
@ -156,7 +156,7 @@ export default function MessagesPage() {
|
|||||||
function MsgContactMenu({ number, name, callerid }: { number?: string; name?: string; callerid?: string }) {
|
function MsgContactMenu({ number, name, callerid }: { number?: string; name?: string; callerid?: string }) {
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const digits = (number || "").replace(/[^\d+]/g, "");
|
const digits = (number || "").replace(/[^\d+]/g, "");
|
||||||
const lookup = encodeURIComponent(digits);
|
const lookup = encodeURIComponent(digits.startsWith("+44") ? "0" + digits.slice(3) : digits);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<button className="btn" style={{ padding: "4px 8px", lineHeight: 1 }} onClick={() => setOpen(!open)}>⋮</button>
|
<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
|
<a
|
||||||
className="btn"
|
className="btn"
|
||||||
href={"https://who-called.co.uk/search?q=" + lookup}
|
href={"https://who-called.co.uk/Number/" + lookup}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noreferrer"
|
rel="noreferrer"
|
||||||
style={{ display: "block", borderRadius: 0, border: "none", width: "100%", justifyContent: "flex-start" }}
|
style={{ display: "block", borderRadius: 0, border: "none", width: "100%", justifyContent: "flex-start" }}
|
||||||
|
|||||||
Reference in New Issue
Block a user