Skip to content

Commit

Permalink
Design: weeklyPopularList design
Browse files Browse the repository at this point in the history
  • Loading branch information
cuconveniencestore authored and hookor committed May 31, 2024
1 parent 9e910f8 commit d9ddc3a
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions src/components/home/WeeklyPopularItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,24 @@ const WeeklyPopularItem = ({
data,
idx
}: {
data: WeeklyPopularTypes;
data: WeeklyPopularTypes | null;
idx: number;
}) => {
const icon = data && `/png/${data?.brand}.png`;
const icon = `/png/${data?.brand}.png`;

return (
<Container className={Align}>
<span>{idx + 1}</span>
<BrandInfo className={Align}>
<BrandIcon
src={icon}
alt={data?.brand}
/>
<span>{convertBrandName(data?.brand)}</span>
</BrandInfo>
</Container>
data && (
<Container className={Align}>
<span>{idx + 1}</span>
<BrandInfo className={Align}>
<BrandIcon
src={data && icon}
alt={data?.brand}
/>
<span>{convertBrandName(data?.brand)}</span>
</BrandInfo>
</Container>
)
);
};

Expand All @@ -32,14 +34,15 @@ const Container = styled.div`
padding: 8px 20px;
background: #fff;
`;

const BrandInfo = styled.div`
margin-left: 20px;
`;

const BrandIcon = styled.img`
width: 38px;
height: 38px;
border-radius: 50%;
background-color: darkkhaki;
margin-right: 12px;
`;

Expand Down

0 comments on commit d9ddc3a

Please sign in to comment.