Giter VIP home page Giter VIP logo

home-quiz-manage-reservations's Introduction

Home Quiz - Manage Reservations

최종 구현 화면

conclusions

데모

https://manage-reservations.netlify.app/

사용 패키지

React, Vite, TypeScript, Tailwind CSS, React Router, React Datepicker

주안점

1. 페이지 분할

React Router를 이용해 예약 리스트, 예약 만들기, 날짜 고르기, 예약 수정하기 페이지로 분할했습니다.

루트 컴포넌트의 하위 route로 구성하여 상대 경로로 페이지 전환이 일어나도록 구현했습니다. 모달을 오픈하면 경로에 해당하는 페이지가 열립니다.

2. 상태 관리

Context APIuseReducer를 조합하여 페이지 간의 상태를 공유하며 관리했습니다.

새로운 예약을 추가하거나 기존 예약을 수정하면 변경 사항이 예약 리스트 context에 반영되어 상태가 유지됩니다.

예약 카드를 삭제하면 예약 리스트 수가 줄어들어 메인 타이틀 옆의 숫자가 줄어듭니다.

Seated를 틀릭하면 화면에는 보이지 않지만 context에는 남아 있어 숫자가 줄어들지 않습니다.

예약 만들기예약 수정 역시 context로 관리하지만 페이지를 벗어나면 초깃값으로 재할당됩니다.

3. React Datepicker 라이브러리 사용

input의 속성만으로 스타일링과 기능 구현이 원활하지 않아 React Datepicker 라이브러리를 사용했습니다.

선택의 이유는 주간 다운로드 수가 일정하고 문서만 보고도 커스텀이 쉬웠기 때문입니다.

느낀점

  1. 스타일링에 많은 시간을 할애해 코드 정리가 되지 않은 부분이 아쉽습니다. 제출 이후 복기하면서 정리할 예정입니다.
  2. 몇 가지 기능을 처음 사용해 보면서 시야가 확장되는 즐거움을 얻었습니다. 재미있는 과제를 내주셔서 감사합니다.

home-quiz-manage-reservations's People

Contributors

real-bird avatar

Watchers

 avatar

home-quiz-manage-reservations's Issues

component/reservation

  • select date : 시간 설정 가능한 컴포넌트
  • modal header : title을 포함한 children을 받는 header
  • card : 예약 내용이 담긴 카드
  • new & edit : 새로 생성하면 값이 없는 빈 편집 페이지, 있으면 값 넣어은 편집 페이지

needed features

  • 필요한 reservation state 속성
    • id
    • 이름
    • 폰넘버 : 유효성 검사(숫자만 입력, 3,4,4 사이에 -추가)
    • 예약 날짜
    • 예약 테이블 번호
    • 예약 층수
    • 예약 인원 수 (0이하로 안 내려가게)
    • 노트 내용
    • 앉았는지 여부
  • 전체 예약 목록 context
  • 새 예약 등록 context
  • 기존 예약 수정 context

feature/routes

  • Outlet 이용해 App에 하위 route로 각 페이지 렌더링
  • New Reservation 클릭 시 /register로 푸시
  • Card 클릭 시 /edit으로 푸시
  • X 클릭 시 페이지 닫고 /으로 푸시
  • Backspace 클릭 시 이전 페이지로 푸시
  • register or edit에서 select date 클릭 시 /date로 푸시
  • date에서 휴지통 or save 클릭 시 이전 페이지로 푸시

component/common

  • Layout : 빈 페이지 레이아웃
  • button : 아이콘과 라벨을 포함하는 버튼
    • bgColorReverse 여부에 따라 폰트, 배경색 반전
  • input : 값 입력 시 placeholder가 floating되는 형태
  • textarea : edit svg가 포커스 아닐 시 placeholder와 value 뒤에 따가라도록
    • 토글로 변경할 것
  • select table : 라벨과 id만 가진 item list를 prop으로 받고 클릭 시 select에 보여줌
    • 추가된 item badge를 클릭하면 목록에서 제거됨
  • #3
    • 시간 선택 input과 개별 시간 선택 옵션은 상태 공유

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.