[feat] solution: 날씨 조건 세분화,
공식채널 단일화, 한일옥 거리 반영 날씨 조건을 7종으로 세분화, 축제 종료 여부와 무관하게 상시 노출, '지역 읽기'갈래 축소, 야놀자(NOL) 브랜드명 제거.
This commit is contained in:
1 parent
29af37f158
commit
1f26bc7065
23 files changed
+421
-185
No files matched your search
@@ -2,7 +2,7 @@ import {ExternalLink, Mail, MapPin, Phone} from 'lucide-react';
|
||||
import {useSite} from '@site/lib/site-context';
|
||||
import {isoDate} from '@site/lib/format';
|
||||
// 채널 이름표는 예약·문의 섹션과 같은 표를 쓴다 — 같은 채널이 자리마다 다른 이름으로 뜨면 안 된다.
|
||||
import {channelLabel, publicLinks} from '@site/lib/derive';
|
||||
import {channelLabel, primaryChannelLink} from '@site/lib/derive';
|
||||
|
||||
/**
|
||||
* 푸터.
|
||||
@@ -14,9 +14,8 @@ import {channelLabel, publicLinks} from '@site/lib/derive';
|
||||
export function SiteFooter() {
|
||||
const payload = useSite();
|
||||
const {place, site} = payload;
|
||||
// 확정된 채널만 — 확정 전 URL 은 동명 업소일 수 있다.
|
||||
// ★ sameAs 와 같은 목록이어야 한다 — 화면에 없는 주소가 구조화 데이터에 있으면 발행이 막힌다.
|
||||
const links = publicLinks(payload);
|
||||
// ★ 확정 채널을 전부 늘어놓지 않는다 — 예약 우선으로 딱 하나만 낸다(seo/jsonld.ts 주석 참고).
|
||||
const link = primaryChannelLink(payload);
|
||||
const address = place.roadAddress ?? place.address;
|
||||
|
||||
return (
|
||||
@@ -58,23 +57,21 @@ export function SiteFooter() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{links.length > 0 && (
|
||||
{link && (
|
||||
<nav aria-label="공식 채널" className="md:col-span-5">
|
||||
<h2 className="label mb-3 !text-current opacity-60">공식 채널</h2>
|
||||
<ul className="flex flex-wrap gap-2">
|
||||
{links.map((link) => (
|
||||
<li key={link.url}>
|
||||
<a
|
||||
href={link.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1.5 rounded-lg border border-current/25 px-3 py-2 text-[length:var(--fs-xs)] font-medium transition-colors hover:bg-current/10"
|
||||
>
|
||||
<span>{channelLabel(link)}</span>
|
||||
<ExternalLink className="size-3.5" />
|
||||
</a>
|
||||
</li>
|
||||
))}
|
||||
<li>
|
||||
<a
|
||||
href={link.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="inline-flex items-center gap-1.5 rounded-lg border border-current/25 px-3 py-2 text-[length:var(--fs-xs)] font-medium transition-colors hover:bg-current/10"
|
||||
>
|
||||
<span>{channelLabel(link)}</span>
|
||||
<ExternalLink className="size-3.5" />
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
)}
|
||||
|
||||
@@ -36,7 +36,17 @@ export function WeatherSection() {
|
||||
const mood = weatherMood(weather?.condition ?? '');
|
||||
const band = weatherBand(weather?.temperature ?? 0);
|
||||
const notes = payload.local.weather;
|
||||
const skyKey = weather?.condition === '구름많음' ? '구름많음' : mood;
|
||||
const {condition} = weather ?? {};
|
||||
const skyKey =
|
||||
condition === '구름많음' ||
|
||||
condition === '안개' ||
|
||||
condition === '소나기' ||
|
||||
condition === '뇌우' ||
|
||||
condition === '이슬비' ||
|
||||
condition === '강한비' ||
|
||||
condition === '어는비'
|
||||
? condition
|
||||
: mood;
|
||||
// 조건별 문장이 우선. 없으면 예전 한 칸(note)으로 떨어진다 — 옛 payload 도 깨지지 않는다.
|
||||
const line = useWeatherNote(notes?.noteSets?.[skyKey], notes?.notes?.[mood] ?? weather?.note);
|
||||
/*
|
||||
|
||||
@@ -223,10 +223,10 @@ describe('예약 버튼은 예약 화면으로 바로 간다', () => {
|
||||
],
|
||||
};
|
||||
|
||||
it('네이버 예약이 플레이스보다 먼저 나온다 — 플레이스는 한 번 더 눌러야 한다', () => {
|
||||
it('네이버 예약이 있으면 네이버 플레이스는 예약 목록에서 빠진다 — 같은 예약이 두 번 뜨지 않는다', () => {
|
||||
const links = stayBookingView(withBooking)!.links;
|
||||
expect(links[0].channel).toBe(LinkChannel.NAVER_BOOKING);
|
||||
expect(links.map((l) => l.channel)).toContain(LinkChannel.NAVER_PLACE);
|
||||
expect(links.map((l) => l.channel)).not.toContain(LinkChannel.NAVER_PLACE);
|
||||
});
|
||||
|
||||
it('버튼 문구가 "네이버 예약에서 예약" 이 되지 않는다', () => {
|
||||
|
||||
@@ -19,6 +19,17 @@ it('uses the first sky and temperature lines for deterministic HTML', () => {
|
||||
expect(render(weather)).toBe(render(weather));
|
||||
});
|
||||
|
||||
it('uses condition-specific notes for fog, showers and thunderstorms', () => {
|
||||
const weather = {temperature: 20, observedAt: '2026-09-15T12:00', condition: '소나기', noteSets: {'소나기': ['소나기 첫 줄']}, tempNoteSets: {'선선': ['선선 첫 줄']}};
|
||||
expect(render(weather)).toContain('소나기 첫 줄');
|
||||
});
|
||||
|
||||
it('uses condition-specific notes for the rain subtypes', () => {
|
||||
const weather = {temperature: 5, observedAt: '2026-09-15T12:00', condition: '어는비', noteSets: {'어는비': ['어는비 첫 줄'], '비': ['일반 비 첫 줄']}, tempNoteSets: {'추움': ['추움 첫 줄']}};
|
||||
expect(render(weather)).toContain('어는비 첫 줄');
|
||||
expect(render(weather)).not.toContain('일반 비 첫 줄');
|
||||
});
|
||||
|
||||
it('preserves legacy single notes', () => {
|
||||
const html = render({temperature: 15, observedAt: '2026-09-15T12:00', condition: '비', notes: {'비': '기존 비 안내'}, tempNotes: {'쌀쌀': '겉옷 안내'}});
|
||||
expect(html).toContain('기존 비 안내');
|
||||
|
||||
Reference in new issue
Block a user