Skip to content

Commit d9ea590

Browse files
authored
Merge pull request #93 from codeit9-temporary/feature/Card-ui컴포넌트-구현
Fix: LinkCard tailwind 수정, timeAgo 유틸함수 로직변경
2 parents c1bd5cc + d50103b commit d9ea590

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

components/Link/LinkCard.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const LinkCard = ({ openEdit, openDelete, info }: LinkCardProps) => {
5858
alt="링크 미리보기"
5959
fill
6060
/>
61-
{/* isFavoritePage일 때만 즐겨찾기 버튼 렌더링 */}
61+
{/* 즐겨찾기 페이지가 아닐 때에는 즐겨찾기 버튼 렌더링x */}
6262
{!isFavoritePage && (
6363
<div
6464
onClick={() => setIsSubscribed(!isSubscribed)}
@@ -94,12 +94,10 @@ const LinkCard = ({ openEdit, openDelete, info }: LinkCardProps) => {
9494
</div>
9595
)}
9696
</div>
97-
<div className="text-[black100] text-lg ">
97+
<div className="text-black100 y-[42px] line-clamp-2">
9898
{info.description || "설명"}
9999
</div>
100-
<div className="text-sm text-[black200]">
101-
{formattedDate || "2024.11.06"}
102-
</div>
100+
<div className="text-sm">{formattedDate || "2024.11.06"}</div>
103101
</section>
104102
</div>
105103
);

util/timAgo.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ function timeAgo(createdAt: string): string {
77
);
88
const minutesDiff = Math.floor(secondsDiff / 60);
99
const hoursDiff = Math.floor(minutesDiff / 60);
10-
const daysDiff = Math.floor(hoursDiff / 24); //
10+
const daysDiff = Math.floor(hoursDiff / 24);
1111

12-
if (hoursDiff < 1) {
12+
if (minutesDiff < 1) {
1313
return `${secondsDiff}초 전`;
14-
} else if (hoursDiff < 24) {
14+
} else if (hoursDiff < 1) {
15+
return `${minutesDiff}분 전`;
16+
} else if (daysDiff < 1) {
1517
return `${hoursDiff}시간 전`;
1618
} else {
1719
return `${daysDiff}일 전`;

0 commit comments

Comments
 (0)