fix: 단풍 지도 카드에 좋아요·댓글이 다시 보이게 — 10/27 카드 위치를 옮기며 빠진 foliage_post 연결 복구
This commit is contained in:
1 parent
751beb6e33
commit
4f36451da0
2 files changed
+4
-3
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useLayoutEffect, useMemo, useRef, useState, type MouseEvent } from 'react'
|
||||
import { useNavigate } from 'react-router'
|
||||
import type { PostReaction } from '@nalssigak/shared/api/client/types.gen'
|
||||
import { cx } from '../lib/utils'
|
||||
import { useCarousel } from './carousel'
|
||||
import { headline, ICON_R, LABEL, LABEL_INK, LEAF_SHADOW, MAP_IMG, MAP_SRC, md, placeLabels, PROVINCE, PROVINCES, labelBoxes, placeProvinces, rankNow, spread, useFoliage, useLabelSize } from './foliage'
|
||||
@@ -14,7 +15,7 @@ const TAP_R = 24
|
||||
const RANK_N = 7
|
||||
|
||||
/** 피드의 단풍 지도 카드: 1장은 지금 절정인 곳만 잎 아이콘으로(누르면 카드 안에 정보), 2장은 지금 가기 좋은 순위. '지도 크게 보기'로 단풍 지도 페이지 */
|
||||
export function FoliageCard() {
|
||||
export function FoliageCard({ post }: { post?: PostReaction | null }) {
|
||||
const navigate = useNavigate()
|
||||
const { today, spots, inSeason } = useFoliage()
|
||||
const peak = useMemo(() => spots.filter((m) => m.stage === 'peak').sort((a, b) => Number(a.kind === 'ginkgo') - Number(b.kind === 'ginkgo') || a.y - b.y), [spots])
|
||||
@@ -60,7 +61,7 @@ export function FoliageCard() {
|
||||
// 2번째 장: 지금 절정인 곳을 절정 예상일이 오늘과 가까운 순서로
|
||||
const ranked = rankNow(spots).slice(0, RANK_N)
|
||||
return (
|
||||
<PostFrame title="단풍 지도" account="단풍 지도" avatar="maple" caption={peak.length ? `지금 절정 ${peak.length}곳: ${peak.slice(0, 5).map((m) => m.name).join(' · ')}${peak.length > 5 ? ' 외' : ''}` : undefined}>
|
||||
<PostFrame title="단풍 지도" account="단풍 지도" avatar="maple" pinned={{ key: 'foliage_post', post }} caption={peak.length ? `지금 절정 ${peak.length}곳: ${peak.slice(0, 5).map((m) => m.name).join(' · ')}${peak.length > 5 ? ' 외' : ''}` : undefined}>
|
||||
<div className="b-keep-bg relative bg-[#fff6ea] px-4 pt-4 pb-3 text-[#28304a]">
|
||||
<p className="m-0 text-[13px] font-extrabold opacity-75">단풍 지도 · {md(today)}</p>
|
||||
<p className="m-0 mt-1 font-jua text-[24px] leading-tight">{headline(spots)}</p>
|
||||
|
||||
Reference in new issue
Block a user