Skip to content

Commit

Permalink
feat: feat bodyBudy#122 Add image of trainer images field to index page
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmihs committed Aug 21, 2022
1 parent 0dab2ca commit 75f4cc2
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion components/layout/index/TrainerItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,23 @@ const Trainer = ({ trainer }: { trainer: TrainerProps }) => {
<Link href={`/trainer/${trainer.id}`}>
<div>
<ImageWrapper>
<Image src={mypage} alt={trainer.name} title={trainer.name} width={112} height={112} />
{trainer.images[0] ? (
<Image
src={trainer.images[0]}
alt={trainer.name}
title={trainer.name}
width={112}
height={112}
/>
) : (
<Image
src={mypage}
alt={trainer.name}
title={trainer.name}
width={112}
height={112}
/>
)}
</ImageWrapper>
<TrainerItemTop>
<span>5.0</span>
Expand Down

0 comments on commit 75f4cc2

Please sign in to comment.