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,124 +0,0 @@
|
||||
import { CinemaCard } from "@/components/site/CinemaCard";
|
||||
import type { Cinema, CinemaCategory, VenueType } from "@/lib/cinemas";
|
||||
import { useI18n } from "@/lib/i18n";
|
||||
|
||||
/** กริดการ์ดโรงหนัง — ใช้ทั้งหน้าแรกและส่วน "โรงหนังอิสระอื่นๆ" */
|
||||
export function CinemaGrid({
|
||||
cinemas,
|
||||
source = "list",
|
||||
searchQuery,
|
||||
}: {
|
||||
cinemas: Cinema[];
|
||||
source?: string;
|
||||
searchQuery?: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
|
||||
{cinemas.map((cinema, index) => (
|
||||
<CinemaCard
|
||||
key={cinema.slug}
|
||||
cinema={cinema}
|
||||
index={index}
|
||||
source={source}
|
||||
searchQuery={searchQuery}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
type CategoryFilterProps = {
|
||||
/** เก็บคีย์หมวดเป็นภาษาไทยเสมอ เพื่อใช้กรองข้อมูลได้ทุกภาษา */
|
||||
active: CinemaCategory;
|
||||
categories: readonly CinemaCategory[];
|
||||
onChange: (category: CinemaCategory) => void;
|
||||
/** ชั้นกรองที่ 1 — ประเภทโรงหนัง (แสดงต่อจาก "ทั้งหมด") */
|
||||
venues?: readonly VenueType[];
|
||||
activeVenue?: VenueType | null;
|
||||
onVenueChange?: (venue: VenueType | null) => void;
|
||||
};
|
||||
|
||||
const chipClass = (isActive: boolean) =>
|
||||
`relative rounded-[18px] border px-4 py-2 text-sm after:absolute after:-inset-y-1.5 after:inset-x-0 after:content-[''] ${
|
||||
isActive
|
||||
? "border-[#A92626] bg-gradient-to-b from-[#8F0808]/30 to-[#1B1B1B]/0 text-[#D47272]"
|
||||
: "border-[#303030] bg-[#242424] text-[#B3B3B3] transition hover:border-[#A92626]/60"
|
||||
}`;
|
||||
|
||||
/**
|
||||
* แถบกรองสองชั้นในแถวเดียว
|
||||
* 1) ประเภทโรงหนัง (ท้องถิ่น / อินดี้ / กลุ่มคนฉายหนัง) — แทรกหลัง "ทั้งหมด"
|
||||
* 2) หมวดภาพยนตร์แบบเดิม (อาร์ตเฮาส์ / สารคดี / …)
|
||||
* เลือกได้ทีละชั้น: กดประเภท → ล้างหมวด, กดหมวด → ล้างประเภท (กันการกรองซ้อนที่ผู้ใช้คาดไม่ถึง)
|
||||
*/
|
||||
export function CategoryFilter({
|
||||
active,
|
||||
categories,
|
||||
onChange,
|
||||
venues = [],
|
||||
activeVenue = null,
|
||||
onVenueChange,
|
||||
}: CategoryFilterProps) {
|
||||
const { messages } = useI18n();
|
||||
const [allCategory, ...restCategories] = categories;
|
||||
const hasVenues = venues.length > 0 && typeof onVenueChange === "function";
|
||||
const allActive = active === allCategory && activeVenue === null;
|
||||
|
||||
return (
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
onChange(allCategory);
|
||||
onVenueChange?.(null);
|
||||
}}
|
||||
aria-pressed={allActive}
|
||||
className={chipClass(allActive)}
|
||||
>
|
||||
{messages.categories[allCategory]}
|
||||
</button>
|
||||
|
||||
{hasVenues
|
||||
? venues.map((venue) => {
|
||||
const isActive = activeVenue === venue;
|
||||
return (
|
||||
<button
|
||||
key={venue}
|
||||
type="button"
|
||||
onClick={() => {
|
||||
onChange(allCategory);
|
||||
onVenueChange?.(isActive ? null : venue);
|
||||
}}
|
||||
aria-pressed={isActive}
|
||||
className={chipClass(isActive)}
|
||||
>
|
||||
{messages.venues[venue]}
|
||||
</button>
|
||||
);
|
||||
})
|
||||
: null}
|
||||
|
||||
{hasVenues ? (
|
||||
<span aria-hidden="true" className="mx-1 h-6 w-px bg-[#303030]" />
|
||||
) : null}
|
||||
|
||||
{restCategories.map((category) => {
|
||||
const isActive = category === active && activeVenue === null;
|
||||
return (
|
||||
<button
|
||||
key={category}
|
||||
type="button"
|
||||
onClick={() => {
|
||||
onChange(category);
|
||||
onVenueChange?.(null);
|
||||
}}
|
||||
aria-pressed={isActive}
|
||||
className={chipClass(isActive)}
|
||||
>
|
||||
{messages.categories[category]}
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user