Skip to content
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

[#8] 회원가입, 로그인 페이지 레이아웃 #27

Merged
merged 31 commits into from
Jan 15, 2024
Merged

Conversation

dabin-Hailey
Copy link
Collaborator

close #8

Description

완료 작업

  • 푸터 레이아웃 (기능이 없는 공용 컴포넌트)
  • 회원가입 페이지 레이아웃
  • 로그인 페이지 레이아웃
  • login & signup 타입 파일 생성 및 분리

수정 예정

  • 모바일 환경을 고려하여 작업하지 않았습니다. 모바일 시안 나오면 적용할 예정입니다. (px만 적용, % 미적용 상태)
  • 스타일테마(컬러 팔레트) 사용하지 않고 hex값으로 작업했습니다. 추후 스타일테마 결정되면 수정 예정입니다.

예정 작업

  • 데이터 유효성에 따라 변화하는 input과 button
    • 유효성 체크 아이콘이 있는 input 제작
    • 비밀번호 미리 보기/숨기기 아이콘이 있는 input 제작

유의할 점 및 ETC (Optional)

To. @JitHoon
로그인/회원가입 제외한 전체 페이지 Layout > outlet에 푸터 추가 부탁드립니다.

스크린샷 (Optional)

로그인 페이지

로그인 작업물

유효성 메세지가 포함된 로그인 페이지

로그인 유효성

회원가입 페이지

회원가입 작업물

유효성 메세지가 포함된 회원가입 페이지

회원가입 유효성 표시

Copy link

vercel bot commented Jan 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cool-peace ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2024 8:00am
cool-peace-dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 15, 2024 8:00am

Copy link
Collaborator

@JitHoon JitHoon left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

Comment on lines 1 to 2
import Login from '@pages/Login';
import SignUp from '@pages/SignUp';
Copy link
Collaborator

Choose a reason for hiding this comment

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

제가 이 부분 import 컨벤션을 적용하지 못했네요 😅

혹시 아래와 같이 수정 부탁드려도 될까요?

import { Route, Routes } from 'react-router-dom';

import { Layout } from '@components/common';
import Login from '@pages/Login';
import SignUp from '@pages/SignUp';
import Dashboard from '@pages/Dashboard.tsx';
import Report from '@pages/Report.tsx';

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

감사합니다~ 반영하였습니다! 0c678d9


const Container = styled.div`
max-width: 524px;
height: calc(100% - 36px - 100px);
Copy link
Collaborator

Choose a reason for hiding this comment

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

오 저도 전체 너비에서 기존 컨텐츠 값을 지우고 싶었는데 이렇게 쓰면 되군요,,

36px, 100px 의 경우 변동될 수 있으니 const로 빼고 emotion props로 받아서 사용하면 편할 것 같습니다!

지금은 레이아웃이 자주 바뀌니 나중에 리팩토링할 때 하면 좋을 것 같네욥

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

36px은 회원가입 페이지의 로고의 높이고, 100px은 푸터의 높이입니다!

변동되는 값에 대비해 변수로 만드는 것도 좋지만, 생각해보니 저 값들이 어떤 걸 의미하는지는 저만 알게 작업했던 것같기도 하네요 😅

가독성을 높이기 위해서라도 변수로 만들어 사용하도록 수정하였습니다! 5b8e095

Comment on lines 1 to 2
import styled from '@emotion/styled';
import { SignUpDisabledButton, SignUpInputValidation } from '@/types/signUp';
Copy link
Collaborator

Choose a reason for hiding this comment

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

외부 라이브러리, 내부 폴더 import 사이 개행이 필요한 것 같습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

감사합니다~ 수정했습니다!! 0c678d9

Comment on lines 11 to 12
const isEmailValidationButtonDisabled = true;
const isSubmitButtonDisabled = true;
Copy link
Collaborator

Choose a reason for hiding this comment

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

이름에서 Button을 빼도 button 이름이 있는 컴포넌트에서 사용되기 때문에, 의미 전달은 잘 될 것 같습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

감사합니다~ Button이라는 텍스트를 제거하여 수정했습니다! 772c1b3

Comment on lines +16 to +29
<InputLabelWrapper>
<Label htmlFor="user_name">이름</Label>
<Input
type="text"
id="user_name"
placeholder="이름 입력"
required
/>
{isInvalid && (
<ValidationText $isInvalid={isInvalid}>
이름을 입력해 주세요.
</ValidationText>
)}
</InputLabelWrapper>
Copy link
Collaborator

Choose a reason for hiding this comment

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

향후 react-hook-form을 사용하게 되면 input 상태를 한번에 관리할 수 있을 것 같은데, 입력 받는 주제 단위로 컴포넌트를 Name, Email, Password로 분리해도 좋을 것 같다는 생각이 듭니다!

react-hook-form 사용하실 때 분리하여 작업하는게 불편하다면 무시하셔도 상관없습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

우선 이번 PR 이후 로그인/회원가입 화면에서 사용할 공통 input 컴포넌트를 만들 예정이긴 했습니다!

제안주신 Name, Email, Password로 컴포넌트를 분리해서 만드는 것은 react-hook-form 사용하기 전에 다시 한번 고려해보겠습니다..!


const EmailInputWrapper = styled.div`
display: flex;
flex-direction: row;
Copy link
Collaborator

Choose a reason for hiding this comment

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

default 값이 row라서 따로 명시하지 않아도 되는걸로 알고 있습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

감사합니다~ 수정했습니다! e1a46e3

Comment on lines +21 to +23
<ValidationText>
<ValidationBoldText>아이디</ValidationBoldText>를 입력해 주세요
</ValidationText>
Copy link
Collaborator

Choose a reason for hiding this comment

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

ValidationText 에 font-weight: 700;를 바로 주지 않고 따로 스타일 컴포넌트로 뺀 이유가 궁금합니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

피그마에서 자세히 살펴보니 유효성 메세지 중 아이디에 대해서만 bold 처리를 해두셨더라구요...! (착한 사람눈엔 보입니다..👀)

스크린샷 2024-01-12 오후 10 24 33

font-weight: 500;
line-height: 32px;

::placeholder {
Copy link
Collaborator

Choose a reason for hiding this comment

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

&::placeholder {}

와의 차이점이 궁금합니다!

제가 &를 넣어서 썼던 이유는 스타일드 컴포넌트 공식 홈페이지에서 예시를 보고 따라서 쓰고있습니다!

아래는 공홈 예시입니다.

const Button = styled.a<{ $primary?: boolean; }>`
  --accent-color: white;


  /* This renders the buttons above... Edit me! */
  background: transparent;
  border-radius: 3px;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  display: inline-block;
  margin: 0.5rem 1rem;
  padding: 0.5rem 0;
  transition: all 200ms ease-in-out;
  width: 11rem;


  &:hover {
    filter: brightness(0.85);
  }


  &:active {
    filter: brightness(1);
  }


  /* The GitHub button is a primary button
   * edit this to target it specifically! */
  ${props => props.$primary && css`
    background: var(--accent-color);
    color: black;
  `}
`

`
``

Copy link
Collaborator

Choose a reason for hiding this comment

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

둘다 코드의 동작은 같지만, &키워드는 현재 선택된 요소 자체를 나타낸다고 하네요!
저도 보통 &사용하고 있습니다 ㅎ

Copy link
Collaborator Author

@dabin-Hailey dabin-Hailey Jan 12, 2024

Choose a reason for hiding this comment

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

결론부터 말씀드리자면 지훈님이 말씀해주신 방법으로 작성하는 것이 더 좋습니다.
&가 css 연산자로서 동작하기 때문에 특정 요소에 대해서만 스타일을 지정할 수 있어 명확하게 스타일을 지정할 수 있습니다.

::placeholder를 쓴 이유는 제가 깊게 생각하지 않고 습관적으로 작성했기 때문입니다…🥲

1a9d264 수정했습니다!

}
`;

const SignUpButton = styled(LoginButton)<ButtonText>``;
Copy link
Collaborator

Choose a reason for hiding this comment

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

향후 스타일이 들어가는 부분인지 궁금합니다!

스타일이 없다면, 그대로 사용해도 괜찮지 않을까 싶습니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

지난번 지훈님 레이아웃 코드에서 제가 질문했던 것과 비슷한 상황이어서 저도 어떻게 해야될까 고민이 많았었는데요 😅

styled로 만든 컴포넌트의 이름이 LoginButton이라 로그인/회원가입 버튼을 모두 해당 컴포넌트로 작성하면
컴포넌트 이름만 보았을 때 각 버튼이 어떤 역할을 하는지 명확하게 파악할 수 없다고 생각하여 따로 만들었습니다.

컴포넌트명을 Button으로 변경하면 로그인/회원가입에 모두 적용할 수 있을 것같은데 이 방법이 더 나을까요?
�항상 이름짓는게 가장 어렵더라구요...🥲 좋은 아이디어 있으면 부탁드립니다! 항상 환영해요..!!

Copy link
Collaborator

Choose a reason for hiding this comment

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

그때 이야기 되었던 컨벤션은 스타일이 없을 때 태그 그대로 사용하기로 한걸로 기억합니다!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넵! Button으로 이름 통일하면서 수정하였습니다~ a74ad1e

Copy link
Collaborator

@turkey-kim turkey-kim left a comment

Choose a reason for hiding this comment

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

깔끔하게 정갈된 코드 잘봤습니다 ㅎ

Copy link
Member

@jiohjung98 jiohjung98 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다 태그도 줄바꿈 다 잘 맞추셔서 구현하셨네요 고생많으셨어요 !

Copy link
Collaborator

@jinjoo-jung jinjoo-jung left a comment

Choose a reason for hiding this comment

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

컨벤션도 잘 지켜주시고 타입도 잘 분리해주신 것 같습니다. 수고하셨어요 ! 👍🏻🤗

Copy link
Collaborator

@ovoxiix ovoxiix left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!
근데 막상 화면에서 보니까 UI가 생각보다 큼지막하네요..? ㅋ ㅋ ㅋ ㅋ

const Title = styled.h1`
color: #1a2849;
font-size: 44.374px;
font-weight: 900;
Copy link
Collaborator

Choose a reason for hiding this comment

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

폰트 굵기 500이랑 700만 있는줄알았는데..! 300이랑 900도 추가해두겠습니다.

Comment on lines +108 to +109
? '#1A2849'
: 'linear-gradient(91deg, #FF3478 1.39%, #FF83AD 98.63%)'};
Copy link
Collaborator

Choose a reason for hiding this comment

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

요기만 왜 hex 코드가 소문자로 포맷팅이 안됐을까요? 그냥 궁금증..

<BoldText>개인정보 처리방침</BoldText>
</Policy>
<Copyright>
(주) 야놀자 Copyright © 2005-2023 Yanolja Co., Ltd. All rights
Copy link
Collaborator

Choose a reason for hiding this comment

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

2023은 getFullYear()로 올해 년도를 받아오는 방식으로 작성해도 좋을 것 같아요.
아니면 2023으로 고정인가요?!

Copy link
Collaborator Author

@dabin-Hailey dabin-Hailey Jan 15, 2024

Choose a reason for hiding this comment

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

피그마에 있는대로 복붙해오다 보니까 그렇게 작업된 것같습니다!
getFullYear()사용하는 걸로 수정했습니다! 36fa8a5

const Text = styled.p`
color: #404446;
font-size: 12px;
font-weight: 400;
Copy link
Collaborator

Choose a reason for hiding this comment

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

400도 있나요... 그냥 폰트 굵기 싹 다 추가하겠습니다😅

@dabin-Hailey
Copy link
Collaborator Author

수고하셨습니다! 근데 막상 화면에서 보니까 UI가 생각보다 큼지막하네요..? ㅋ ㅋ ㅋ ㅋ

그쳐 ㅋㅋㅋㅋㅋㅋ 저도 만들면서 이게 맞나 싶었습니다...
일단 저는 피그마 그대로 작업하긴 했고, 모바일 하면서 좀 더 조정해보려고 합니당

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design 스타일
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[design] 로그인,회원가입 페이지 레이아웃
6 participants