diff --git a/frontend/src/b/Sheets.tsx b/frontend/src/b/Sheets.tsx index 530dd3f..71ddd00 100644 --- a/frontend/src/b/Sheets.tsx +++ b/frontend/src/b/Sheets.tsx @@ -1,5 +1,6 @@ import { useInfiniteQuery, useMutation, useQuery, useQueryClient, type InfiniteData } from '@tanstack/react-query' import { useCallback, useDeferredValue, useEffect, useMemo, useRef, useState, type FormEvent, type ReactNode } from 'react' +import regionPages from '../../seo/region.json' import { setTokens, subscribeAuth } from '../api/auth' import { SITE_URL } from '../api/setup' import { @@ -133,6 +134,7 @@ function SheetHost({ state, onClose }: { state: SheetState; onClose: () => void {state.type === 'region' && } )} + {!state && } ) } @@ -987,6 +989,27 @@ function MeSheet({ onDone }: { onDone: () => void }) { /* ---------- 지역 ---------- */ const LOCATE_TEXT = { idle: '', locating: '위치를 찾는 중이에요…', denied: '위치 권한이 꺼져 있어요. 아래 목록에서 골라 주세요.', error: '위치를 찾지 못했어요. 아래 목록에서 골라 주세요.' } as const +/** 구 코드 → 그 구가 속한 지역 페이지 주소 */ +const pageHref = (code: string) => { + const p = regionPages.find((g) => g.regions.some((r) => r.code === code)) + return p ? `/today/${p.path}` : '/' +} + +/** 지역 바꾸기가 닫혀 있을 때도 지역 페이지 링크를 HTML에 둔다 (검색 로봇이 링크를 따라가게) */ +function RegionLinks() { + return ( + + ) +} + function RegionSheet({ onDone }: { onDone: () => void }) { const { region, setRegion, locate, locateStatus } = useRegion() const { me, logout } = useAuth() @@ -1018,10 +1041,11 @@ function RegionSheet({ onDone }: { onDone: () => void }) {