[feat] solution/site,shared: 새 템플릿 8종 업종 확장 — 앞 커밋에서 빠진 본체

앞 커밋(18a2874)에 템플릿 등록과 레이아웃 변경이 빠지고 다른 작업의 새 파일
(services/activity_feed.py, 어디서도 아직 import 하지 않음)이 대신 들어갔다.
같은 작업 폴더를 다른 세션이 함께 쓰고 있었다.

- templates.json: cafe · restaurant · clinic 에 라운드~솔숲 8종
- layouts/*/Rooms.tsx: 객실별 '예약 요청' 버튼은 숙박일 때만, 영문 라벨은 unitWord
- layouts/*/Frame.tsx · Intro.tsx: 이용안내 머리말 · 미니 블로그 설명을 업종 중립으로

eslint·tsc 통과, vitest 123 passed, 33개 사이트 굽기 성공

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
minaChoiandClaude Opus 5.5 committed 2026-09-30 14:58:29 +09:00
1 parent 8219d3f45e
commit fad20e8958
20 files changed
+116 -62

No files matched your search

+10 -6
View File
@@ -1,9 +1,10 @@
import {useState} from 'react';
import {factText, sanitizeUnits} from '@o2o/shared';
import {factText, sanitizeUnits, PlaceCategory} from '@o2o/shared';
import {useSite} from '@site/lib/site-context';
import {sectionName, unitSpec, unitViews, type UnitView} from '@site/lib/derive';
import {Car} from '../paper/Car';
import {BOOK_EVENT} from '../paper/Rooms';
import {unitWord} from '../kit/unitWord';
import {Sheet} from '../paper/Sheet';
function splitName(name: string): [string, string | undefined] {
@@ -32,6 +33,7 @@ const book = () => window.dispatchEvent(new Event(BOOK_EVENT));
export function Rooms() {
const payload = useSite();
const lodging = payload.place.category === PlaceCategory.LODGING;
const units = unitViews(payload);
const spec = unitSpec(payload);
const raw = new Map(sanitizeUnits(payload.units).map((unit) => [unit.unitId, unit]));
@@ -45,7 +47,7 @@ export function Rooms() {
<div data-pg="home">
<section id="units" aria-labelledby="units-heading">
<div className="wrap">
<p className="label">ROOMS</p>
<p className="label">{unitWord(payload.place.category).toUpperCase()}</p>
<h2 id="units-heading">{sectionName(payload, spec.path, `${spec.label} 안내`)}</h2>
<div className="rgrid">
{units.slice(0, HOME_UNITS).map((unit) => (
@@ -69,7 +71,7 @@ export function Rooms() {
return (
<section key={unit.unitId} className="unit" id={`unit-${unit.slug}`}>
<div className="wrap">
<p className="label">ROOM {String(i + 1).padStart(2, '0')}</p>
<p className="label">{unitWord(payload.place.category).toUpperCase()} {String(i + 1).padStart(2, '0')}</p>
<h2>
{main} {sub && <span className="cnt">{sub}</span>}
</h2>
@@ -101,9 +103,11 @@ export function Rooms() {
<button type="button" className="btn ghost" onClick={() => setOpen(unit)}>
{main} 자세히
</button>
<button type="button" className="btn" onClick={book}>
{main} 예약 요청
</button>
{lodging && (
<button type="button" className="btn" onClick={book}>
{main} 예약 요청
</button>
)}
</div>
</div>
</section>