chore(publish): replace source tree with static export at repo root
Publish the prerendered static export (index.html, 404.html, cinema/,
c/, about/, for-cinemas/, for-film-lovers/, assets/, images/, og/,
sitemap.xml, robots.txt) as the site root and remove the React Router
+ Nitro source tree from this branch. Source remains available in
history at 0548772.
Note: public/sw.js here reports VERSION v2.0.5 while the removed source
tree (v2.1.0) was newer, and .gitignore was not carried over.
This commit is contained in:
1 parent
05487728a7
commit
e6c4ebff48
394 files changed
+3977
-37891
No files matched your search
@@ -1,150 +0,0 @@
|
||||
import {
|
||||
IconBrandFacebook,
|
||||
IconBrandInstagram,
|
||||
IconBrandLine,
|
||||
IconCircleCheck,
|
||||
IconExternalLink,
|
||||
IconMail,
|
||||
IconPhone,
|
||||
IconTicket,
|
||||
IconWorld,
|
||||
} from "@tabler/icons-react";
|
||||
|
||||
import type { Cinema, ContactChannel } from "@/lib/cinemas";
|
||||
import { resolveContact, type ContactKind } from "@/lib/contact-link";
|
||||
import { COLORS } from "@/lib/design-tokens";
|
||||
import { useI18n } from "@/lib/i18n";
|
||||
import { translate } from "@/lib/i18n/messages";
|
||||
|
||||
/** ไอคอนตามชนิดช่องทาง (เดาจาก label ก่อน แล้วค่อยดูจาก kind/URL) */
|
||||
function ChannelIcon({
|
||||
label,
|
||||
kind,
|
||||
href,
|
||||
}: {
|
||||
label: string;
|
||||
kind: ContactKind | null;
|
||||
href: string | null;
|
||||
}) {
|
||||
const text = label.toLowerCase();
|
||||
const url = (href ?? "").toLowerCase();
|
||||
|
||||
if (kind === "tel") return <IconPhone size={16} aria-hidden="true" />;
|
||||
if (kind === "mailto") return <IconMail size={16} aria-hidden="true" />;
|
||||
if (url.includes("facebook") || text.includes("facebook")) {
|
||||
return <IconBrandFacebook size={16} aria-hidden="true" />;
|
||||
}
|
||||
if (url.includes("instagram") || text.includes("instagram")) {
|
||||
return <IconBrandInstagram size={16} aria-hidden="true" />;
|
||||
}
|
||||
if (url.includes("line.me") || text.includes("line")) {
|
||||
return <IconBrandLine size={16} aria-hidden="true" />;
|
||||
}
|
||||
if (
|
||||
text.includes("จอง") ||
|
||||
text.includes("book") ||
|
||||
text.includes("ticket")
|
||||
) {
|
||||
return <IconTicket size={16} aria-hidden="true" />;
|
||||
}
|
||||
return <IconWorld size={16} aria-hidden="true" />;
|
||||
}
|
||||
|
||||
function ContactRow({ channel }: { channel: ContactChannel }) {
|
||||
const resolved = resolveContact(channel);
|
||||
const value =
|
||||
channel.value.trim() === "" ? (channel.href ?? "") : channel.value;
|
||||
|
||||
const body = (
|
||||
<>
|
||||
<span className="flex min-w-0 items-center gap-2">
|
||||
<span className="text-[#999]">
|
||||
<ChannelIcon
|
||||
label={channel.label}
|
||||
kind={resolved.kind}
|
||||
href={resolved.href}
|
||||
/>
|
||||
</span>
|
||||
<span className="truncate">{value}</span>
|
||||
</span>
|
||||
{resolved.external ? (
|
||||
<IconExternalLink
|
||||
size={16}
|
||||
aria-hidden="true"
|
||||
className="shrink-0 text-[#999]"
|
||||
/>
|
||||
) : null}
|
||||
</>
|
||||
);
|
||||
|
||||
const rowClass =
|
||||
"flex min-h-11 items-center justify-between gap-3 rounded-lg text-sm transition-colors";
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2">
|
||||
<span className="text-sm text-[#999]">{channel.label}</span>
|
||||
{resolved.href ? (
|
||||
<a
|
||||
href={resolved.href}
|
||||
{...(resolved.external
|
||||
? { target: "_blank", rel: "noopener noreferrer" }
|
||||
: { rel: "nofollow" })}
|
||||
className={`${rowClass} hover:text-[#D47272] focus-visible:outline focus-visible:outline-2 focus-visible:outline-[#A92626]`}
|
||||
>
|
||||
{body}
|
||||
</a>
|
||||
) : (
|
||||
// ไม่มีข้อมูลที่ใช้เป็นลิงก์ได้ — แสดงเป็นข้อความ ไม่หลอกให้กด
|
||||
<span className={rowClass}>{body}</span>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
/** กล่องติดต่อ/จองตั๋ว — แต่ละส่วนซ่อนได้ถ้ายังไม่มีข้อมูล */
|
||||
export function ContactPanel({ cinema }: { cinema: Cinema }) {
|
||||
const { messages } = useI18n();
|
||||
|
||||
return (
|
||||
<aside
|
||||
className="flex flex-col justify-between gap-6 rounded-xl p-6"
|
||||
style={{ border: `1px solid ${COLORS.border}` }}
|
||||
>
|
||||
<div className="flex flex-col gap-4">
|
||||
<h2 className="text-2xl font-semibold leading-[1.3]">
|
||||
{cinema.contact_heading?.trim() || messages.detail.contactTitle}
|
||||
</h2>
|
||||
|
||||
{cinema.contacts.length === 0 ? (
|
||||
<p className="text-sm text-[#999]">
|
||||
{messages.detail.contactsFallback}
|
||||
</p>
|
||||
) : (
|
||||
cinema.contacts.map((channel) => (
|
||||
<ContactRow key={channel.label} channel={channel} />
|
||||
))
|
||||
)}
|
||||
|
||||
<div className="flex flex-col gap-3">
|
||||
<span className="text-sm text-[#999]">
|
||||
{messages.detail.paymentMethods}
|
||||
</span>
|
||||
{cinema.payments.length === 0 ? (
|
||||
<span className="text-sm text-[#999]">
|
||||
{messages.detail.paymentsFallback}
|
||||
</span>
|
||||
) : (
|
||||
<div className="flex flex-wrap items-center gap-6">
|
||||
{cinema.payments.map((payment) => (
|
||||
<span key={payment} className="flex items-center gap-1 text-sm">
|
||||
<IconCircleCheck size={16} />
|
||||
{translate(messages.payments, payment)}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user