-
Notifications
You must be signed in to change notification settings - Fork 20
[김희진] sprint 10 & 11 #94
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
[김희진] sprint 10 & 11 #94
The head ref may contain hidden characters: "Next-\uAE40\uD76C\uC9C4-sprint2"
Conversation
|
스프리트 미션 하시느라 수고 많으셨어요. |
죄송합니다... 좀 많습니다🥲 UI 로직들은 이전과 동일해서 비지니스 로직들만 코드리뷰 해주시면 감사하겠습니다!괜찮습니다 !! 말씀주신대로 비즈니스 로직 위주로 리뷰할게요 ㅎㅎㅎ |
| children: React.ReactNode; | ||
| }) { | ||
| const cookie = await cookies(); | ||
| const accessToken = cookie.get("accessToken")?.value; |
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.
오호 쿠키를 서버 사이드에서 읽고 대처하셨군요 ? 👍👍
굿굿. NextJS에서 서버사이드의 활용 방법을 잘 이해하신 것으로 보여요 👍
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.
layout.tsx에 설정하신 점도 인상깊네요.
레이아웃의 nested 특징을 잘 살리셨네요. 이렇게 된다면 auth 그룹 라우팅에 해당하는 곳들은 해당 레이아웃으로 인해 인가 된 유저들을 효과적으로 구별할 수 있겠어요 👍
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.
굿굿 적절한 동적 라우팅이예요 👍👍
NextJs 라우팅을 잘 활용하고 계신데요? 😊😊
| interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> { | ||
| children: React.ReactNode; | ||
| fullWidth?: boolean; | ||
| disabled?: boolean; | ||
| className?: string; | ||
| fontSize?: FontSize; | ||
| rounded?: RoundedSize; | ||
| paddingX?: number; | ||
| paddingY?: number; | ||
| } | ||
|
|
||
| export default function Button({ | ||
| children, | ||
| fullWidth, | ||
| disabled, | ||
| className, | ||
| fontSize = "18", | ||
| rounded = "40", | ||
| paddingX, | ||
| paddingY, | ||
| ...props | ||
| }: ButtonProps) { | ||
| const fontSizeCSS: Record<FontSize, string> = { | ||
| "16": "text-semi16", | ||
| "18": "text-semi18", | ||
| "20": "text-semi20", | ||
| }; | ||
|
|
||
| const roundedCSS: Record<RoundedSize, string> = { | ||
| "8": "rounded-lg", | ||
| "40": "rounded-[40px]", | ||
| }; | ||
|
|
||
| return ( | ||
| <button | ||
| className={clsx( | ||
| "bg-blue flex w-fit items-center justify-center text-white", | ||
| disabled && "bg-gray400", | ||
| fullWidth && "w-full", | ||
| fontSize && fontSizeCSS[fontSize], | ||
| rounded && roundedCSS[rounded], | ||
| className, | ||
| )} | ||
| style={{ | ||
| paddingLeft: paddingX, | ||
| paddingRight: paddingX, | ||
| paddingTop: paddingY, | ||
| paddingBottom: paddingY, | ||
| }} | ||
| {...props} | ||
| > | ||
| {children} | ||
| </button> | ||
| ); | ||
| } |
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.
(의견) 일부 props를 className으로 대체할 수 있을 것 같아요 !
| interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> { | |
| children: React.ReactNode; | |
| fullWidth?: boolean; | |
| disabled?: boolean; | |
| className?: string; | |
| fontSize?: FontSize; | |
| rounded?: RoundedSize; | |
| paddingX?: number; | |
| paddingY?: number; | |
| } | |
| export default function Button({ | |
| children, | |
| fullWidth, | |
| disabled, | |
| className, | |
| fontSize = "18", | |
| rounded = "40", | |
| paddingX, | |
| paddingY, | |
| ...props | |
| }: ButtonProps) { | |
| const fontSizeCSS: Record<FontSize, string> = { | |
| "16": "text-semi16", | |
| "18": "text-semi18", | |
| "20": "text-semi20", | |
| }; | |
| const roundedCSS: Record<RoundedSize, string> = { | |
| "8": "rounded-lg", | |
| "40": "rounded-[40px]", | |
| }; | |
| return ( | |
| <button | |
| className={clsx( | |
| "bg-blue flex w-fit items-center justify-center text-white", | |
| disabled && "bg-gray400", | |
| fullWidth && "w-full", | |
| fontSize && fontSizeCSS[fontSize], | |
| rounded && roundedCSS[rounded], | |
| className, | |
| )} | |
| style={{ | |
| paddingLeft: paddingX, | |
| paddingRight: paddingX, | |
| paddingTop: paddingY, | |
| paddingBottom: paddingY, | |
| }} | |
| {...props} | |
| > | |
| {children} | |
| </button> | |
| ); | |
| } | |
| interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> { | |
| children: React.ReactNode; | |
| disabled?: boolean; | |
| className?: string; | |
| fontSize?: FontSize; | |
| rounded?: RoundedSize; | |
| } | |
| export default function Button({ | |
| children, | |
| disabled, | |
| className, | |
| fontSize = "18", | |
| rounded = "40", | |
| ...props | |
| }: ButtonProps) { | |
| const fontSizeCSS: Record<FontSize, string> = { | |
| "16": "text-semi16", | |
| "18": "text-semi18", | |
| "20": "text-semi20", | |
| }; | |
| const roundedCSS: Record<RoundedSize, string> = { | |
| "8": "rounded-lg", | |
| "40": "rounded-[40px]", | |
| }; | |
| return ( | |
| <button | |
| className={clsx( | |
| "bg-blue flex w-fit items-center justify-center text-white", | |
| disabled && "bg-gray400", | |
| fontSize && fontSizeCSS[fontSize], | |
| rounded && roundedCSS[rounded], | |
| className, | |
| )} | |
| {...props} | |
| > | |
| {children} | |
| </button> | |
| ); | |
| } |
padding, widthFull 등의 props를 className="w-full px-4"처럼 대체해볼 수 있어요. 😊
|
|
||
| type RoundedSize = "8" | "40"; | ||
|
|
||
| interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> { |
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.
굿굿 ~! props 타입 확장 또한 적절하군요 ! 👍
|
|
||
| const BASE_URL = process.env.NEXT_PUBLIC_BASE_URL!; | ||
|
|
||
| export function createFetchOptions({ |
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.
오호.. 엄청 고려하신게 많이 보여요.
FormData 처리, jwt expired 시 재요청 로직, Authorization 헤더 동적 삽입 등 고려해야할 요소들이 잘 녹아있네요. axios를 사용하지 않고 직접 http 클라이언트를 만드시다니, 좋은 학습 경험이 될것이라 생각합니다 👍👍
|
수고하셨습니다 희진님 !! 희진님은 이번 팀 프로젝트도 멋지게 해내실 수 있을거라 확신합니다 ! 과제 수행하시느라 정말 수고 많으셨습니다 🙇♂️🙇♂️ |
요구사항
10, 11 같이 진행했습니다!
기본
심화
주요 변경사항
스크린샷
멘토에게