From 9154fafbe4bb665e845f5195fb1c2312e6fd169c Mon Sep 17 00:00:00 2001 From: bottlewook Date: Mon, 19 Feb 2024 00:56:54 +0900 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20useKakaoShare=20=EC=BB=A4=EC=8A=A4?= =?UTF-8?q?=ED=85=80=ED=9B=85=20=EC=A0=9C=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shared/header/headerItems/RightIcon.tsx | 4 ++-- .../kakao-share-button/KakaoShareButton.tsx | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/components/shared/kakao-share-button/KakaoShareButton.tsx diff --git a/src/components/shared/header/headerItems/RightIcon.tsx b/src/components/shared/header/headerItems/RightIcon.tsx index 6297cf68..e2127058 100644 --- a/src/components/shared/header/headerItems/RightIcon.tsx +++ b/src/components/shared/header/headerItems/RightIcon.tsx @@ -8,7 +8,7 @@ import FilledHeart from '@components/icons/FilledHeart'; import Filter from '@components/icons/Filter'; import Heart from '@components/icons/Heart'; import Search from '@components/icons/Search'; -import Share from '@components/icons/Share'; +import KakaoShareButton from '@shared/kakao-share-button/KakaoShareButton'; import { RightIconProps } from '../types/headerType'; @@ -50,7 +50,7 @@ function RightIcon({ : }
  • - +
  • ); diff --git a/src/components/shared/kakao-share-button/KakaoShareButton.tsx b/src/components/shared/kakao-share-button/KakaoShareButton.tsx new file mode 100644 index 00000000..2726d759 --- /dev/null +++ b/src/components/shared/kakao-share-button/KakaoShareButton.tsx @@ -0,0 +1,24 @@ +/* eslint-disable jsx-a11y/control-has-associated-label */ + +import Script from 'next/script'; + +import Share from '@/components/icons/Share'; +import useKakaoShare from '@hooks/useKakaoShare'; + +function KakaoShareButton() { + const containerId = useKakaoShare('#kakao-link-btn', process.env.NEXT_PUBLIC_KAKAO_APP_JS_KEY!); + + return ( + <> + +