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] 어드민 기대평 페이지 구현 #104

Merged
merged 6 commits into from
Aug 16, 2024
Merged

Conversation

darkdulgi
Copy link
Collaborator

#️⃣ 연관 이슈

📝 작업 내용

  • 무작위 문자열 생성 함수 분리

생성할 문자열의 길이를 인자로 받으며 @common/mock 폴더 안에 있습니다.

  • 어드민 기대평 검색 페이지에서 pagination 적용
  • 기대평 삭제 시 모달을 띄우게 함

pagination과 모달은 재사용 컴포넌트를 사용했습니다.

  • '선택' 탭 누를 시 기대평 전체 선택 가능

현재 페이지 내 모든 기대평이 선택상태일 때 누르면 모두 해제됩니다.

@darkdulgi darkdulgi added the feat 기능 구현 label Aug 16, 2024
@darkdulgi darkdulgi requested a review from lybell-art August 16, 2024 08:10
@darkdulgi darkdulgi self-assigned this Aug 16, 2024
@darkdulgi darkdulgi linked an issue Aug 16, 2024 that may be closed by this pull request
6 tasks
setCheckedComments,
}) {
const num = checkedComments.size;
const mutation = useMutation(eventId, () =>
Copy link
Collaborator

Choose a reason for hiding this comment

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

eventId 자체는 다른 useQuery 또는 useMutation에서 중복될 수 있는 값이므로, 고유한 자원을 위해 "admin-comment-(eventId)" 같은 걸로 바꾸면 좋을 겁니다.

Comment on lines 32 to 44
const deleteConfirmModal = (
<ConfirmModal
title="삭제"
description={
<>
<span>이 동작은 다시 돌이킬 수 없습니다.</span>
<br />
<span>{num}개의 이벤트를 삭제하시겠습니까?</span>
</>
}
onConfirm={mutation}
/>
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

공통 컴포넌트를 사용하시는 거 좋습니다.

str += String.fromCharCode(randomCode);
}

return str;
Copy link
Collaborator

Choose a reason for hiding this comment

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

향후 다른 곳에서 쓸 수 있겠군요

Comment on lines +23 to +35
function getDate(createdAt) {
const yy = createdAt.slice(2, 4);
const mm = createdAt.slice(5, 7);
const dd = createdAt.slice(8, 10);
return `${yy}-${mm}-${dd}`;
}

function getTime(createdAt) {
const hh = createdAt.slice(11, 13);
const mm = createdAt.slice(14, 16);
const ss = createdAt.slice(17, 19);
return `${hh}:${mm}:${ss}`;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 부분은 순수 함수기 때문에 컴포넌트 바깥쪽으로 빼는 게 좋습니다.

@lybell-art lybell-art merged commit 5451298 into dev Aug 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat 기능 구현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] 어드민-기대평
2 participants