feat: 시안 B 화면을 기본 화면으로, Hey API로 백엔드 연결
- 예전 화면(/, /a)과 목업 데이터를 지우고 시안 B 를 / 로 - @hey-api/openapi-ts 로 타입·TanStack Query 함수 생성, 토큰·401 갱신 처리 - 공유는 기본 공유창, 없으면 링크 복사 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e134295ce5
commit
f8b47f064a
147 files changed
+12350
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { createContext, use } from 'react'
|
||||
import type { SlideBg } from './types'
|
||||
|
||||
export type SharePayload = { title: string; icon: string; bg: SlideBg; messages: string[] }
|
||||
|
||||
export type SheetState =
|
||||
| { type: 'gak'; indexId: number }
|
||||
| { type: 'article'; articleId: number }
|
||||
| { type: 'share'; share: SharePayload }
|
||||
| { type: 'comments'; postId: number }
|
||||
| { type: 'seasonWeek' }
|
||||
| { type: 'login' }
|
||||
| { type: 'region' }
|
||||
| null
|
||||
|
||||
export type SheetApi = { open: (s: Exclude<SheetState, null>) => void; close: () => void }
|
||||
|
||||
export const SheetContext = createContext<SheetApi | null>(null)
|
||||
|
||||
export function useSheet() {
|
||||
const ctx = use(SheetContext)
|
||||
if (!ctx) throw new Error('useSheet must be used inside SheetProvider')
|
||||
return ctx
|
||||
}
|
||||
Reference in new issue
Block a user