File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
components/modal/modalComponents Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1+ import { useEffect } from "react" ;
12import { handleCopyUrl } from "@/util/copyUrl" ;
23import { handleShareFacebook , handleShareKakao } from "@/util/shareSNS" ;
34import ModalShareItem from "./ModalShareItem" ;
4- import { useEffect } from "react" ;
55
66const ModalShare = ( ) => {
77 useEffect ( ( ) => {
Original file line number Diff line number Diff line change @@ -6,16 +6,26 @@ export const handleShareFacebook = () => {
66
77export const handleShareKakao = ( ) => {
88 const { Kakao, location } = window ;
9- if ( window . Kakao . isInitialized ( ) ) {
9+
10+ // 현재 URL에서 folderId를 추출
11+ const url = new URL ( location . href ) ;
12+ const folderId = url . searchParams . get ( "folder" ) ;
13+
14+ // 새로운 URL로 설정
15+ if ( folderId ) {
16+ location . href = `https://linkbrary-9-99.vercel.app/share/${ folderId } ` ;
17+ }
18+
19+ if ( Kakao . isInitialized ( ) ) {
1020 Kakao . Share . sendDefault ( {
1121 objectType : "feed" ,
1222 content : {
1323 title : "나만의 링크 모음" ,
1424 description : "나에게 필요한 링크만 모아 두었어요!" ,
15- imageUrl : "https://linkbrary-9-99.vercel.app/images/home_main.png" , //배포 후 실제 도메인으로 변경 필요
25+ imageUrl : "https://linkbrary-9-99.vercel.app/images/home_main.png" , // 배포 후 실제 도메인으로 변경 필요
1626 link : {
17- mobileWebUrl : location . href . replace ( "link?" , "share?" ) ,
18- webUrl : location . href . replace ( "link?" , "share?" ) ,
27+ mobileWebUrl : location . href ,
28+ webUrl : location . href ,
1929 } ,
2030 } ,
2131 } ) ;
You can’t perform that action at this time.
0 commit comments