feat: 앱 내 각 — 오늘 피드 내 각 줄, 만들기 창(있는 각 불러오기·아이콘·조건·시간대·미리보기 점수), 상세 창(시간대·조건별 점수, 링크 공유·지우기), 로그인 전 기기에 하나 저장 후 로그인하면 계정으로, ?my= 받은 각 열기 (GA my_gak_save)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
skkimandClaude committed 2026-11-04 17:38:40 +09:00
1 parent f6884fe9c9
commit 5a88b08a44
6 files changed
+546 -4

No files matched your search

+16 -1
View File
@@ -3,9 +3,11 @@ import { PostType } from '@nalssigak/shared/api/client/types.gen';
import { kst, loadOf } from '@nalssigak/shared/lib';
import { atSlot, PREVIEW } from '@nalssigak/shared/lib/today';
import { useQuery } from '@tanstack/react-query';
import { Fragment, useRef, type ReactNode } from 'react';
import { router, useLocalSearchParams } from 'expo-router';
import { Fragment, useEffect, useRef, type ReactNode } from 'react';
import { RefreshControl, ScrollView, View, type LayoutRectangle } from 'react-native';
import { MyGakRow } from '@/components/my-gak/my-gak';
import { isAppPost, PostCard, PostCardSkel } from '@/components/post/post-card';
import { Composer, TalkPost } from '@/components/talk/talk';
import { GakCard } from '@/components/today/gak-card';
@@ -13,7 +15,9 @@ import { Hero } from '@/components/today/hero';
import { SeasonBand } from '@/components/today/rails';
import { StateBox } from '@/components/ui';
import { track } from '@/lib/analytics';
import { fromShare } from '@/lib/my-gak';
import { useRegion } from '@/lib/region';
import { useSheet } from '@/lib/sheet';
import { useSky } from '@/lib/sky';
import { useTopicTalks } from '@/lib/talk';
@@ -67,6 +71,16 @@ 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 { open } = useSheet();
const { my } = useLocalSearchParams<{ my?: string }>();
// 친구가 보낸 내 각 링크(?my=...)로 들어오면 내 동네 기준으로 보여 준다
useEffect(() => {
if (!my) return;
router.setParams({ my: undefined });
const g = fromShare(my);
if (g) open({ type: 'mix', shared: g });
}, [my, open]);
const refresh = () => Promise.all([feed.refetch(), today.refetch(), talkList.refetch()]);
// 웹처럼 9번째 글 뒤에 계절 이야기 띠를 넣고, 글이 모자라면 맨 뒤에 붙인다
@@ -86,6 +100,7 @@ export default function TodayScreen() {
>
<Hero hero={f?.hero} post={f?.hero_post} today={today.data} ranked={stories} feedLoad={load} todayLoad={loadOf(today)} />
<Composer />
<MyGakRow />
{/* 실패 안내는 여기 한 번만, 각 카드 스켈레톤과 같은 크기로 */}
{stories.some((g) => g.active) ? (
<GakCard items={stories} post={f?.gak_post} place={region.name.split(' ').at(-1)!} at={sloted ? `${PREVIEW[preview].label} 기준` : nowAt ? `${kst(nowAt).h}시 기준` : '오늘 기준'} />