setIsSelected(!isSelected)}
+ className={`relative ${sizeClass} p-[2px] flex items-center justify-center rounded-full
+ ${isDisabled ? 'opacity-50 cursor-not-allowed' : isSelectable ? 'cursor-pointer' : 'cursor-default'} transition-all`} // 비활성화된 경우 투명도 50%
+ onClick={
+ !isDisabled && isSelectable ? () => onClick(idol.id) : undefined
+ } // 비활성화된 경우 클릭 방지
>
-
+ {children}
+
-
+
- {isSelected && (
-
+ {/* 비활성화된 경우 클릭 차단 & 마우스 금지 커서 적용 */}
+ {isDisabled && (
+
)}
- {isSelected && (
-

+ {isSelected && isSelectable && (
+ <>
+
+

+ >
)}
+
+
+
{idol.name}
+
{idol.group || '그룹 없음'}
+
);
};
diff --git a/src/components/IdolImage.jsx b/src/components/IdolImage.jsx
deleted file mode 100644
index d2c99bb..0000000
--- a/src/components/IdolImage.jsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import React, { useState, useEffect } from "react";
-
-const ImageWithBorder = ({ borderColor = "#f96868", size = "128px" }) => {
- const [imageSrc, setImageSrc] = useState("");
-
- useEffect(() => {
-
- setImageSrc("https://via.placeholder.com/150");
- }, []);
-
- if (!imageSrc) {
- return
Loading...
;
- }
-
- return (
-
-
-
-

-
-
- );
-};
-
-export default ImageWithBorder;
diff --git a/src/pages/myPage/CheckedIdolCard.jsx b/src/pages/myPage/CheckedIdolCard.jsx
deleted file mode 100644
index 01b8c3d..0000000
--- a/src/pages/myPage/CheckedIdolCard.jsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import React from 'react';
-import checkIcon from '@/assets/images/check.png';
-
-const CheckedIdolCard = ({
- children,
- idol,
- isSelectable = true,
- isSelected = false,
- isDisabled = false,
- sizeClass = 'w-[98px] h-[98px] tablet:w-[128px] tablet:h-[128px]',
- onClick,
-}) => {
- const defaultImage = 'https://link24.kr/9iFIhh0';
-
- return (
-
-
onClick(idol.id) : undefined} // 비활성화된 경우 클릭 방지
- >
- {children}
-
-
-
-

-
-
- {/* 비활성화된 경우 클릭 차단 & 마우스 금지 커서 적용 */}
- {isDisabled && (
-
- )}
-
- {isSelected && isSelectable && (
- <>
-
-

- >
- )}
-
-
-
-
{idol.name}
-
{idol.group || '그룹 없음'}
-
-
- );
-};
-
-export default CheckedIdolCard;
diff --git a/src/pages/myPage/MyPage.jsx b/src/pages/myPage/MyPage.jsx
index 501fb2b..ce8bc8f 100644
--- a/src/pages/myPage/MyPage.jsx
+++ b/src/pages/myPage/MyPage.jsx
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import Header from '@/components/Header';
-import CheckedIdolCard from '@/pages/myPage/CheckedIdolCard';
+import IdolCard from '@/components/IdolCard';
import nextIcon from '@/assets/icons/nextIcon.svg';
import prevIcon from '@/assets/icons/prevIcon.svg';
import { fetchIdols } from '@/apis/myPageApi.js';
@@ -100,7 +100,7 @@ const MyPage = () => {
return (
-
{
className="absolute -top-0 -right-[0] w-7 h-7 z-50 flex items-center justify-center
bg-transparent transition-opacity cursor-pointer"
>
-
+
-
+
);
})}