-
Notifications
You must be signed in to change notification settings - Fork 0
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(community): 마이 페이지 추가 #38
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
padding: themeVars.spacing.xl, | ||
border: `1px solid ${themeVars.color.gray300}`, | ||
borderRadius: themeVars.borderRadius.xl, | ||
boxShadow: '0 1px 3px 0 rgb(0 0 0 / 0.1)', |
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.
box-shadow를 토큰화 하는 건 어떨까요? 다른 분들의 의견이 궁금합니다!
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.
해당 부분 추가했습니다 ~
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.
LGTM🙋♂️
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.
USERS: `${MOCK_BASE_URL}/users`,
URL을 users
를 사용한 이유가 궁금합니다. 해당 페이지는 '마이 페이지'인데 users라고 지정한 이유가 있나요?
처음에는 my보다는 users로 네이밍하는게 확장성 측면에서 더 자연스럽다고 판단했는데, users는 마이페이지 보다는 회원관리(admin)쪽에 더가까운 것 같네요. my로 수정하겠습니다 ! |
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.
LGTM
value: React.ReactNode; | ||
} | ||
|
||
function MyInfoField({ title, value }: Props) { |
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.
해당 컴포넌트가 단독으로 사용되는 유즈-케이스가 없다면 MyInfoCard
에 컴파운드 패턴으로 묶어도 좋을거 같아요
@SunwooJaeho @gwansikk @wontory |
apps/community/src/app/my/page.tsx
Outdated
<MyInfoCardList | ||
userDetails={userDetails} | ||
userEditableDetails={userEditableDetails} | ||
/> |
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.
<MyInfoCardList | |
userDetails={userDetails} | |
userEditableDetails={userEditableDetails} | |
/> | |
<MyInfoCard | |
userDetails={userDetails} | |
/> | |
<MyInfoEditalbeCard | |
userEditableDetails={userEditableDetails} | |
/> |
이런 방식으로 컴포넌트를 분리하는게 좋아보인다는건가요 ??
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.
제 개인적인 생각으로는 MyInfoCardList로 감싸는 것이 아니라 해당 코드를 그대로 드러내는 것이 낫다고 생각이 됩니다!
<MyInfoCard title="내 프로필" layout="default">
{userDetails.map((detail) => (
<MyInfoCard.Field
key={detail.title}
title={detail.title}
value={detail.value}
/>
))}
</MyInfoCard>
<MyInfoCard title="기본 정보" layout="singleColumn">
{userEditableDetails.map((detail) => (
<MyInfoCard.EditableField
key={detail.title}
title={detail.title}
value={detail.value}
onSave={(value) => handleSave(detail.title, value)}
/>
))}
</MyInfoCard>
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.
MyPage는 async/await를 포함하는 서버 컴포넌트이고, MyInfoCardList컴포넌트는 상태관리와 이벤트 핸들링을 포함한 클라이언트 컴포넌트라서 분리를 해줬습니다.
말씀하신 방법대로 코드를 드러내는건 무리라고 생각하고, 다른 접근방법이 있다면 말씀해주세요 !!
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 cardContent = styleVariants({ | ||
default: { | ||
display: 'grid', | ||
gridTemplateColumns: 'repeat(2, 1fr)', |
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.
cols에 대한 토큰화가 가능하다고 생각하는데, 다른 분들의 의견이 궁금해요!
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.
- 저는 토큰화하면 활용성이 좋다고 생각해요 (Tailwind CSS와 같이 선언적으로 사용)
- css-in-js 형식으로 스타일 파일 외에서 스타일 주입이 가능해요
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.
LGTM👍
const cardContent = styleVariants({ | ||
default: { | ||
display: 'grid', | ||
gridTemplateColumns: 'repeat(2, 1fr)', |
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.
- 저는 토큰화하면 활용성이 좋다고 생각해요 (Tailwind CSS와 같이 선언적으로 사용)
- css-in-js 형식으로 스타일 파일 외에서 스타일 주입이 가능해요
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.
👍👍👍
<Input | ||
value={currentValue} | ||
onChange={(e) => setCurrentValue(e.target.value)} | ||
placeholder={value} | ||
type="text" | ||
/> |
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.
EditMode에 따라 Input이 없어졌다 생겼다 하는 것은 접근성, 사용자 경험에 안좋다고 생각해요. input의 disabled 속성을 사용해서 입력을 제어하는 건 어떤가요
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.
좋은 생각입니다 !
사용자의 시각적인 피드백을 위해서, 추가적으로 DS내 input컴포넌트에 focus속성을 추가했습니다
@@ -0,0 +1,43 @@ | |||
'use client'; |
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.
API Call 때문에 미리 클라이언트 컴포넌트로 정의한건가요?
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.
맞아요. 추가적으로 클라이언트 컴포넌트로 선언해주지 않으면 오류가 발생해서 해당 방식으로 구현했어요
onClick={() => { | ||
setIsEditing(false); | ||
onSave?.(currentValue); | ||
}} |
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.
해당 onClick은 콜백으로 넘기고, handleEditToggle는 선언하여 사용하는데 이유가 있을까요? 해당 onClick은 왜 콜백으로 구현하게 되었나요
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.
재사용되지 않고, 간단한 로직이라 생각하여 콜백으로 넘겨 구현했어요.
코드의 일관성과 가독성을 위해 선언적으로 사용하는게 더 좋아보이네요 수정했습니다 !
apps/community/src/app/my/page.tsx
Outdated
<MyInfoCardList | ||
userDetails={userDetails} | ||
userEditableDetails={userEditableDetails} | ||
/> |
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.
<MyInfoCardList
userDetails={userDetails}
userEditableDetails={userEditableDetails}
/>
userDetails
나 userEditableDetails
는 동일한 타입({ title: string; value: number | string; }
)인데요. 이를 Props로 나누지 말고 data로 넘겨서 각각 렌더링하는 방법으로 하면 더 구분감있고 이해하기 쉬운 구조라고 생각해요.
지금 처럼 props로 구분하여 한 번에 받고 한 컴포넌트로 렌더링하는 특별한 이유가 있나요?
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.
data로 넘겨서 각각 렌더링하는 방법으로 하면 더 구분감있고 이해하기 쉬운 구조라고 생각해요.
해당 의견에 동의합니다 !
기존 MyInfoCardList를 두 컴포넌트로 분리하여 수정했습니다.
<MyInfoProfileCard data={userDetails} />
<MyInfoEditableProfileCard data={userEditableDetails} />
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.
LGTM!! 수고하셨습니다~
Summary
마이페이지(회원)를 추가했습니다.
Tasks
Screenshot
전화번호, 이메일 변경 기능을 추가했습니다.
To Reviewer
컴파운드 패턴을 적용했는데 해당 부분에 대한 피드백 부탁드립니다.