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/#335] 클래스 생성 시 각 단계별 새로고침 대응 & 리뷰 순서 최신순으로 정렬 #337

Merged
merged 11 commits into from
Oct 13, 2024

Conversation

ExceptAnyone
Copy link
Member

@ExceptAnyone ExceptAnyone commented Sep 28, 2024

📌 관련 이슈번호


체크리스트

  • 🎋 base 브랜치를 develop 브랜치로 설정했나요?
  • 🖌️ PR 제목은 형식에 맞게 잘 작성했나요?
  • 🏗️ 빌드는 성공했나요? (yarn build)
  • 🧹 불필요한 코드는 제거했나요? e.g. console.log
  • 🙇‍♂️ 리뷰어를 지정했나요?
  • 🏷️ 라벨은 등록했나요?

✅ Key Changes

이번 PR에서 작업한 내용을 간략히 설명해주세요

  1. 내용1
    • 클래스 생성 시 각 단계별 새로고침 대응했습니다.
    • 클래스 생성 시 localStorage 내 classPostData 리셋하게 구현하였습니다.
    • 클래스 생성 완료 진행 다음, 유저가 다시 뒤로가기 후에, 다시 클래스를 개설하려고 할 시, 토스트 메세지 띄우게 만들어놨습니다.
    • 위 토스트 메세지는 임의로 입력한 상태이고, 추후 기획쌤들 께서 상의 후 알려주신답니다!
    • 리뷰 순서 최신순으로 배치해놨슴다

📢 To Reviewers

  • 공통 컴포넌트 버튼에 type ='button'추가해줬고, 꼭 필요한 속성들 제외하고는 ...props로 받게 해놨습니다.
  • 추후에 aria까지 공부해서 같이 도입해봐요!

📸 스크린샷 or 실행영상

@ExceptAnyone ExceptAnyone added ✨ Feature 기능 개발 👶🏿 정안 먹어도암안걸리고마 labels Sep 28, 2024
@ExceptAnyone ExceptAnyone self-assigned this Sep 28, 2024
@ExceptAnyone ExceptAnyone changed the title [Feat/#335] 클래스 생성 시 각 단계별 새로고침 대응 [Feat/#335] 클래스 생성 시 각 단계별 새로고침 대응 & 리뷰 순서 최신순으로 정렬 Oct 7, 2024
Comment on lines -20 to +26
const Button = ({ variant, disabled, customStyle, onClick, children }: ButtonProps) => {
const Button = ({ variant, disabled, customStyle, children, ...props }: ButtonProps) => {
return (
<button
type="button"
css={[buttonStyle, buttonSize[variant], disabled && disabledStyle, customStyle]}
onClick={onClick}
disabled={disabled}>
disabled={disabled}
{...props}>
Copy link
Member

Choose a reason for hiding this comment

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

여길 이렇게 하신 이유가있나요?

여러 속성을 받기위해 props를 추가하신건가요? 그렇다면 onClick을 지운 이유도 있을까요?

Copy link
Member

Choose a reason for hiding this comment

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

속성이 너무많아지고 복잡해져서 그런건가여?
굳이 그대로 전달만 하는애들을 인자로 받을필요 없어서...?

Copy link
Member Author

Choose a reason for hiding this comment

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

맞슴다! 추후에 어떤 버튼 속성이 추가된다면, 기존 방식대로라면 prop이 하나하나 추가될 것 같아서요!

Comment on lines 20 to 26
{/* moimReviewList안에 date를 이용해서 sort로 최신순으로 정렬 */}
{moimReviewList
?.sort((a, b) => {
const dateA = a.date ? new Date(a.date).getTime() : 0; // date가 없으면 0으로 설정
const dateB = b.date ? new Date(b.date).getTime() : 0; // date가 없으면 0으로 설정
return dateB - dateA; // 최신순 정렬
})
Copy link
Member

Choose a reason for hiding this comment

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

이런 정렬은 사실 서버에서 해서 내려달라고 하는게 조금 더 좋을 것 같은데 어떻게 생각하시나요?

Copy link
Member Author

Choose a reason for hiding this comment

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

서버에서 Date를 내려주고 있긴합니다.
다만, 기획 쌤들이 최신순으로 배치되기를 원하시더라구요!
그래서 제가 따로 정렬했는데, 사실 서버에서 최신으로 정렬해서 내려준다면 훨씬 좋을 것 같아요!
서버 쌤들께 문의드려보겠습니다 ㅎㅎ

Comment on lines 69 to 70
width: 3rem;
height: 3rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

여기 width, height를 제가 넣어놓은게 실제 아이콘 크기는 3rem이 아니긴 한데 디자인쪽에서 아이콘이 너무 작아서 모바일에서 터치할 때 잘 안된다고 해서 터치 영역을 일부러 3rem으로 잡아놓은건데 혹시 삭제하신 이유가 있으신가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

아하 그렇군요.. 필요없는 속성이라 판단되어 삭제했던 것 같습니다...
공통 컴포넌트 수정은 참 어렵군요 ㅠㅠ 다시 복구했습니다!

@ExceptAnyone ExceptAnyone merged commit 2d54c52 into develop Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature 기능 개발 👶🏿 정안 먹어도암안걸리고마
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants