Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/modal/modalComponents/ModalShare.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect } from "react";
import { handleCopyUrl } from "@/util/copyUrl";
import { handleShareFacebook, handleShareKakao } from "@/util/shareSNS";
import ModalShareItem from "./ModalShareItem";
import { useEffect } from "react";

const ModalShare = () => {
useEffect(() => {
Expand Down
18 changes: 14 additions & 4 deletions util/shareSNS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,26 @@ export const handleShareFacebook = () => {

export const handleShareKakao = () => {
const { Kakao, location } = window;
if (window.Kakao.isInitialized()) {

// 현재 URL에서 folderId를 추출
const url = new URL(location.href);
const folderId = url.searchParams.get("folder");

// 새로운 URL로 설정
if (folderId) {
location.href = `https://linkbrary-9-99.vercel.app/share/${folderId}`;
}

if (Kakao.isInitialized()) {
Kakao.Share.sendDefault({
objectType: "feed",
content: {
title: "나만의 링크 모음",
description: "나에게 필요한 링크만 모아 두었어요!",
imageUrl: "https://linkbrary-9-99.vercel.app/images/home_main.png", //배포 후 실제 도메인으로 변경 필요
imageUrl: "https://linkbrary-9-99.vercel.app/images/home_main.png", // 배포 후 실제 도메인으로 변경 필요
link: {
mobileWebUrl: location.href.replace("link?", "share?"),
webUrl: location.href.replace("link?", "share?"),
mobileWebUrl: location.href,
webUrl: location.href,
},
},
});
Expand Down
Loading