feat: 앱 단풍 지도 — /foliage 지도(두 손가락 확대·이동, 눌러 가까운 명소)·단계별 명소 목록, 단풍철 오늘 피드 맨 앞 카드(foliage_post 좋아요·댓글)와 아이콘. 명소 데이터·계산을 shared/lib/foliage.ts 로 (GA foliage_open·foliage_spot)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
skkimandClaude committed 2026-11-04 17:52:23 +09:00
1 parent 6daa2f4d2a
commit e5cdfa2642
11 files changed
+966 -180

No files matched your search

+6 -1
View File
@@ -7,6 +7,7 @@ import { router, useLocalSearchParams } from 'expo-router';
import { Fragment, useEffect, useRef, type ReactNode } from 'react';
import { RefreshControl, ScrollView, View, type LayoutRectangle } from 'react-native';
import { FoliageCard } from '@/components/foliage/foliage-card';
import { MyGakRow } from '@/components/my-gak/my-gak';
import { isAppPost, PostCard, PostCardSkel } from '@/components/post/post-card';
import { ShortsRail } from '@/components/shorts/rail';
@@ -17,6 +18,7 @@ import { TodayIcons } from '@/components/today/icons';
import { SeasonBand } from '@/components/today/rails';
import { StateBox } from '@/components/ui';
import { track } from '@/lib/analytics';
import { useFoliage } from '@/lib/foliage';
import { fromShare } from '@/lib/my-gak';
import { useRegion } from '@/lib/region';
import { useSheet } from '@/lib/sheet';
@@ -73,6 +75,7 @@ export default function TodayScreen() {
const talkFrom = Math.floor(posts.length / TALK_EVERY);
const eventNo = new Map(posts.filter((p) => p.post_type === PostType.EVENT).map((p, n) => [p.post_id, n + 1]));
const seen = useSeen();
const { inSeason } = useFoliage();
const scroll = useRef<ScrollView>(null);
const myGakY = useRef(0);
const { open } = useSheet();
@@ -104,7 +107,7 @@ export default function TodayScreen() {
onScroll={(e) => seen.onScroll(e.nativeEvent.contentOffset.y, e.nativeEvent.layoutMeasurement.height)}
>
<Hero hero={f?.hero} post={f?.hero_post} today={today.data} ranked={stories} feedLoad={load} todayLoad={loadOf(today)} />
<TodayIcons foliage={false} onMyGak={() => scroll.current?.scrollTo({ y: myGakY.current, animated: true })} />
<TodayIcons foliage={inSeason} onMyGak={() => scroll.current?.scrollTo({ y: myGakY.current, animated: true })} />
<ShortsRail />
<Composer />
{/* 아이콘 줄 '내 각'이 여기로 내려온다 */}
@@ -139,6 +142,8 @@ export default function TodayScreen() {
boxClassName="inset-x-3 top-3.5"
/>
)}
{/* 단풍철엔 단풍 지도를 포스트 맨 앞에 */}
{load !== 'loading' && posts.length > 0 && <FoliageCard post={f?.foliage_post} />}
{posts.map((p, i) => {
const t = talkAt(i);
const ev = eventNo.get(p.post_id);