diff --git a/src/components/Trade/Board/index.tsx b/src/components/Trade/Board/index.tsx index 1f2762e..650b955 100644 --- a/src/components/Trade/Board/index.tsx +++ b/src/components/Trade/Board/index.tsx @@ -27,6 +27,18 @@ export default function TradeBoard({ const [hiddenTags, setHiddenTags] = useState([]); const ulRef = useRef(null); + let displayPrice = ''; + + if (price === 0) { + displayPrice = '무료'; + } else if (convertRentalTypeName(rentalType) === '월세') { + displayPrice = `보증금 ${priceCount(price)} / 월세 ${priceCount( + monthlyPrice, + )}`; + } else { + displayPrice = `${convertRentalTypeName(rentalType)} ${priceCount(price)}`; + } + const checkAndManageTags = () => { if (ulRef.current) { const containerWidth = ulRef.current.offsetWidth; @@ -104,11 +116,8 @@ export default function TradeBoard({

위치 : {city}

-

- 가격 :{' '} - {convertRentalTypeName(rentalType) === '월세' - ? `보증금 ${priceCount(price)} / 월세 ${priceCount(monthlyPrice)}` - : `${convertRentalTypeName(rentalType)} ${priceCount(price)}`} +

+ 가격 : {displayPrice}