[이승헌] sprint10#660
Open
heony704 wants to merge 42 commits intocodeit-bootcamp-frontend:Next.js-이승헌from
Hidden character warning
The head ref may contain hidden characters: "Next.js-\uc774\uc2b9\ud5cc-sprint10"
Open
Conversation
added 10 commits
June 6, 2024 16:40
- import 순서 자동 정렬 - tailwindcss 클래스 순서 자동 정렬 - import alias 설정: api, hooks, components, utils
- prop 값에 따라 다른 스타일 구현
- 화면 사이즈에 따라 판다마켓 로고 이미지 다르게 표시 - 현재 주소에 해당하는 네비게이션 메뉴 파랗게 표시
- Layout 컴포넌트 구현 - App에 Layout 적용
added 16 commits
June 8, 2024 00:47
- axios 설치 - apis 폴더 alias 설정 - apis import 자동 정렬 적용 - base url 설정
- path가 /boards, /boards/숫자, /addboard 일 때 자유게시판 표시 - path가 /products, /products/숫자 일 때 중고마켓 표시
- main 태그를 레이아웃으로 옮겨서 div 태그 사용 줄임 - 홈페이지, 로그인/회원가입 페이지, 그 외 페이지 각각 다른 레이아웃 적용 - 로그인/회원가입 페이지 레이아웃 UI 구현
- 기존 Header 컴포넌트는 MainHeader로 이름 수정 - 로그인/회원가입의 헤더는 LogoHeader라는 이름의 컴포넌트로 분리 - 둘 다 헤더이기 때문에 둘 다 같은 레벨인 컴포넌트로 만듦
- 기존 룰로는 types 폴더 안 파일들에게 alias를 적용할 수 없음 - 룰 변경: @ => @/ - import order에 types 폴더도 추가
| @@ -0,0 +1,7 @@ | |||
| import axios from 'axios'; | |||
|
|
|||
Collaborator
There was a problem hiding this comment.
axios.defaults.baseURL = "https://panda";
axios.defaults.headers.common['Content-Type'] = "application/json";
axios.defaults.timeout = 5000;
const instance = axios.create();
// [Client] ------ [interceptor] --------> [Server]
instance.interceptors.request.use( req => { }, err => { } );
// [Client] <------ [interceptor] -------- [Server]
instance.interceptors.response.use( res => { }, erro => { } );| onClick: MouseEventHandler<HTMLButtonElement>; | ||
| children: ReactNode; | ||
| }; | ||
|
|
Collaborator
There was a problem hiding this comment.
Button, Input 같이 최소 단위 컴포넌트 같은 경우, 보통 forwardRef 적용을 많이 합니다.
이유는 해당 tag의 native 이벤트(클릭, 포커스, 블러 등)를 컴포넌트 외부에서도 조정할 수 있게 끔 하기 위해서입니다.
interface ButtonProps extends PropsWithChildren {};
const Button = forwardRef<HTMLButtonElement, ButtonProps>( (props, ref) => {
const {children} = props;
return (
<button ref={ref}>{children}</button>
)
})
// ./page or ./component
const DummyComponent= () => {
const buttonRef = useRef<HTMLButtonElement>(null);
const hanldeClickTrigger = () => {
buttonRef.current?.click();
}
return (
<>
<Button ref={buttonRef} onClick={() => console.log("cliced by trigger-button")} />
<button onClick={hanldeClickTrigger}>trigger-button</button>
<>
)
}
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.
요구사항
스프린트 미션 10 Figma 디자인 확인하러 바로가기
기본
게시글 등록 페이지
게시글 상세 페이지
주요 변경사항
스크린샷
🚀 배포 페이지: heony704-pandamarket-10.netlify.app/boards/11
게시글 상세 페이지
멘토에게