diff --git a/components/Layout/NotiBar/NotiItem.tsx b/components/Layout/NotiBar/NotiItem.tsx index 77be9ff1b..895f6a483 100644 --- a/components/Layout/NotiBar/NotiItem.tsx +++ b/components/Layout/NotiBar/NotiItem.tsx @@ -35,6 +35,11 @@ export default function NotiItem({ data }: NotiItemProps) { style: styles.canceldByMan, content: message, }, + // TODO: 고치기 + GIFT: { + style: styles.gift, + content: message, + }, }; const notiWrapperStyle = isChecked ? styles.readWrap : styles.unreadWrap; diff --git a/hooks/modal/store/purchase/useBuyModal.ts b/hooks/modal/store/purchase/useBuyModal.ts index a286db8a1..3f0f2ddfe 100644 --- a/hooks/modal/store/purchase/useBuyModal.ts +++ b/hooks/modal/store/purchase/useBuyModal.ts @@ -11,7 +11,7 @@ const useBuyModal = (purchasedItem: Purchase) => { const onPurchase = async () => { try { await instance.post( - `pingpong/items/purchases/${purchasedItem.itemId}`, + `/pingpong/items/purchases/${purchasedItem.itemId}`, null ); alert(`구매 성공!`); diff --git a/hooks/modal/store/purchase/useGiftModal.ts b/hooks/modal/store/purchase/useGiftModal.ts index dbff4205f..c5de34b24 100644 --- a/hooks/modal/store/purchase/useGiftModal.ts +++ b/hooks/modal/store/purchase/useGiftModal.ts @@ -1,8 +1,6 @@ -// import { useEffect, useState } from 'react'; import { useSetRecoilState } from 'recoil'; import { Gift, GiftRequest } from 'types/itemTypes'; -import { instanceInManage } from 'utils/axios'; -import { mockInstance } from 'utils/mockAxios'; +import { instance } from 'utils/axios'; import { errorState } from 'utils/recoil/error'; import { modalState } from 'utils/recoil/modal'; @@ -12,22 +10,19 @@ const useGiftModal = (gift: Gift) => { const data: GiftRequest = { ownerId: gift.ownerId, }; - // TODO: mockInstance 대신 instance로 변경하기 + const onPurchase = async () => { if (gift.ownerId === '') { - // TODO: alert 대신 toast/snackbar로 변경하기? alert('선물할 유저를 선택해주세요.'); return; } try { - const res = await mockInstance.post(`/items/gift/${gift.itemId}`, data); + const res = await instance.post( + `/pingpong/items/gift/${gift.itemId}`, + data + ); if (res.status === 201) { - // TODO: alert 대신 toast 띄우거나 아무것도 안하기 - alert(`${gift.ownerId}님께 선물이 전달되었습니다`); - await instanceInManage.post(`/notifications`, { - intraId: gift.ownerId, - message: `선물이 도착했어요🎁 상점 보관함에서 선물과 발송인을 확인하세요!`, - }); + alert(`${gift.ownerId}님께 선물이 전달되었습니다.`); } } catch (error) { setError('HB02'); diff --git a/styles/Layout/NotiItem.module.scss b/styles/Layout/NotiItem.module.scss index 8a4076848..a1f18621b 100644 --- a/styles/Layout/NotiItem.module.scss +++ b/styles/Layout/NotiItem.module.scss @@ -24,6 +24,7 @@ border: 0.5px solid rgba(174, 141, 178, 1); } .unreadWrap { + word-break: keep-all; &.imminent { color: rgba(255, 255, 255, 1); background: rgba(166, 100, 176, 1); @@ -47,6 +48,12 @@ background: rgba(204, 173, 218, 1); border: 0.5px solid rgba(237, 116, 167, 1); } + // TODO: 스타일 수정 + &.gift { + color: rgba(255, 255, 255, 1); + background: rgba(235, 152, 187, 1); + border: 0.5px solid rgba(166, 100, 176, 1); + } } .date {