) => {
- if ((e.target as HTMLElement).closest('button')) return
+ if (!SOCIAL || (e.target as HTMLElement).closest('button')) return
const now = Date.now()
if (now - lastTap.current < 320) {
if (liked && loggedIn) setPop((p) => p + 1)
@@ -423,24 +424,30 @@ function FullCard({ post }: PostProps) {
)}
-
-
+ {SOCIAL && (
+ <>
+
+
+ >
+ )}
- 좋아요 {likeCount.toLocaleString()}개
+ {SOCIAL && 좋아요 {likeCount.toLocaleString()}개
}
날씨각
{post.caption}
-
+ {SOCIAL && (
+
+ )}
오늘
)
diff --git a/frontend/src/b/Sheets.tsx b/frontend/src/b/Sheets.tsx
index 0ae9759..673720b 100644
--- a/frontend/src/b/Sheets.tsx
+++ b/frontend/src/b/Sheets.tsx
@@ -21,6 +21,7 @@ import {
} from '../api/client/@tanstack/react-query.gen'
import type { CommentData, Factor, ResAuth, ResCommentList, ResIndexDetail } from '../api/client/types.gen'
import { track } from '../lib/analytics'
+import { IS_TOSS, SOCIAL, tossShare } from '../lib/platform'
import { cx } from '../lib/utils'
import { useAuth } from './authContext'
import { ago, ARTICLE_CAT, articleMeta, AVATAR_COLORS, cardBg, CHARACTERS, dateRange, loadOf, MOODS, shortDay } from './lib'
@@ -530,6 +531,19 @@ function ShareSheet({ share }: { share: SharePayload }) {
const send = () => {
if (!image) return
const file = new File([image.blob], `nalssigak-${SHARE_SIZES[size].ratio.replace(':', 'x')}.png`, { type: 'image/png' })
+ if (IS_TOSS) {
+ tossShare(image.blob, file.name, share.title).then(
+ (r) => {
+ setToast(r === 'saved' ? '이미지를 저장하고 링크를 보냈어요' : '링크를 보냈어요')
+ track('share', { content_type: 'image', item_id: share.title, method: 'share_sheet', ratio: SHARE_SIZES[size].ratio })
+ },
+ (e: unknown) => {
+ console.error('[share] toss', e)
+ setToast('보내지 못했어요. 한 번 더 눌러 주세요')
+ },
+ )
+ return
+ }
if (navigator.canShare?.({ files: [file], text })) {
navigator.share({ files: [file], title: share.title, text }).then(
() => {
@@ -1014,12 +1028,14 @@ function RegionSheet({ onDone }: { onDone: () => void }) {
))}
-
- {me ? `${me.nickname}(으)로 로그인했어요` : '로그인하면 좋아요·댓글을 쓸 수 있어요'}
-
-
+ {SOCIAL && (
+
+ {me ? `${me.nickname}(으)로 로그인했어요` : '로그인하면 좋아요·댓글을 쓸 수 있어요'}
+
+
+ )}