diff --git a/src/assets/default/share.svg b/src/assets/default/share.svg new file mode 100644 index 00000000..68778689 --- /dev/null +++ b/src/assets/default/share.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/src/pages/Home/OOTD/Feed/index.tsx b/src/pages/Home/OOTD/Feed/index.tsx index 842e6580..663e420a 100644 --- a/src/pages/Home/OOTD/Feed/index.tsx +++ b/src/pages/Home/OOTD/Feed/index.tsx @@ -19,6 +19,7 @@ import { getCurrentUserId } from '@utils/getCurrentUserId'; import defaultProfile from '@assets/default/defaultProfile.svg'; import more from '@assets/default/more.svg'; import xBtn from '@assets/default/reject.svg'; +import share from '@assets/default/share.svg'; import Heart from '@components/Icons/Heart'; import Message from '@components/Icons/Message'; @@ -209,6 +210,24 @@ const Feed: React.FC = ({ feed }) => { }, }; + // 친구한테 프로필 공유하기 + const handleShareButtonClick = (e: React.MouseEvent) => { + e.stopPropagation(); + // 사용자 ID로 프로필 URL 생성 + const profileUrl = `${window.location.origin}/profile/${feed.user.id}`; + + navigator.clipboard + .writeText(profileUrl) + .then(() => { + setModalContent(`${feed.user.nickname}님의 프로필이 복사되었습니다!`); + setIsStatusModalOpen(true); // 복사 성공 후 모달 열기 + }) + .catch(() => { + setModalContent('프로필 복사에 실패했습니다. 다시 시도해 주세요.'); + setIsStatusModalOpen(true); // 복사 실패 시 모달 열기 + }); + }; + return ( @@ -251,7 +270,11 @@ const Feed: React.FC = ({ feed }) => {
+
+ 공유 +
+