Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions src/features/billilge/components/BillilgeItemCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import type { ReactNode } from "react";

import circleMinusFill from "@/assets/icons/circle-minus-fill.svg";
import circlePlusFill from "@/assets/icons/circle-plus-fill.svg";
import BillilgeItemIcon from "@/features/billilge/components/BillilgeItemIcon";

interface BillilgeItemCardProps {
// 서버 물품 아이콘 주소. 아이콘을 안 올렸거나 지워진 물품은 null이라 같은 크기의 빈 자리만 둔다
// 서버 물품 아이콘 주소. 아이콘을 안 올렸거나 지워진 물품은 null이라 회색 칸만 둔다
icon: string | null;
itemName: string;
subtitle: string;
Expand Down Expand Up @@ -67,11 +68,7 @@ function BillilgeItemCard({
>
<div className="flex h-[42px] w-full items-center justify-between">
<div className="flex items-center gap-3">
{icon ? (
<img alt="" className="size-[42px]" src={icon} />
) : (
<div className="size-[42px]" />
)}
<BillilgeItemIcon src={icon} />
<div className="flex flex-col gap-0.5">
<Typography
as="p"
Expand Down
16 changes: 16 additions & 0 deletions src/features/billilge/components/BillilgeItemIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
interface BillilgeItemIconProps {
// 아이콘이 없는 물품은 null이라 빈 회색 칸만 둔다
src: string | null;
}

function BillilgeItemIcon({ src }: BillilgeItemIconProps) {
return (
<div className="flex size-[42px] shrink-0 items-center justify-center rounded-[10px] bg-background-alternative">
{src && (
<img alt="" className="max-h-8 max-w-8 object-contain" src={src} />
)}
</div>
);
}

export default BillilgeItemIcon;
2 changes: 1 addition & 1 deletion src/features/billilge/components/BillilgeListSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function BillilgeListSkeleton() {
<Skeleton
animation={animation}
height="42px"
radius="8px"
radius="10px"
variant="rectangle"
width="42px"
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Typography } from "@wanteddev/wds";

import BillilgeItemIcon from "@/features/billilge/components/BillilgeItemIcon";
import BillilgeStatusBadge from "@/features/billilge/components/BillilgeStatusBadge";
import type { BillilgeRentalStatus } from "@/shared/entities/billilge/billilgeTypes";

interface BillilgeRentalHistoryEntryProps {
// 물품이 지워졌거나 아이콘이 없으면 null이라 같은 크기의 빈 자리만 둔다
// 물품이 지워졌거나 아이콘이 없으면 null이라 회색 칸만 둔다
icon: string | null;
itemName: string;
rentedAt: string;
Expand All @@ -25,11 +26,7 @@ function BillilgeRentalHistoryEntry({
return (
<div className="flex w-full items-center justify-between">
<div className="flex flex-1 items-center gap-3">
{icon ? (
<img alt="" className="size-[42px]" src={icon} />
) : (
<div className="size-[42px]" />
)}
<BillilgeItemIcon src={icon} />
<div className="flex flex-col gap-1">
<Typography
as="p"
Expand Down
4 changes: 2 additions & 2 deletions src/features/billilge/components/BillilgeReturnSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function BillilgeReturnSkeleton() {
<Skeleton
animation={animation}
height="42px"
radius="8px"
radius="10px"
variant="rectangle"
width="42px"
/>
Expand Down Expand Up @@ -83,7 +83,7 @@ function BillilgeReturnSkeleton() {
<Skeleton
animation={animation}
height="42px"
radius="8px"
radius="10px"
variant="rectangle"
width="42px"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/features/home/components/HomeRentalSkeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function HomeRentalSkeleton() {
<Skeleton
animation={animation}
height="42px"
radius="8px"
radius="10px"
variant="rectangle"
width="42px"
/>
Expand Down