Skip to content

Commit

Permalink
Merge pull request #170 from depromeet/fix/#169
Browse files Browse the repository at this point in the history
핀 버블 분기처리
  • Loading branch information
sjoleee authored Jan 29, 2024
2 parents 824ba39 + fbe2efc commit fd6deb6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/common/Pin/PinBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ import { motion } from 'framer-motion';
import PinVisitorIcon from '/public/assets/icon20/pin_visitor_20.svg';
import ArrowIcon from '/public/assets/icon30/polygon_30.svg';

import { useSearchParams } from 'next/navigation';

import { bounceAnimationVariants } from '@constants/motions';

interface PinBubbleProps {
totalRevisitedCount: number;
}

export default function PinBubble({ totalRevisitedCount }: PinBubbleProps) {
const searchParams = useSearchParams();
const storeId = searchParams.get('storeId');

return (
<motion.div
variants={bounceAnimationVariants}
Expand All @@ -21,9 +26,11 @@ export default function PinBubble({ totalRevisitedCount }: PinBubbleProps) {
className="absolute top-[-60px] flex flex-col justify-center items-center z-floating"
>
<div className="h-[36px] flex justify-center items-center bg-primary-500 px-[12px] py-[8px] rounded-[16px] mb-[-8px]">
<PinVisitorIcon />
{storeId && <PinVisitorIcon />}
<p className="body-14-extraBold text-white">
{totalRevisitedCount}명이 재방문했어요!
{storeId
? `${totalRevisitedCount}명이 재방문했어요!`
: '첫 방문 기록을 남겨주세요!'}
</p>
</div>
<ArrowIcon />
Expand Down

0 comments on commit fd6deb6

Please sign in to comment.