[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:
1 parent
8219d3f45e
commit
fad20e8958
20 files changed
+116
-62
No files matched your search
@@ -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] {
|
||||
@@ -30,6 +31,7 @@ const HOME_MAX = 4;
|
||||
|
||||
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]));
|
||||
@@ -42,7 +44,7 @@ export function Rooms() {
|
||||
<>
|
||||
<div data-pg="home">
|
||||
<section className="sec" id="units" aria-labelledby="units-heading">
|
||||
<p className="kicker">Stay</p>
|
||||
<p className="kicker">{lodging ? 'Stay' : unitWord(payload.place.category)}</p>
|
||||
<h2 id="units-heading">{sectionName(payload, spec.path, `${spec.label} 안내`)}</h2>
|
||||
<div className="rooms">
|
||||
{units.slice(0, HOME_MAX).map((unit) => (
|
||||
@@ -71,7 +73,7 @@ export function Rooms() {
|
||||
return (
|
||||
<section key={unit.unitId} className="sec" id={`unit-${unit.slug}`}>
|
||||
<p className="kicker">
|
||||
Room {String(i + 1).padStart(2, '0')}
|
||||
{unitWord(payload.place.category)} {String(i + 1).padStart(2, '0')}
|
||||
</p>
|
||||
<h2>
|
||||
{main} {sub && <span className="sub">{sub}</span>}
|
||||
@@ -102,9 +104,11 @@ export function Rooms() {
|
||||
<button type="button" className="btn ghost" onClick={() => setOpen(unit)}>
|
||||
자세히
|
||||
</button>
|
||||
<button type="button" className="btn" onClick={() => window.dispatchEvent(new Event(BOOK_EVENT))}>
|
||||
예약 요청
|
||||
</button>
|
||||
{lodging && (
|
||||
<button type="button" className="btn" onClick={() => window.dispatchEvent(new Event(BOOK_EVENT))}>
|
||||
예약 요청
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user