-
Notifications
You must be signed in to change notification settings - Fork 20
[유선향] -sprint9 #81
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
[유선향] -sprint9 #81
The head ref may contain hidden characters: "Next-\uC720\uC120\uD5A5-sprint9"
Conversation
[Fix] delete merged branch github action
…-sprint1 [유선향] sprint1
|
스프리트 미션 하시느라 수고 많으셨어요. |
| .env.local | ||
| .env.development.local | ||
| .env.test.local | ||
| .env.production.local |
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.
굿굿 ! 환경변수를 잘 작성하셨군요 ! 👍
.gitignore에도 추가하셨네요 잘하셨습니다 ! 👍👍
| 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"> |
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.
(의견) variant라는 props를 추가해보는건 어떨까요? BestArticles와 Articles의 차이는 "스타일"로 보여서요 !
레이아웃이 전반적으로 달라지는게 아니라 일부 스타일이 달라지는 것 같아서 조심스레 제안드려봅니다 !😉:
| 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="베스트" /> | |
| )} | |
| 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> | ||
| ); | ||
| } |
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.
해당 컴포넌트에 맞는 새로운 PropType을 작성하는건 어떨까요?:
| 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(); |
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 device: string = useWindowSize(); | |
| const device: 'mobile' | 'tablet' | 'desktop' = useWindowSize(); |
| } | ||
|
|
||
| export function SortSelect({ onChange, ...props }: Props) { | ||
| const device = useWindowSize(); | ||
| const options = ["최신순", "좋아요순"]; |
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.
options는 컴포넌트에 디펜던시가 없기에 컴포넌트 바깥에 선언하시는게 좋을 것 같아요 😊
| } | |
| export function SortSelect({ onChange, ...props }: Props) { | |
| const device = useWindowSize(); | |
| const options = ["최신순", "좋아요순"]; | |
| } | |
| const options = ["최신순", "좋아요순"]; | |
| export function SortSelect({ onChange, ...props }: Props) { | |
| const device = useWindowSize(); |
| <div | ||
| onClick={() => setIsOpen(!isOpen)} | ||
| className="h-6 bg-white border-none cursor-pointer" | ||
| > | ||
| <img src={kebabIcon} alt="케밥" /> | ||
| </div> |
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.
여긴 접근성을 위해 button을 사용해도 되겠군요 !
| <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> |
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.
오우 테일윈드를 제대로 사용하고 계시군요 !
컬러, 폰트 시스템을 config로 설정하고 사용하고 계시군요 !! 👍 라이브러리 활용력이 좋으시네요 👍👍
|
크으 ~ 정말 수고 많으셨습니다. |
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게