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

단체 메인, 관리 페이지 개발 #26

Open
wants to merge 27 commits into
base: develop
Choose a base branch
from

Conversation

sera2002
Copy link
Collaborator

작성자: @sera2002

Related to #{이슈 번호 기입}

체크 리스트

  • 적절한 제목으로 수정했나요?
  • 상단에 이슈 번호를 기입했나요?
  • Target Branch를 올바르게 설정했나요?
  • Label을 알맞게 설정했나요?

작업 내역

  • 단체 메인페이지

    • 관리자 ver.
    스크린샷 2023-09-11 오후 1 53 04
    • 멤버 ver
    스크린샷 2023-09-11 오후 1 52 24
    • 방문객 ver.
    스크린샷 2023-09-11 오후 1 53 31
    • 등록된 맛집이 없는 경우
    스크린샷 2023-09-11 오후 2 26 57
  • 단체 정보 수정 페이지

    스크린샷 2023-09-11 오후 2 28 41
  • 단체 멤버 관리 페이지

    스크린샷 2023-09-11 오후 2 33 41
    • 관리 권한 승계
    스크린샷 2023-09-11 오후 2 34 05
  • 단체 맛집 관리 페이지
    스크린샷 2023-09-11 오후 2 29 08

  • 단체 멤버 조회 페이지
    스크린샷 2023-09-11 오후 2 39 29

비고

  • 공통 컴포넌트 수정 사항 : dataDisplay/Member
    • showManangementButton Props 추가 (dots icon 보여줄 지 결정)
  • 단체 메인 페이지에서 맛집 필터 설정은 아직 개발되지 않았습니다.
  • 단체 정보 수정 페이지의 경우 단체 생성 페이지와 포맷을 맞추면 좋을 것 같습니다.

@sera2002 sera2002 added the feature 신규 컴포넌트/기능 개발 (제일 일반적) label Sep 11, 2023
@sera2002 sera2002 self-assigned this Sep 11, 2023
@sera2002 sera2002 changed the title 단체 메인 페이지 개발 단체 메인, 관리 페이지 개발 Sep 11, 2023
Copy link
Member

@jaychang99 jaychang99 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

src/components/dataDisplay/Member.tsx Show resolved Hide resolved
import Button from "components/button/Button";

interface Props {
organizationId: string | number | string[];
Copy link
Member

Choose a reason for hiding this comment

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

organizationId 의 타입에 string[] 도 추가해주신 특별한 이유가 있을까요~?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

음.. organizationId를 넘겨줄 때 타입 명시를 안해줬더니 error TS2322: Type 'string | number | string[]' is not assignable to type 'number’. 이런 에러가 발생해서 일단 추가해줬던 것 같습니다..
현재는 organizationId의 타입을 number로만 받는걸로 수정했습니다!

<Image
width={size}
height={size}
alt="멤버 관리 아이콘"
Copy link
Member

Choose a reason for hiding this comment

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

오 접근성과 SEO 를 염두에 둔 alt text 좋습니다!! 👍

src/pages/organizations/[organizationId]/index.tsx Outdated Show resolved Hide resolved
title={`${organizationId} 번 단체 상세 페이지`}
description="단체 관리 및 맛집 목록 등 단체에 대한 정보를 볼 수 있는 페이지 "
/>
<ViewOrganizationMainPage organizationId={organizationId}></ViewOrganizationMainPage>
Copy link
Member

Choose a reason for hiding this comment

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

self-closing 태그가 되어도 좋을 것 같습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

수정했습니다!

/**
* TODO: 서버에서 해당 단체에 대한 유저의 권한 받아오기
*/
const userAuth = 0; // 해당 단체에 대한 유저의 권한 (0: 관리자, 1: 멤버, 2: 방문객)
Copy link
Member

Choose a reason for hiding this comment

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

이 값은 API 문서의 값인가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넵 맞습니다.


export default ViewOrganizationMainPage;

const EmotionWrapper = styled.div``;
Copy link
Member

Choose a reason for hiding this comment

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

없어도 될 것 같습니다! Fragment (<> </>) 로 감싸도 될 것 같습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

수정했습니다!

Comment on lines 15 to 21
if (userAuth === 0) {
AuthButtonsComponent = ManagementButtons;
} else if (userAuth === 1) {
AuthButtonsComponent = MemberButtons;
} else {
AuthButtonsComponent = VisitorButtons;
}
Copy link
Member

Choose a reason for hiding this comment

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

if ~ else if ~ else 가 중첩되어 가독성이 약간 좋지 않은 것 같습니다. 또한 let 사용으로 인해 불변성 보장을 받지 못할 것 같은데 혹시 아래와 같이 또한 컴포넌트 외부에서 처리 및 리렌더 될 때마다 새로 불러오지 않으므로 이 부분만 컴포넌트 위로 빼는 것은 어떨까요? ( 이렇게 하면 const 사용으로도 변경할 수 있을 것 같습니다!)

아래와 같은 형식을 생각하였습니다.

Suggested change
if (userAuth === 0) {
AuthButtonsComponent = ManagementButtons;
} else if (userAuth === 1) {
AuthButtonsComponent = MemberButtons;
} else {
AuthButtonsComponent = VisitorButtons;
}
const AUTH_BUTTONS_COMPONENT = {
0: ManagementButtons,
1: MemberButtons,
2: VisitorButtons,
}
const AuthButtonComponent = AUTH_BUTTONS_COMPONENT[userAuth]
return (
...
<AuthButtonComponent />
)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

오.. 넵 좋습니다.
제안해주신 사항 반영해서 수정했습니다!

<EmotionWrapper>
<AuthButtonsComponent organizationId={organizationId} />
{(userAuth === 0 || userAuth === 1) && (
<ActionButtons organizationId={organizationId}></ActionButtons>
Copy link
Member

Choose a reason for hiding this comment

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

self-closing 해도 될 것 같습니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

수정했습니다!

@jaychang99
Copy link
Member

@sera2002 @hoon5083 앗 그리고 제가 <Restaurant /> 컴포넌트 설계를 잘못 해서 <a /> 태그 안에 또 <a /> 태그가 들어가는 꼴이 되어 Restaurant 컴포넌트를 사용한 페이지에서 hydration error 가 나는 것 같습니다. 이것만 픽스해서 PR 따로 올려야 할 것 같습니다. 죄송합니다. 🙏

@jaychang99
Copy link
Member

@sera2002 제안 사항 반영 감사합니다!!

현 시점까지 반영해주신 부분은 👍 마크와 함께 스레드를 Resolve 했습니다. 수고하셨습니다!

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.

None yet

2 participants