Skip to content

Commit

Permalink
feat: 제품 목록 디폴트 이미지 추가 및 타입 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
bottlewook committed Feb 20, 2024
1 parent 53dac77 commit f41ecd1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/shared/product-article/ProductArticle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function ProductArticle({ isRow = false, itemData }: ProductArticleProps) {
<article className={cx('container', { row: isRow })}>
<div className={cx('imgBox')}>
<Image
src={itemData.imageSource!}
src={itemData.imageSource ?? '/assets/profile.JPG'}
alt="제품 이미지"
width={0}
height={0}
Expand Down
42 changes: 37 additions & 5 deletions src/remote/api/types/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,53 @@ export interface IRecommendProducts extends IBanner {
}

export interface IProduct {
brand: string
upperItem: string
productNo: number
imageSource: string
productName: string
safetyStatus: string
barcode: string
imageSource: string
reportNumber: string
safetyStatus: string
viewCount: number
brand: string
upperItem: string
createdAt: string
createdBy: string
modifiedAt: string
modifiedBy: string
}

export interface IProductContent {
content: IProduct[]
}

export interface IProductPageInfo {
pageable: {
pageNumber: number
pageSize: number
sort: {
empty: boolean
sorted: boolean
unsorted: boolean
}
offset: number
paged: boolean
unpaged: boolean
}
totalPages: number
totalElements: number
last: boolean
size: number
number: number
sort: {
empty: boolean
sorted: boolean
unsorted: boolean
}
numberOfElements: number
first: boolean
empty: boolean
}

export interface IProductDetails extends IProduct {
companyName: string
productType: string
Expand All @@ -44,5 +76,5 @@ export interface IProductDetails extends IProduct {

export type BannerType = ICommon<IBanner[]>;
export type RecommendProductsType = ICommon<IRecommendProducts[]>;
export type ProductType = ICommon<IProduct[]>;
export type ProductListInfoType = ICommon<IProductContent & IProductPageInfo>;
export type ProductDetailsType = ICommon<IProductDetails>;

0 comments on commit f41ecd1

Please sign in to comment.