Dosiye y'umwimerere ikora
public/app.js
Kode n'impapuro z'ingero zikora bigumana amazina n'inyandiko by'umwimerere. Isomo n'amabwiriza ya dosiye birabisobanura mu rurimi rwawe.
import { BOOKING_URL } from "./config.js";
const a = document.querySelector("#booking"),
status = document.querySelector("[role=status]");
try {
const u = new URL(BOOKING_URL);
if (
u.protocol !== "https:" ||
u.hostname !== "calendly.com" ||
u.pathname.includes("YOUR-")
)
throw Error();
a.href = u.href;
a.hidden = false;
status.textContent =
"Booking opens on Calendly. Check the time zone before confirming.";
} catch {
status.textContent = "Set your own public event link in config.js first.";
}