Skip to content

Commit

Permalink
feat/#25/홈에서 카드 클릭 시 상세페이지로 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmj12 committed Dec 27, 2024
1 parent c088907 commit 52c24ad
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions src/components/ProjectCard/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as S from "./styles";
import Image from "next/image";
import empty_heart from "../../../public/icons/empty_heart.svg";
import fill_heart from "../../../public/icons/fill_heart.svg";
import Link from "next/link";

type ProjectCardProps = {
__typename: string;
Expand Down Expand Up @@ -33,32 +34,34 @@ const ProjectCard = forwardRef<HTMLDivElement, ProjectCardProps>(
};

return (
<S.Card ref={ref}>
<S.ImageWrapper>
<Image
src={imageUrls[0]}
alt={title}
layout="fill"
objectFit="cover"
/>
</S.ImageWrapper>
<S.Content>
<S.Title>{title}</S.Title>
<S.Description>{bio}</S.Description>
<S.Author>{id}</S.Author>
<S.LikeSection>
<S.LikeButton onClick={handleLike}>
<Image
src={true ? fill_heart : empty_heart}
alt="like button"
width={24}
height={24}
/>
</S.LikeButton>
<S.LikeCount>{100} likes</S.LikeCount>
</S.LikeSection>
</S.Content>
</S.Card>
<Link href={`/project/${id}`}>
<S.Card ref={ref}>
<S.ImageWrapper>
<Image
src={imageUrls[0]}
alt={title}
layout="fill"
objectFit="cover"
/>
</S.ImageWrapper>
<S.Content>
<S.Title>{title}</S.Title>
<S.Description>{bio}</S.Description>
<S.Author>{id}</S.Author>
<S.LikeSection>
<S.LikeButton onClick={handleLike}>
<Image
src={true ? fill_heart : empty_heart}
alt="like button"
width={24}
height={24}
/>
</S.LikeButton>
<S.LikeCount>{100} likes</S.LikeCount>
</S.LikeSection>
</S.Content>
</S.Card>
</Link>
);
},
);
Expand Down

0 comments on commit 52c24ad

Please sign in to comment.