Skip to content

[이승헌] sprint10 #660

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

Open
wants to merge 42 commits into
base: Next.js-이승헌
Choose a base branch
from

Conversation

heony704
Copy link
Collaborator

@heony704 heony704 commented Jun 7, 2024

요구사항

스프린트 미션 10 Figma 디자인 확인하러 바로가기

기본

  • Github에 PR(Pull Request)을 만들어서 미션을 제출합니다.
  • 피그마 디자인에 맞게 페이지를 만들어 주세요.
  • 기존의 React, Typescript로 구현한 프로젝트와 별도로 진행합니다.
  • Next.js를 사용합니다

게시글 등록 페이지

  • 게시글 등록 페이지 주소는 “/addboard” 입니다.
  • 게시글 이미지는 최대 한개 업로드가 가능합니다.
  • 각 input의 placeholder 값을 정확히 입력해주세요.
  • 이미지를 제외하고 input 에 모든 값을 입력하면 ‘등록' 버튼이 활성화 됩니다.
  • 회원가입, 로그인 api를 사용하여 받은accessToken을 사용하여 게시물 등록을 합니다.
  • ‘등록’ 버튼을 누르면 게시물 상세 페이지로 이동합니다.

게시글 상세 페이지

  • 게시글 상세 페이지 주소는 “/boards/{id}” 입니다.
  • 댓글 input 값을 입력하면 ‘등록' 버튼이 활성화 됩니다.
  • 활성화된 ‘등록' 버튼을 누르면 댓글이 등록됩니다

주요 변경사항

  • 메인 페이지 구현
  • 게시글 상세 페이지 구현
  • 상품 상세 페이지 구현

스크린샷

🚀 배포 페이지: heony704-pandamarket-10.netlify.app/boards/11

게시글 상세 페이지

localhost_3000_boards_11

멘토에게

  • 미완성입니다 🥲

heony704 added 10 commits June 6, 2024 16:40
- import 순서 자동 정렬
- tailwindcss 클래스 순서 자동 정렬
- import alias 설정: api, hooks, components, utils
- prop 값에 따라 다른 스타일 구현
- 화면 사이즈에 따라 판다마켓 로고 이미지 다르게 표시
- 현재 주소에 해당하는 네비게이션 메뉴 파랗게 표시
- Layout 컴포넌트 구현
- App에 Layout 적용
@heony704 heony704 self-assigned this Jun 7, 2024
@heony704 heony704 added 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. 미완성🫠 죄송합니다.. labels Jun 7, 2024
@heony704 heony704 requested a review from lunaticscode June 7, 2024 14:57
@@ -0,0 +1,7 @@
import axios from 'axios';

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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> 
      <> 
    )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. 미완성🫠 죄송합니다..
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants