Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GGFE-206] 아이템 보관함 조회 api 연결 #967

Merged
merged 8 commits into from
Aug 31, 2023
7 changes: 6 additions & 1 deletion components/store/InventoryItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,12 @@ export function InvetoryItem({ item }: inventoryItemProps) {
</div>
<div onTouchStart={handleTouch}>
<div className={styles.imgContainer}>
<Image className={styles.img} src={imageUri} alt={itemName} fill />
<Image
className={styles.img}
src={imageUri === null ? '/image/fallBackSrc.jpeg' : imageUri}
alt={itemName}
fill
/>
</div>
<div className={styles.itemName}>{itemName}</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions components/store/InventoryList.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import { instance } from 'utils/axios';
import { InfinityScroll } from 'utils/infinityScroll';
import { mockInstance } from 'utils/mockAxios';
import { InfiniteScrollComponent } from 'components/store/InfiniteScrollComponent';
import { InvetoryItem } from 'components/store/InventoryItem';
import styles from 'styles/store/Inventory.module.scss';

function fetchInventoryData(page: number) {
return mockInstance.get(`items?page=${page}&size=${8}`).then((res) => {
return instance.get(`/pingpong/items?page=${page}&size=${8}`).then((res) => {
return res.data;
});
}
Expand Down
4 changes: 4 additions & 0 deletions styles/store/Inventory.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

.inventoryList {
display: grid;
height: 100%;
grid-template-columns: 1fr 1fr;
grid-gap: 0.5rem;
font-family: 'NanumSquare_acR', sans-serif;
Expand All @@ -20,15 +21,18 @@
.emptyMessage {
display: flex;
width: 100%;
height: 100%;
font-size: 1.3rem;
color: #d4b8f2;
grid-column: 1 / 3;
justify-content: center;
align-items: center;
text-align: center;
}

.inventoryItem {
position: relative;
height: fit-content;
padding: 1rem;
color: #7a6e7b;
background-color: #d4b8f2;
Expand Down