|
@@ -11,20 +11,19 @@ const cx = classNames.bind(styles);
|
|
|
|
|
|
export interface ISalesRankingCardProps extends ISaleRanking {
|
|
|
className: string;
|
|
|
- index: number;
|
|
|
}
|
|
|
|
|
|
export default function SalesRankingCard({
|
|
|
- index,
|
|
|
name,
|
|
|
thumbnail_image,
|
|
|
className,
|
|
|
amounts_sale,
|
|
|
+ rank = 0
|
|
|
}: ISalesRankingCardProps) {
|
|
|
const renderColor = () => {
|
|
|
- if (index + 1 === 1) return "#ffd700";
|
|
|
- if (index + 1 === 2) return "#c0c0c0";
|
|
|
- if (index + 1 === 3) return "#cd7f32";
|
|
|
+ if (rank === 1) return "#ffd700";
|
|
|
+ if (rank === 2) return "#c0c0c0";
|
|
|
+ if (rank === 3) return "#cd7f32";
|
|
|
return "#3d3d3d";
|
|
|
};
|
|
|
return (
|
|
@@ -35,7 +34,7 @@ export default function SalesRankingCard({
|
|
|
background: renderColor(),
|
|
|
}}
|
|
|
>
|
|
|
- <span>{index + 1}</span>
|
|
|
+ <span>{rank}</span>
|
|
|
</div>{" "}
|
|
|
<Link to={URLInfo.getProfileUserUrl(name || "")}>
|
|
|
<div className={cx("card_wrap")}>
|