diff --git a/package.json b/package.json index 6d8adc1..55d9a68 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "axios": "^1.4.0", "copy-text-to-clipboard": "^3.2.0", "html2canvas": "^1.4.1", + "ismobilejs": "^1.1.1", "postcss-syntax": "^0.36.2", "prettier": "1.13", "react": "^18.2.0", diff --git a/src/pages/cueCard/CueCard.tsx b/src/pages/cueCard/CueCard.tsx index 2596c61..621b067 100644 --- a/src/pages/cueCard/CueCard.tsx +++ b/src/pages/cueCard/CueCard.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from 'react'; +import { useRef, useState } from 'react'; import Button from 'components/common/atomComponents/Button'; import Text from 'components/common/atomComponents/Text'; @@ -8,6 +8,7 @@ import html2canvas from 'html2canvas'; import CueCardTitle from 'pages/cueCard/components/CueCardTitle'; import useShareLink from 'src/\bhooks/useShareLink'; import styled from 'styled-components'; +import { checkBrowserForWebShare } from 'utils/checkBrowserForWebShare'; import { downLoadNotify } from 'utils/toast/copyLinkToast'; import Qcard from './components/Qcard'; @@ -26,21 +27,6 @@ function CueCard() { }); } }; - useEffect(() => { - const handleBtnText = async () => { - try { - const canShare = await navigator.share(); - if (canShare !== undefined) { - throw Error; - } - setBtnText('링크 공유하기'); - } catch { - setBtnText('링크 복사하기'); - } - }; - - handleBtnText(); - }, []); return ( @@ -49,7 +35,9 @@ function CueCard() {