-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Feat] 이벤트페이지 #174
The head ref may contain hidden characters: "161-feat-\uC774\uBCA4\uD2B8\uD398\uC774\uC9C0"
[Feat] 이벤트페이지 #174
Conversation
…161-feat-이벤트페이지
…161-feat-이벤트페이지
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
완성된 페이지 화면이 퀄리티가 상당하네요
고생하셨습니다 굿굿!
src/api/couponAPI.ts
Outdated
export const getCoupon = async (): Promise<CouponResponse[]> => { | ||
const token = await getCookie('accessToken'); | ||
|
||
try { | ||
const response = await fetch(`${BASE_URL}/api/v1/user/coupon`, { | ||
cache: 'no-cache', | ||
headers: { | ||
'Cache-Control': 'no-cache', | ||
Authorization: token ? `Bearer ${token}` : '', | ||
}, | ||
}); | ||
const rawData = await response.json(); | ||
|
||
return rawData.data; | ||
} catch (error) { | ||
throw error; | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const getCoupon = async (): Promise<CouponResponse[]> => { | |
const token = await getCookie('accessToken'); | |
try { | |
const response = await fetch(`${BASE_URL}/api/v1/user/coupon`, { | |
cache: 'no-cache', | |
headers: { | |
'Cache-Control': 'no-cache', | |
Authorization: token ? `Bearer ${token}` : '', | |
}, | |
}); | |
const rawData = await response.json(); | |
return rawData.data; | |
} catch (error) { | |
throw error; | |
} | |
}; | |
export const getCoupon = async (): Promise<CouponResponse[]> => { | |
const token = await getCookie('accessToken'); | |
try { | |
const response = await fetch(`${BASE_URL}/api/v1/user/coupon`, { | |
cache: 'no-cache', | |
headers: { | |
'Cache-Control': 'no-cache', | |
Authorization: token ? `Bearer ${token}` : '', | |
}, | |
}); | |
const rawData = await response.json(); | |
if (!response.ok) { | |
throw new Error(rawData.message || "대충 메세지") | |
} | |
return rawData.data; | |
} catch (error) { | |
throw error; | |
} | |
}; |
여기도 위 함수와 같이 예외처리를 한번 해주시는게 어떠신가요?
사용처에서 toast로 피드백해주면 더 좋을거라 생각합니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다 👍
.container { | ||
width: 100%; | ||
height: 90rem; | ||
background: url('../../../../public/images/backconfetti.png'), linear-gradient(to left, #d3e1ff, #fcfcf2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거 위에서 import 먼저 하시는건 어떠신가욤??
background: url('../../../../public/images/backconfetti.png'), linear-gradient(to left, #d3e1ff, #fcfcf2); | |
import backConfetti from '../../../../public/images/backconfetti.png'; | |
background: url(backConfetti), linear-gradient(to left, #d3e1ff, #fcfcf2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
css도 이미지를 import 해올수 있나용???
@include flex-center; | ||
} | ||
|
||
.inner img { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오오 따로 Image 태그에 클래스명 안붙이고 img라고해도 되나요오?! 첨 안 사실
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
예쓰예쓰~ 아무래도? 이미지 태그니까? 근데 나쁜거 같기동,,?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생 많으셨어요!!!! 디자인 센스 쩌러요 프로젝트 퀄리티 업🎀🎀
src/api/productAPI.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음 이게 아마 찜 하트 때문에 필요해서 제가 넣은거 같아요!! 로그인 해야지만 좋아요 상태가 보여서용
|
||
const cn = classNames.bind(styles); | ||
|
||
export default function Page() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이름을 EventPage라고 해도 좋을 것 같아요오
await queryClient.prefetchQuery({ queryKey: ['coupons'], queryFn: getCoupon }); | ||
// const couponData = queryClient.getQueryData(['coupons']); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
페이지말고 레이아웃에서 데이터를 받아오시는군요?! 주석은 지워도 될 것 같아용~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
대박👍👍 혹시 컴포넌트 이름을 룰렛 말고 휠로 하신 이유가 있을까용?? 저는 살짝 헷갈렸는데 가볍게 지나가셔도 됩니당~
<button | ||
className={cn('coupon-down')} | ||
key={minPrice} | ||
type='button' | ||
onClick={() => handleClick(price, minPrice)} | ||
> | ||
<Image className={cn('coupon')} src={couponDownImg} alt='쿠폰이미지' fill /> | ||
<h3 className={cn('discount')}>{price.toLocaleString()}</h3> | ||
<span className={cn('min-price')}>{minPrice}</span> | ||
</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
크기가 커서 버튼 말고 div로 감싸도 될 것 같다는 개인적인 생각입니다~
{EVENT_LIST.map((event) => ( | ||
<Link | ||
key={event.id} | ||
href={`#${event.id}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오호 id로 해당 섹션으로 이동하는거 좋은 것 같타요! 그냥 스크롤을 쭉 내리면 인터섹션 옵저버로 자동으로 바뀌나요?./ ?
src/hooks/useCreateCouponMutation.ts
Outdated
import { SetStateAction } from 'react'; | ||
import { toast } from 'react-toastify'; | ||
|
||
const queryClient = new QueryClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
영은님 저도 만들어보는중인데 이거 useQueryClient로 사용해도 돼요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어 오 그러네요!!! 굿굿👍👍 반영하겠습니다!!
…161-feat-이벤트페이지
🚀 작업 내용
📝 참고 사항
🖼️ 스크린샷
🚨 관련 이슈 (이슈 번호)
✅ 체크리스트