Skip to content

Commit e1b4f1f

Browse files
committed
✨ Feat: 초대 코드 클립보드에 복사하고 공유하기 기능 추가
1 parent a188c29 commit e1b4f1f

File tree

1 file changed

+2
-6
lines changed
  • src/modals/FamilyDDangModal/ShareCodeModal

1 file changed

+2
-6
lines changed

src/modals/FamilyDDangModal/ShareCodeModal/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,15 @@ export default function ShareCodeModal() {
1111
const { data, refetch } = useInviteCode()
1212

1313
const handleShare = async () => {
14+
navigator.clipboard.writeText(data.inviteCode)
1415
if (navigator.share) {
1516
try {
1617
await navigator.share({
17-
title: '패밀리코드',
18-
text: '텍스트',
19-
url: data.inviteCode,
18+
text: data.inviteCode,
2019
})
2120
} catch (err) {
2221
console.error('Error sharing:', err)
2322
}
24-
} else {
25-
navigator.clipboard.writeText(window.location.href)
26-
alert('Link copied to clipboard!')
2723
}
2824
}
2925

0 commit comments

Comments
 (0)