feat: 계정 레벨 — 날씨각에서 한 일로 각을 모아 레벨업, 레벨로 새 콘텐츠가 열림
- 각: 출석 10, 오늘 타로 10, 날씨 사주 10, 좋아요·댓글 5씩(하루 10), 동네 이야기 글 20, 저녁 체크인 10, 공유 10, 7일 연속 50. 같은 날 같은 대상은 한 번 (point_log) - 레벨: 모은 총량으로 이슬 0 → 햇살 30 → 산들바람 100 → 무지개 200 → 노을 400 → 은하수 700 → 별똥별 1000. 지금 있는 기능은 잠그지 않음 - API: GET /v1/level/me, POST /v1/level/attend, POST /v1/level/share - 화면: 헤더 아바타 레벨 배지, 내 정보 레벨 카드, 내 레벨 창(오늘 받을 각·레벨별로 열리는 것), 레벨이 오르면 축하 창 - 로그인한 사람만 쌓임 (기기 기록은 조작할 수 있어 받지 않음)
This commit is contained in:
1 parent
045d8d6cf0
commit
71974dcf42
27 files changed
+898
-12
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { keepPreviousData, QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { keepPreviousData, MutationCache, QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { myLevelQueryKey } from '@nalssigak/shared/api/client/@tanstack/react-query.gen'
|
||||
import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import './index.css'
|
||||
@@ -11,8 +12,10 @@ import { track } from './lib/analytics'
|
||||
for (const type of ['gesturestart', 'gesturechange']) document.addEventListener(type, (e) => e.preventDefault(), { passive: false })
|
||||
|
||||
// 칩·지역·검색어를 바꿔 다시 받는 동안 이전 결과를 그대로 두어 화면이 비거나 접히지 않게 한다
|
||||
const queryClient = new QueryClient({
|
||||
const queryClient: QueryClient = new QueryClient({
|
||||
defaultOptions: { queries: { staleTime: 5 * 60 * 1000, retry: 1, refetchOnWindowFocus: false, placeholderData: keepPreviousData } },
|
||||
// 각을 주는 일(타로·좋아요·댓글·글·체크인·공유)은 모두 mutation 이라, 끝나면 내 레벨을 다시 받는다
|
||||
mutationCache: new MutationCache({ onSuccess: () => queryClient.invalidateQueries({ queryKey: myLevelQueryKey() }) }),
|
||||
})
|
||||
|
||||
// 홈 화면 설치 조건(서비스 워커)과, 홈 화면 아이콘으로 연 횟수
|
||||
|
||||
Reference in new issue
Block a user