feat: 공유는 날씨각 링크만 보내기 (텍스트·이미지 없이)
- 공유 버튼을 누르면 바로 휴대폰 공유창에 주소만 넘김. 공유창이 없으면 주소 복사 후 화면 아래 알림 - 공유 이미지 만들던 창·storyImage.ts 삭제 (메신저는 링크에 미리보기 그림을 붙임)
This commit is contained in:
1 parent
622f569f68
commit
c67121351b
7 files changed
+58
-351
No files matched your search
+20
-3
@@ -1,4 +1,5 @@
|
||||
import { useState, type CSSProperties, type ReactNode } from 'react'
|
||||
import { useEffect, useState, type CSSProperties, type ReactNode } from 'react'
|
||||
import { createPortal } from 'react-dom'
|
||||
import { Link } from 'react-router'
|
||||
import { cx } from '../lib/utils'
|
||||
import { useCarousel, type Carousel } from './carousel'
|
||||
@@ -73,12 +74,12 @@ export function Arrows({ api, prev, next, className }: { api: Carousel; prev: bo
|
||||
return (
|
||||
<>
|
||||
{prev && (
|
||||
<button type="button" data-noshot onClick={() => api?.scrollPrev()} aria-label="이전" className={cx(btn, 'left-1.5', className)}>
|
||||
<button type="button" onClick={() => api?.scrollPrev()} aria-label="이전" className={cx(btn, 'left-1.5', className)}>
|
||||
‹
|
||||
</button>
|
||||
)}
|
||||
{next && (
|
||||
<button type="button" data-noshot onClick={() => api?.scrollNext()} aria-label="다음" className={cx(btn, 'right-1.5', className)}>
|
||||
<button type="button" onClick={() => api?.scrollNext()} aria-label="다음" className={cx(btn, 'right-1.5', className)}>
|
||||
›
|
||||
</button>
|
||||
)}
|
||||
@@ -202,6 +203,22 @@ export function MapLink({ place, children, className }: { place: string; childre
|
||||
)
|
||||
}
|
||||
|
||||
/** 화면 아래에 잠깐 뜨는 알림. 2.5초 뒤 setText('') 로 지운다 (useState 의 setter 를 그대로 넘긴다) */
|
||||
export function ScreenNote({ text, setText }: { text: string; setText: (t: string) => void }) {
|
||||
useEffect(() => {
|
||||
if (!text) return
|
||||
const t = setTimeout(() => setText(''), 2500)
|
||||
return () => clearTimeout(t)
|
||||
}, [text, setText])
|
||||
if (!text) return null
|
||||
return createPortal(
|
||||
<p role="status" className="pointer-events-none fixed inset-x-0 bottom-[calc(88px+env(safe-area-inset-bottom,0px))] z-50 m-0 flex justify-center px-4">
|
||||
<span className="rounded-full bg-[rgb(30_36_56/0.82)] px-3.5 py-2 text-[13px] font-bold text-white">{text}</span>
|
||||
</p>,
|
||||
document.body,
|
||||
)
|
||||
}
|
||||
|
||||
export function Rows({ rows, dark = false }: { rows: { label: string; value: string; place?: string | null }[]; dark?: boolean }) {
|
||||
return (
|
||||
<div className="mt-auto flex flex-col">
|
||||
|
||||
Reference in new issue
Block a user