Skip to content

[박상우] 과제 제출#7

Open
coolfin wants to merge 26 commits into
SSA-FE:mainfrom
coolfin:main
Open

[박상우] 과제 제출#7
coolfin wants to merge 26 commits into
SSA-FE:mainfrom
coolfin:main

Conversation

@coolfin

@coolfin coolfin commented Feb 27, 2024

Copy link
Copy Markdown

👻 주요 기능

배포 링크

  • form을 이용한 회원가입 form 구성
  • react-router-dom을 이용한 라우팅
  • tailwindCSS를 활용한 동적 스타일링



🏳️ 새로 알게 된 점 / 어려웠던 점

  • react-router-dom v6
    • createBrowserRouter을 활용해 루트(최상위) 컴포넌트에서 어떻게 이동할지 정의해 놓을 수 있다.
    • 해당 프로젝트에서는 사용되지 않았으나 path에서 dynamic routingpath: 'user/:userId' 처럼 사용할 수 있다.
  • react-hook-form
    • form을 편리하게 관리, 사용할 수 있었다.
    • useForm()의 다양한 옵션에서 어떤 것을 선택할지 공부하는 것에 시간이 꽤 걸렸다.
    • watch와 getValues의 차이에 대해 알게되었다. (값 변화에 대한 리렌더링 여부)
  • vercel
    • 한 번 프로덕트로 올리고 새로 redeploy를 할 때 페이지 폴더의 대소문자가 변경되면 캐싱돼있던 페이지와 충돌이 일어난다.
    • 서버를 닫았다 열어서 이를 해결했다.

- import font Inter
- Nav 구현
- react-router-dom v6.4+
- createBrowserRouter에 정보 정의
- App.jsx 삭제
- main태그 layout 컴포넌트 정의하여 변경
- style 비율 변경
- router 최상단으로 구조 변경
- Nav 로고 클릭 시 메인화면으로 라우팅
- router 구조 변경
-적용 안되던 font 수정
-css 순서 변경
-main page style ratio로 변경
- 기능을 제외한 회원가입 페이지 구현
- input 모은 뒤 form 이용해서 react-hook-form 적용
- refactor 진행해야 함(*)
- error message field 확보해야 함(*)
- label, errormessage 컴포넌트화
- input type 별 정규식 설정
- navigate로 페이지 이동
- input field 컴포넌트화
- 쓰지 않는 디렉토리 및 파일 정리
- 회원가입 버튼 색상 조건 변경
- 특수문자 범위 제한(입력값의 예외 걸러내기 위함)

@kwakseongjae kwakseongjae left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

훌륭하다 녀석아 ,,
Next에 익숙해진다고 React를 아예 놔도 되는건 아니니까 React에서 사용하는 컨벤션이나 구조 등에도 계속 익숙해지려 노력해보자 !!

Comment thread public/manifest.json

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

오호 여기까지 ..!
👍👍

Comment thread src/components/InputField/index.jsx Outdated
)}>
<LabelInfo children={'비밀번호'} />
<div className='relative'>
<input type={isPasswordVisible ? "text" : "password"} className={classNames(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍👍

Comment thread src/components/InputField/index.jsx Outdated
required: true,
pattern: {
value: /^(?=.*[A-Za-z])(?=.*\d)(?=.*[@$!])[A-Za-z\d@$!%*#?&]{8,16}$/,
message: "비밀번호는 8자 이상 16자 이하, 하나 이상의 영문자와 숫자, @, #, ! 중 하나 이상의 특수문자로 구성되어야 합니다."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

message를 일일이 입력하기보단
나는 파일을 따로 만들어서 관리하는 편이야

다음 아티클을 보면 조금 도움이 될거야 !
https://semaphoreci.com/blog/constants-layer-javascript

Comment thread src/components/SignupButton/index.jsx Outdated
import classNames from 'classnames';

export const SignupButton = () => {
return (<div

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

너는 왜 포매터가 없니 ,,

Comment thread src/index.jsx
Comment on lines +10 to +17
const router = createBrowserRouter(routerInfo);

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<Fragment>
<RouterProvider router={router} />
</Fragment>
);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍👍
나도 이렇게 적용하려 했는데 App 파일은 경유해보고 싶어서 다른 방식으로 작업했었거든 !
어느 방식이 좋다 나쁘다는 없겠지만 한번 두개를 비교해서 너한테 맞는걸로 가져가봐 !

우리 프로젝트 리포지토리 ! dev 브랜치에서 보면돼 !
https://github.com/SSA-FE/formssafe-fe

Comment thread src/layout/Container/index.jsx Outdated
Comment on lines +8 to +9
marginLeft: 'auto',
marginRight: 'auto',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

이렇게 작성한거랑
margin: 0 auto
랑 결과가 다르진 않을거같은데 ??

Comment thread src/pages/Register/index.jsx Outdated

const onSubmit = (data) => {
const { email, password } = data;
console.log(errors)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

콘솔에 찍어보셨으면 이제 빼셔야죠 !

Comment thread src/pages/Register/index.jsx Outdated

'rounded-full',

watch('email') && watch('password') && watch('passwordConfirm') && !errors.email && !errors.password && !errors.passwordConfirm ? 'bg-theme cursor-pointer hover:bg-opacity-80' : 'bg-[#d4d4d4]',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

가독성이 심상치 않네 ..
다른 방법으로 구현할 순 없을까 ?

Comment thread src/reset.css Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

이 아티클 한번 읽어봐 !!
https://www.daleseo.com/tailwind-preflight/

- styled-components 삭제
- tailwindCSS layer utility로 변경
- tailwindCSS preflight 적용에 따른 reset.css 삭제

- 이미지 png -> svg로 변경 후 fill로 색상 조정
- 재사용성이 떨어지는 컴포넌트 삭제 후 포맷팅
- 메시지, 정규표현식 constant 폴더에 변수로 저장 후 import
@coolfin

coolfin commented Feb 28, 2024

Copy link
Copy Markdown
Author

어제 나온 내용들이랑 위에 성재형이 리뷰해 준 내용 확인하고 리팩토링 했습니다!! 리뷰할 때 참고해주세용👻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants