Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions pwa/app/(con)/[locale]/con/2025/tickets/RegisterPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useContext, useEffect } from "react";
import { LanguageContext } from "contexts/con/LanguageContext";
import SectionTitle from "components/con/common/typography/SectionTitle";
import SectionSubTitle from "components/con/common/typography/SectionSubtitle";
import Script from "next/script";
import prices from "data/con/2025/prices";
import { Offer } from "types/con";
import dayjs from "dayjs";
Expand Down Expand Up @@ -40,12 +39,35 @@ export default function RegisterPage() {
const iframe = document.getElementById(
"yurplan-widget-141690"
) as HTMLIFrameElement | null;
if (!iframe) return;
const handleLoad = () => {
const loader = document.getElementById("loader");
loader?.classList.add("hidden");
};
iframe.addEventListener("load", handleLoad, true);
iframe?.addEventListener("load", handleLoad, true);

const SRC = "https://assets.yurplan.com/yurplan-v1/dist/widget.js";
const getYp = () =>
(window as unknown as { YurPlanWidgets?: { init: () => void } })
.YurPlanWidgets;

if (getYp()) {
getYp()?.init();
} else if (!document.querySelector(`script[src="${SRC}"]`)) {
const script = document.createElement("script");
script.src = SRC;
script.async = true;
document.body.appendChild(script);
}

const handlePageShow = (e: PageTransitionEvent) => {
if (e.persisted) getYp()?.init();
};
window.addEventListener("pageshow", handlePageShow);

return () => {
iframe?.removeEventListener("load", handleLoad, true);
window.removeEventListener("pageshow", handlePageShow);
};
}, []);

return (
Expand Down Expand Up @@ -184,10 +206,6 @@ export default function RegisterPage() {
data-id="141690"
></iframe>
</div>
<Script
type="text/javascript"
src="https://assets.yurplan.com/yurplan-v1/dist/widget.js"
/>
</div>
</div>
</>
Expand Down
4 changes: 2 additions & 2 deletions pwa/data/con/2026/prices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const prices: Price[] = [
en: "2 days on-site event <br>(Early bird)</br>",
},
price: 139,
limitDate: "2026-05-11",
limitDate: "2026-05-06",
},
{
type: "Regular",
Expand All @@ -28,7 +28,7 @@ const prices: Price[] = [
en: "2 days on-site event <br>(Regular)</br>",
},
price: 179,
startDate: "2026-05-12",
startDate: "2026-05-07",
limitDate: "2026-07-27",
},
{
Expand Down