[유선향] -sprint9#81
Merged
kiJu2 merged 176 commits intocodeit-bootcamp-frontend:Next-유선향from Mar 17, 2025
Hidden character warning
The head ref may contain hidden characters: "Next-\uc720\uc120\ud5a5-sprint9"
Merged
Conversation
[Fix] delete merged branch github action
…-sprint1 [유선향] sprint1
added 22 commits
March 2, 2025 23:04
Collaborator
|
스프리트 미션 하시느라 수고 많으셨어요. |
kiJu2
approved these changes
Mar 17, 2025
Comment on lines
+17
to
+20
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local |
Collaborator
There was a problem hiding this comment.
굿굿 ! 환경변수를 잘 작성하셨군요 ! 👍
.gitignore에도 추가하셨네요 잘하셨습니다 ! 👍👍
Comment on lines
+44
to
+49
| export function Articles({ article }: Props) { | ||
| const formattedDate = useFormatDate(article.createdAt); | ||
| const articleImg = article.image || ProfileImg; | ||
|
|
||
| return ( | ||
| <div className=" flex flex-col gap-4 w-full h-[138px] bg-light-gray px-6 border-b border-gray-200"> |
Collaborator
There was a problem hiding this comment.
(의견) variant라는 props를 추가해보는건 어떨까요? BestArticles와 Articles의 차이는 "스타일"로 보여서요 !
레이아웃이 전반적으로 달라지는게 아니라 일부 스타일이 달라지는 것 같아서 조심스레 제안드려봅니다 !😉:
Suggested change
| export function Articles({ article }: Props) { | |
| const formattedDate = useFormatDate(article.createdAt); | |
| const articleImg = article.image || ProfileImg; | |
| return ( | |
| <div className=" flex flex-col gap-4 w-full h-[138px] bg-light-gray px-6 border-b border-gray-200"> | |
| export default function ArticleCard({ article, variant = "normal" }: Props) { | |
| const formattedDate = useFormatDate(article.createdAt); | |
| const articleImg = article.image || DEFAULT_IMAGE; | |
| return ( | |
| <div | |
| className={`flex flex-col gap-4 px-6 rounded-lg ${ | |
| variant === "best" | |
| ? "w-[384px] h-[169px] tablet:w-full tablet:h-[198px] bg-gray-50" | |
| : "w-full h-[138px] bg-light-gray border-b border-gray-200" | |
| }`} | |
| > | |
| {variant === "best" && ( | |
| <Image className="w-[102px] h-[30px]" src={BestImage} width={102} height={30} alt="베스트" /> | |
| )} | |
Comment on lines
+116
to
+136
| export function SearchInput({ onChange, ...props }: Props) { | ||
| return ( | ||
| <div className="relative w-full"> | ||
| <input | ||
| onChange={onChange} | ||
| className=" | ||
| rounded-xl border-none px-[44px] py-[16px] w-full h-[42px] bg-gray-100 | ||
| font-Pretendard text-gray-800 text-H5Regular | ||
| placeholder:text-H5Regular placeholder:text-gray-400 | ||
| " | ||
| /> | ||
| <Image | ||
| className="absolute translate-x-0 left-4 top-1/2 -translate-y-2/4" | ||
| src={SearchIcon} | ||
| alt="검색" | ||
| width={15} | ||
| height={15} | ||
| /> | ||
| </div> | ||
| ); | ||
| } |
Collaborator
There was a problem hiding this comment.
해당 컴포넌트에 맞는 새로운 PropType을 작성하는건 어떨까요?:
Suggested change
| export function SearchInput({ onChange, ...props }: Props) { | |
| return ( | |
| <div className="relative w-full"> | |
| <input | |
| onChange={onChange} | |
| className=" | |
| rounded-xl border-none px-[44px] py-[16px] w-full h-[42px] bg-gray-100 | |
| font-Pretendard text-gray-800 text-H5Regular | |
| placeholder:text-H5Regular placeholder:text-gray-400 | |
| " | |
| /> | |
| <Image | |
| className="absolute translate-x-0 left-4 top-1/2 -translate-y-2/4" | |
| src={SearchIcon} | |
| alt="검색" | |
| width={15} | |
| height={15} | |
| /> | |
| </div> | |
| ); | |
| } | |
| export function SearchInput({ onChange }: { onChange: (e: ChangeEvent<HTMLInputElement>) => void }) { | |
| return ( | |
| <div className="relative w-full"> | |
| <input | |
| onChange={onChange} | |
| className=" | |
| rounded-xl border-none px-[44px] py-[16px] w-full h-[42px] bg-gray-100 | |
| font-Pretendard text-gray-800 text-H5Regular | |
| placeholder:text-H5Regular placeholder:text-gray-400 | |
| " | |
| /> | |
| <Image | |
| className="absolute translate-x-0 left-4 top-1/2 -translate-y-2/4" | |
| src={SearchIcon} | |
| alt="검색" | |
| width={15} | |
| height={15} | |
| /> | |
| </div> | |
| ); | |
| } |
현재 나머지 props도(...props) 사용하지 않는 것 같고 onChange만 사용하는 것으로 보여요. 별개의 프롭 타입을 정의하는게 어떨까요?
| import Image from "next/image"; | ||
| import useWindowSize from "@/hooks/useWindowSize"; | ||
| export default function Nav() { | ||
| const device: string = useWindowSize(); |
Collaborator
There was a problem hiding this comment.
크으 ~ 디바이스 사이즈를 커스텀 훅으로 만드셨군요 👍
좋은 방법입니다 ! 그러나 타입을 좀 더 구체적으로 작성해볼 수 있겠네요 !:
Suggested change
| const device: string = useWindowSize(); | |
| const device: 'mobile' | 'tablet' | 'desktop' = useWindowSize(); |
Comment on lines
+11
to
+15
| } | ||
|
|
||
| export function SortSelect({ onChange, ...props }: Props) { | ||
| const device = useWindowSize(); | ||
| const options = ["최신순", "좋아요순"]; |
Collaborator
There was a problem hiding this comment.
options는 컴포넌트에 디펜던시가 없기에 컴포넌트 바깥에 선언하시는게 좋을 것 같아요 😊
Suggested change
| } | |
| export function SortSelect({ onChange, ...props }: Props) { | |
| const device = useWindowSize(); | |
| const options = ["최신순", "좋아요순"]; | |
| } | |
| const options = ["최신순", "좋아요순"]; | |
| export function SortSelect({ onChange, ...props }: Props) { | |
| const device = useWindowSize(); |
Comment on lines
+79
to
+84
| <div | ||
| onClick={() => setIsOpen(!isOpen)} | ||
| className="h-6 bg-white border-none cursor-pointer" | ||
| > | ||
| <img src={kebabIcon} alt="케밥" /> | ||
| </div> |
Collaborator
There was a problem hiding this comment.
여긴 접근성을 위해 button을 사용해도 되겠군요 !
Suggested change
| <div | |
| onClick={() => setIsOpen(!isOpen)} | |
| className="h-6 bg-white border-none cursor-pointer" | |
| > | |
| <img src={kebabIcon} alt="케밥" /> | |
| </div> | |
| <button | |
| type="button" | |
| onClick={() => setIsOpen(!isOpen)} | |
| className="h-6 bg-white border-none cursor-pointer" | |
| > | |
| <img src={kebabIcon} alt="케밥" /> | |
| </button> |
Collaborator
There was a problem hiding this comment.
오우 테일윈드를 제대로 사용하고 계시군요 !
컬러, 폰트 시스템을 config로 설정하고 사용하고 계시군요 !! 👍 라이브러리 활용력이 좋으시네요 👍👍
Collaborator
|
크으 ~ 정말 수고 많으셨습니다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게