Revert "feat: 공유는 날씨각 링크만 보내기 (텍스트·이미지 없이)"

This reverts commit c67121351b.
This commit is contained in:
minaChoi committed 2026-10-07 17:30:43 +09:00
1 parent 2ce1fa2aed
commit 4ebf1cd894
7 files changed
+351 -58

No files matched your search

+10 -7
View File
@@ -1,11 +1,11 @@
import { useState, type ReactNode } from 'react'
import { useRef, useState, type ReactNode } from 'react'
import { useQuery } from '@tanstack/react-query'
import { getWeekOptions, getWeekRankingOptions, listEventsOptions, listPlacesOptions } from '../api/client/@tanstack/react-query.gen'
import { cx } from '../lib/utils'
import { cardBg, dateRange, loadOf, shortDay, sidoOf } from './lib'
import { useRegion } from './regionContext'
import { shareLink } from './shareLink'
import { Arrows, Chips, Ic, MapLink, Rail, ScreenNote, Sec, Skel, SkelRail, StateBox, Thumb } from './ui'
import { useSheet } from './sheetContext'
import { Arrows, Chips, Ic, MapLink, Rail, Sec, Skel, SkelRail, StateBox, Thumb } from './ui'
import { useCarousel } from './carousel'
const TEN = Array.from({ length: 10 }, (_, i) => i)
@@ -138,6 +138,7 @@ const PLACE_BG: Record<string, string> = { picnic: 'mint', walk: 'mint', sunset:
export function WeekPage() {
const { region } = useRegion()
const { open } = useSheet()
const week = useQuery(getWeekOptions({ query: { region: region.code } }))
const days = week.data?.days ?? []
const [picked, setPicked] = useState<string | null>(null)
@@ -164,12 +165,14 @@ export function WeekPage() {
// 날씨(고른 날)가 와야 명소를 부를 수 있다
const placeLoad = sel ? loadOf(places) : weekLoad === 'loading' ? 'loading' : 'ready'
const [note, setNote] = useState('')
const sendPlan = () => void shareLink().then((m) => m && setNote(m))
const pickRef = useRef<HTMLDivElement>(null)
const sendPlan = () => {
if (!sel || !pickRef.current) return
open({ type: 'share', share: { title: `${sel.weekday}요일 일정`, slides: [pickRef.current] } })
}
return (
<section aria-label="주말·행사" aria-busy={weekLoad === 'loading'}>
<ScreenNote text={note} setText={setNote} />
<Sec title="열흘 날씨" sub="날짜를 누르면 그날 추천이 바뀌어요" />
{days.length ? (
<DayStrip dim={week.isPlaceholderData}>
@@ -212,7 +215,7 @@ export function WeekPage() {
/>
)}
{sel && (
<div className="mx-3 mt-3 flex items-center gap-3.5 rounded-3xl bg-[linear-gradient(180deg,#e9fbf2,#fff)] p-4 shadow-[inset_0_-5px_0_var(--shade)]" aria-live="polite">
<div ref={pickRef} className="mx-3 mt-3 flex items-center gap-3.5 rounded-3xl bg-[linear-gradient(180deg,#e9fbf2,#fff)] p-4 shadow-[inset_0_-5px_0_var(--shade)]" aria-live="polite">
<Ic name={sel.icon} className="w-16" />
<div>
<b className="block font-jua text-[19px] font-normal">{sel.headline}</b>