feat: 기념일 꾸밈 — 할로윈·빼빼로데이·크리스마스·추석 기간에만 이야기 주제와 구름 합치기 그림이 바뀜
frontend/src/b/holiday.ts 한 곳에 기간·주제·배경·게임 그림. ?holiday=<key> 로 미리 보기. GA: game_start theme 추가, talk_post topic 6~9.
This commit is contained in:
1 parent
48299e3ac5
commit
4fec164364
36 files changed
+171
-13
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import { useInfiniteQuery } from '@tanstack/react-query'
|
||||
import { listMyTalksInfiniteOptions, listTalksInfiniteOptions } from '@nalssigak/shared/api/client/@tanstack/react-query.gen'
|
||||
import { TalkTopic } from '@nalssigak/shared/api/client/types.gen'
|
||||
import { currentHoliday, HOLIDAYS } from './holiday'
|
||||
import { useRegion } from './regionContext'
|
||||
|
||||
// 글 주제와 이름
|
||||
@@ -10,9 +11,16 @@ export const TOPICS = [
|
||||
[TalkTopic.RAIN, '비·눈'],
|
||||
[TalkTopic.FOLIAGE, '단풍·꽃'],
|
||||
[TalkTopic.OUTFIT, '오늘 옷차림'],
|
||||
...HOLIDAYS.map((h) => [h.topic, h.name] as const),
|
||||
] as const
|
||||
export const topicName = (t?: number) => TOPICS.find(([k]) => k === t)?.[1] ?? '동네 이야기'
|
||||
|
||||
/** 지금 고를 수 있는 주제: 기념일 주제는 그 기간에만 */
|
||||
export function openTopics() {
|
||||
const on = currentHoliday()?.topic
|
||||
return TOPICS.filter(([k]) => !HOLIDAYS.some((h) => h.topic === k) || k === on)
|
||||
}
|
||||
|
||||
/** 주제별 글 페이지 목록 (topic 없으면 전체) */
|
||||
export function useTopicTalks(topic?: TalkTopic) {
|
||||
const { region } = useRegion()
|
||||
|
||||
Reference in new issue
Block a user