diff --git a/solution/site/src/app.test.tsx b/solution/site/src/app.test.tsx index 8a789fe..cc5611e 100644 --- a/solution/site/src/app.test.tsx +++ b/solution/site/src/app.test.tsx @@ -38,3 +38,16 @@ it('첫 화면 문구가 따로 있어도 한 줄 요약이 화면에 나온다' expect(renderToStaticMarkup()).toContain('검색에 쓰는 한 줄 요약'); } }); + +it('고택은 섹션 순서와 상관없이 날씨를 첫 화면 바로 아래에 둔다', () => { + const payload = withTemplate('paper'); + const weather = payload.theme.sections.find((section) => section.id === 'weather'); + if (weather) weather.enabled = true; + payload.theme.sections = [...payload.theme.sections.filter((s) => s.id !== 'weather'), ...(weather ? [weather] : [])]; + const html = renderToStaticMarkup(); + const hero = html.indexOf('class="hero"'); + const brief = html.indexOf('class="wbrief"'); + expect(hero).toBeGreaterThan(-1); + expect(brief).toBeGreaterThan(hero); + expect(html.slice(hero, brief)).not.toContain('class="sec'); +}); diff --git a/solution/site/src/layouts/index.ts b/solution/site/src/layouts/index.ts index cbef1e4..2ddad67 100644 --- a/solution/site/src/layouts/index.ts +++ b/solution/site/src/layouts/index.ts @@ -17,7 +17,6 @@ import {SectionHead as PaperSectionHead} from './paper/SectionHead'; import {Story as PaperStory} from './paper/Story'; import {StoryTail as PaperStoryTail} from './paper/StoryTail'; import {Video as PaperVideo} from './paper/Video'; -import {Weather as PaperWeather} from './paper/Weather'; const Nothing = () => null; @@ -29,7 +28,7 @@ export const LAYOUTS: Record = { SectionHead: PaperSectionHead, sections: { hero: PaperHero, - weather: PaperWeather, + weather: Nothing, intro: PaperIntro, blog: Nothing, rooms: PaperRooms, diff --git a/solution/site/src/layouts/paper/BookingForm.tsx b/solution/site/src/layouts/paper/BookingForm.tsx index 80e60f2..15f5dc2 100644 --- a/solution/site/src/layouts/paper/BookingForm.tsx +++ b/solution/site/src/layouts/paper/BookingForm.tsx @@ -30,7 +30,7 @@ export function BookingForm() { const slots = useMemo(() => buildArrivalSlots(checkIn), [checkIn]); const [today, setToday] = useState(null); const [offset, setOffset] = useState(0); - const [openStep, setOpenStep] = useState(false); + const [openStep, setOpenStep] = useState(true); const [dateIso, setDateIso] = useState(null); const [slot, setSlot] = useState(null); const [unitId, setUnitId] = useState(units[0]?.unitId ?? null); diff --git a/solution/site/src/layouts/paper/Hero.tsx b/solution/site/src/layouts/paper/Hero.tsx index 7bba111..19fb08c 100644 --- a/solution/site/src/layouts/paper/Hero.tsx +++ b/solution/site/src/layouts/paper/Hero.tsx @@ -1,5 +1,7 @@ import {HeroCatchphrase} from '@site/sections/HeroCatchphrase'; import {useSite} from '@site/lib/site-context'; +import {isSectionEnabled} from '@site/lib/derive'; +import {Weather} from './Weather'; import {Car} from './Car'; const MAX_SLIDES = 5; @@ -14,35 +16,42 @@ export function Hero() { const fixed = narrative.tagline ?? narrative.heroSubline; return ( - - ( - - ))} - /> - - - {(place.addressLocality ?? place.addressRegion) && ( - {place.addressLocality ?? place.addressRegion} - )} - {place.name} - {fixed && {fixed}} - - - - - + <> + + ( + + ))} + /> + + + {(place.addressLocality ?? place.addressRegion) && ( + {place.addressLocality ?? place.addressRegion} + )} + {place.name} + {fixed && {fixed}} + + + + + + {isSectionEnabled(payload, 'weather') && ( + + + + )} + > ); }
{place.addressLocality ?? place.addressRegion}
{fixed}
- -
+ +