[Next.js][ํ”„๋กœ์ ํŠธ] ๐Ÿ’šColor Inside (3) - ๊ณต์œ  ๊ธฐ๋Šฅ ๊ตฌํ˜„

์šฐ์—ฅยท2024๋…„ 7์›” 24์ผ

์นด์นด์˜คํ†ก ๊ณต์œ  ๊ธฐ๋Šฅ ๊ตฌํ˜„

  const shareOnKakao = (): void => {
    if (window.Kakao) {
      window.Kakao.Link.sendDefault({
        objectType: 'feed',
        content: {
          title: 'Color Inside ์˜ค๋Š˜ ๋‹น์‹ ์˜ ๊ฐ์ •์˜ ์ƒ‰์€?',
          description: `#์˜ค๋Š˜_๋‚˜๋Š”_${emotion}`,
          imageUrl: 'IMAGE_URL',
          link: {
            mobileWebUrl: window.location.href,
            webUrl: window.location.href
          }
        },
        buttons: [
          {
            title: '๊ฐ์ • ํ…Œ์ŠคํŠธํ•˜๋Ÿฌ ๊ฐ€๊ธฐ',
            link: {
              mobileWebUrl: window.location.href,
              webUrl: window.location.href
            }
          }
        ]
      });
    }
  };

ย 

๋งํฌ ๊ณต์œ  ๊ตฌํ˜„

 const shareOnLink = async (): Promise<void> => {
    const url = window.location.href;
    await navigator.clipboard.writeText(url);
    alert('๋งํฌ๊ฐ€ ๋ณต์‚ฌ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.');
  };
profile
๐ŸŒธ๐Ÿ˜Š๐ŸŒธ

0๊ฐœ์˜ ๋Œ“๊ธ€