diff --git a/pages/garden/index.tsx b/pages/garden/index.tsx index e503feb..0752e1b 100644 --- a/pages/garden/index.tsx +++ b/pages/garden/index.tsx @@ -1,4 +1,4 @@ -import { ReactNode, useEffect, useMemo, useState } from 'react' +import { ReactNode, useEffect, useMemo, useRef, useState } from 'react' import BaseLayout from '@/layout/base-layout' import withAuth from '@/layout/HOC/with-auth' import Button from '@/components/button' @@ -13,6 +13,7 @@ import { AnimatePresence } from 'framer-motion' import { motion } from 'framer-motion' import { fadeInProps } from '@/variants' import ShareModal from '@/components/share-modal' +import InfoIcon from '@/components/svgs/info-icon' const Pages = () => { const { data } = useSession() @@ -72,6 +73,17 @@ const Pages = () => { () => surveys?.pages[0].data.totalCount ?? 0, [surveys], ) + + const [showTooltip, setShowTooltip] = useState(false) + const tooltipRef = useRef(null) + + useEffect(() => { + function handleClickOutside() { + setShowTooltip(false) + } + document.addEventListener('mousedown', handleClickOutside) + }, [tooltipRef]) + return ( {
-
-

+

+

받은 친구

+ + {showTooltip && ( + + + + + +
+

+ 알게 된 기간, 경로에 따라
나무 모양과 색이 달라져요 +

+
+
+ )}