[Side Project] 스타일 작업 및 기능 추가 - 스타일 작업

박경수·2023년 4월 7일
0

side project

목록 보기
6/7

추가 작업 사항

기간 : 하루

  1. 공통 style-component 작성.
    • input, button, title 영역
  2. 회원가입, 로그인, 마이페이지 스타일 추가
  3. 마이 페이지 pagination 구현

설명

회원가입 및 로그인과 마이페이지는 기능만 만들고 스타일은 전혀 입히지 않았다.
고로, 이 녀석들에게 이쁨(?)을 만들어 주기로 했다.

방법

styled-component용 폴더를 생성하여 공통으로 사용할 스타일 작성하고
import, export로 사용한다.

공통 스타일 컴포넌트

폴더 구조

컴포넌트 작성할때 최상위는 캡쳐와 같은 구조로 잡는다.

components : Html, style 그리고 props 삽입.
components/styledComponents/braStyled.tsx : ㅇㅇㅇStyled.tsx로 스타일 작성.
containers : 상태관리(Redux, useState, ...) 및 JS 코드를 이용한 작업.

000Styled.tsx

사용할 스타일을 정의export 하고, 불러오면import하면 끝 이다.

스타일

styled-component를 처음 사용하기 때문에, 코드가 이쁘진 않다.

Button : disabled일때, 따로 스타일을 부여했다.
Input : check라는 인자를 받아 해당 값의 길이(텍스트 유무)에 따라 스타일을 다르게 주도록 했다.

스타일 추가

설명

설명은 기능이 아닌, 스타일에 대해서만 이야기한다.

InputFormWrapinputlabel을 감싸는 형태로 작업했기 때문에,
inputlabel<InputForm.InputFormWrap>로 감싸준다.

check라는 인자를 생성하고 해당 인자에는 유저의 id를 받도록 했다.

form.userIdonChange메소드가 실행 될 때 마다 변경된다. 그래서 input에 값의 유무를 판단해 style을 선언 할 수 있던것이다.

버튼은 간단하기 때문에 설명은 생략한다.

결과물

회원가입 및 로그인

완료

마무리

포스팅 내용이 너무 길어, 마이페이지 는 다음 포스트에 이어서 설명 하겠다.

끝.

profile
<>{...}</>

1개의 댓글

comment-user-thumbnail
2023년 7월 20일

Most people get into a marriage with high and full spirits. They know full well what they are getting into and accept this with an open heart. While you may say that there is a lot of hype in marriages especially on the days leading up to the wedding day, it can get a bit frustrating to have a misunderstanding in your relationship. I have been through hell with my husband for a very long time. With the help of the great spell caster, I was able to resolve my marriage issue and now I finally find happiness in my marriage. For anyone going through any kind of relationship issue or you like to get back with your ex, I will suggest getting in touch with the best relationship advice specialist that will bring happiness back into your home. You can get in touch with The Great Dr.Jumba relationship and affair advisor on WhatsApp: +27723955865 or wiccalovespelltools@gmail.com . He is always ready to help people and bring back happiness into your life.

Website : https://drjumbaspellhome.wordpress.com

Vanny Carl .
From Austin Texas

답글 달기