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

[Feat] 이벤트페이지 #174

Merged
merged 51 commits into from
Aug 18, 2024
Merged

[Feat] 이벤트페이지 #174

merged 51 commits into from
Aug 18, 2024

Conversation

Young2un
Copy link
Contributor

🚀 작업 내용

  • 이벤트 페이지 오래걸렸네용
  • 탭 클릭 시 해당 이벤트 섹션으로 이동 + active 효과
  • 한번만 받을 수 있는 웰컴쿠폰 (로그인해야함)
  • 하루에 한번 돌릴 수 있는 룰렛 (로그인해야함) -> 쿠폰 발급시 효과 라이브러리 사용
  • 그 외는 그저 퍼블리싱 정도입니당

📝 참고 사항

  • 아직 클릭해서 들어갈 event배너가 없습니다. url로 들어가서 봐주세용
  • 토큰관리 시급,,
  • 뮤테이션 훅으로 빼봤는데 잘했는가 모르겠슴당,,
  • 쿠폰함가기 링크 일단 홈으로 해놨습니다.
  • 하루에 한번 9시에 초기화해서 룰렛 돌아가게 했습니다

🖼️ 스크린샷

image

🚨 관련 이슈 (이슈 번호)

✅ 체크리스트

  • Code Review 요청
  • Label 설정
  • PR 제목 규칙에 맞는지 확인

@Young2un Young2un added the 📖 Page 페이지 제작 label Aug 12, 2024
Copy link
Contributor

@bokeeeey bokeeeey left a 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 Show resolved Hide resolved
Comment on lines 29 to 46
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;
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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로 피드백해주면 더 좋을거라 생각합니다

src/app/event/_components/BenefitJoin.tsx Outdated Show resolved Hide resolved
src/app/event/_components/EventTab.tsx Outdated Show resolved Hide resolved
src/app/event/_components/EventTab.tsx Outdated Show resolved Hide resolved
src/app/event/_components/Wheel.tsx Outdated Show resolved Hide resolved
src/app/event/page.tsx Outdated Show resolved Hide resolved
src/constants/route.ts Show resolved Hide resolved
src/hooks/useCreateCouponMutation.ts Show resolved Hide resolved
src/types/couponTypes.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@minjeong9919 minjeong9919 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 👍

public/images/backconfetti.png Outdated Show resolved Hide resolved
public/images/eventTop.png Outdated Show resolved Hide resolved
src/app/event/_components/EventTab.tsx Outdated Show resolved Hide resolved
.container {
width: 100%;
height: 90rem;
background: url('../../../../public/images/backconfetti.png'), linear-gradient(to left, #d3e1ff, #fcfcf2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 위에서 import 먼저 하시는건 어떠신가욤??

Suggested change
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);

Copy link
Contributor Author

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오오 따로 Image 태그에 클래스명 안붙이고 img라고해도 되나요오?! 첨 안 사실

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

예쓰예쓰~ 아무래도? 이미지 태그니까? 근데 나쁜거 같기동,,?

src/app/event/_components/Wheel.tsx Outdated Show resolved Hide resolved
src/hooks/useCreateCouponMutation.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@armd482 armd482 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다

src/app/event/_components/EventTab.tsx Outdated Show resolved Hide resolved
src/app/event/_components/EventTitle.tsx Outdated Show resolved Hide resolved
src/hooks/useCreateCouponMutation.ts Outdated Show resolved Hide resolved
src/hooks/useCreateCouponMutation.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@ggjiny ggjiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생 많으셨어요!!!! 디자인 센스 쩌러요 프로젝트 퀄리티 업🎀🎀

Copy link
Contributor

@ggjiny ggjiny Aug 15, 2024

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() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이름을 EventPage라고 해도 좋을 것 같아요오

Comment on lines +13 to +15
await queryClient.prefetchQuery({ queryKey: ['coupons'], queryFn: getCoupon });
// const couponData = queryClient.getQueryData(['coupons']);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

페이지말고 레이아웃에서 데이터를 받아오시는군요?! 주석은 지워도 될 것 같아용~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

대박👍👍 혹시 컴포넌트 이름을 룰렛 말고 휠로 하신 이유가 있을까용?? 저는 살짝 헷갈렸는데 가볍게 지나가셔도 됩니당~

Comment on lines +48 to +57
<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>
Copy link
Contributor

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}`}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 id로 해당 섹션으로 이동하는거 좋은 것 같타요! 그냥 스크롤을 쭉 내리면 인터섹션 옵저버로 자동으로 바뀌나요?./ ?

import { SetStateAction } from 'react';
import { toast } from 'react-toastify';

const queryClient = new QueryClient();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

영은님 저도 만들어보는중인데 이거 useQueryClient로 사용해도 돼요

Copy link
Contributor Author

@Young2un Young2un Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어 오 그러네요!!! 굿굿👍👍 반영하겠습니다!!

@Young2un Young2un merged commit 1819b9d into develop Aug 18, 2024
@Young2un Young2un deleted the 161-feat-이벤트페이지 branch October 23, 2024 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📬 API 서버 api 통신 ✨ Component 기능 개발 📖 Page 페이지 제작
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] 이벤트페이지
5 participants