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

- 공유 버튼을 누르면 바로 휴대폰 공유창에 주소만 넘김. 공유창이 없으면 주소 복사 후 화면 아래 알림
- 공유 이미지 만들던 창·storyImage.ts 삭제 (메신저는 링크에 미리보기 그림을 붙임)
This commit is contained in:
minaChoi committed 2026-10-07 16:47:27 +09:00
1 parent 622f569f68
commit c67121351b
7 files changed
+58 -351

No files matched your search

+7 -10
View File
@@ -1,11 +1,11 @@
import { useRef, useState, type ReactNode } from 'react'
import { 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 { useSheet } from './sheetContext'
import { Arrows, Chips, Ic, MapLink, Rail, Sec, Skel, SkelRail, StateBox, Thumb } from './ui'
import { shareLink } from './shareLink'
import { Arrows, Chips, Ic, MapLink, Rail, ScreenNote, Sec, Skel, SkelRail, StateBox, Thumb } from './ui'
import { useCarousel } from './carousel'
const TEN = Array.from({ length: 10 }, (_, i) => i)
@@ -138,7 +138,6 @@ 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)
@@ -165,14 +164,12 @@ export function WeekPage() {
// 날씨(고른 날)가 와야 명소를 부를 수 있다
const placeLoad = sel ? loadOf(places) : weekLoad === 'loading' ? 'loading' : 'ready'
const pickRef = useRef<HTMLDivElement>(null)
const sendPlan = () => {
if (!sel || !pickRef.current) return
open({ type: 'share', share: { title: `${sel.weekday}요일 일정`, slides: [pickRef.current] } })
}
const [note, setNote] = useState('')
const sendPlan = () => void shareLink().then((m) => m && setNote(m))
return (
<section aria-label="주말·행사" aria-busy={weekLoad === 'loading'}>
<ScreenNote text={note} setText={setNote} />
<Sec title="열흘 날씨" sub="날짜를 누르면 그날 추천이 바뀌어요" />
{days.length ? (
<DayStrip dim={week.isPlaceholderData}>
@@ -215,7 +212,7 @@ export function WeekPage() {
/>
)}
{sel && (
<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">
<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">
<Ic name={sel.icon} className="w-16" />
<div>
<b className="block font-jua text-[19px] font-normal">{sel.headline}</b>