feat: 구로 나뉜 13개 시의 구마다 자기 주소(/today/gyeonggi/seongnam/bundang, 39장), 구를 고르면 구 주소로

This commit is contained in:
minaChoi committed 2026-10-20 09:35:16 +09:00
1 parent 0a16c5329d
commit 96cbd19c61
9 files changed
+595 -15

No files matched your search

+4
View File
@@ -1,4 +1,5 @@
import { createContext, use } from 'react'
import regionPages from '../../seo/region.json'
import type { RegionData } from '../api/client/types.gen'
export type LocateStatus = 'idle' | 'locating' | 'denied' | 'error'
@@ -7,6 +8,9 @@ export type RegionApi = { region: RegionData; setRegion: (r: RegionData) => void
export const DEFAULT_REGION: RegionData = { code: '1144000000', name: '서울 마포구', short_name: '마포구', lat: 37.56071, lon: 126.91053 }
/** 구 하나만 보여 주는 지역 페이지: 일반 시군구, 또는 구로 나뉜 시의 구 페이지 */
export const ownPage = (code: string) => regionPages.find((p) => p.regions.length === 1 && p.regions[0].code === code)
export const RegionContext = createContext<RegionApi | null>(null)
export function useRegion() {