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
[2단계 - 행운의 로또 미션] 파노(전환오) 미션 제출합니다 #27
Conversation
* chore: cypress 세팅 * chore: prettier 세팅 * chore: eslint 세팅 * docs: 기능 구현목록 작성 * chore: eslint rule 수정 * feat: querySelector shortcut 함수 구현 * feat: Component 부모 Class 구현 * feat: 초기 화면 구성 * chore: eslintrc lines-between-class-members: off * chore: gitignore 업데이트 * refactor: TicketView 네이밍 변경 * feat: State 단일상태관리 클래스 구현 * refactor: Component class에 default parameter 적용 * docs: 기능 구현 목록 수정 * chore: babel-eslint 설치 * test: 구입 금액을 입력받아 티켓을 생성한다. * feat: State 클래스, 반응성 구현 * feat: 구입 금액을 입력받아 티켓을 생성한다 - random.js 랜덤 숫자 생성하는 함수 생성 - lotto.js 티켓을 생성하는 함수 생성 * test: 토글 버튼을 누르면 티켓의 번호를 보여준다. * refactor: 함수 명 변경 - createTicketNumbers -> createTicket * feat: querySelectorAll 메서드 shortcut함수 구현 * test(refactor): 토글 버튼을 누르면 티켓의 번호를 보여준다 - class명 변경 * feat: 토글 버튼을 누르면 티켓의 번호를 보여준다. * test: 각 티켓은 1-45 사이의 6개 랜덤 숫자를 가진다. * refactor: Template indent 정렬 * docs: 기능 구현 목록 추가 - 공백은 입력할 수 없다. - 음수와 0은 입력할 수 없다. * test: 공백은 입력할 수 없다. * feat: 공백은 입력할 수 없다. * test: 0과 음수는 입력할 수 없다. * feat: 0과 음수는 입력할 수 없다. * style: 라인 추가 * refactor: toggle의 checked 값에 따라 css 변경 * refactor: 상수화 * feat: 초기 화면에서 toggle 버튼 제거 Co-authored-by: ddongule <mnk918p@gmail.com>
- WinningNumberInput - ResultModal
- PaymentInput -> PaymentForm - WinningNumberInput -> WinningNumberForm
- subscribeStates: 상태를 구독하는 로직이 담김
- 당첨번호 입력 시 1~45 사이의 숫자여야한다. - 당첨번호를 모두 입력해야 한다.
- 당첨번호는 중복될 수 없다. - 결과확인 전에 로또를 구매해야 한다. - 한 번 로또를 구입하면 다시 구매할 수 없다.
- 첫 화면 구입 금액 autofocus - 구입금액 입력 시 당첨번호 autofocus
> 결과확인 전에 당첨번호를 모두 입력해야 한다. > 결과확인 전에 로또를 구매해야 한다. < 결과확인 전에 구입 금액과 당첨번호를 모두 입력해야 한다.
createInput => createInputTemplate focus => focusNextInput
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2단계도 고생하셨어요! UX 까지 고민해주신게 보이네요. 편하게 로또 테스트를 해볼 수 있었습니다! 코멘트 확인 부탁드립니다~
|
||
this.setTickets($moneyAmountInput.value); | ||
|
||
$('.winning-number[name=first]').focus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UX 좋네요! 👍
|
||
if (target.value && !this.isValidRange(Number(target.value))) { | ||
alert(EXCEED_RANGE_NUMBER); | ||
target.value = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return 되면 좋을 것 같아요!
src/js/components/App.js
Outdated
this.open = new State(false); | ||
this.winningNumber = new State({ main: [], bonus: 0 }); | ||
this.result = new State({ | ||
winners: { first: 0, second: 0, third: 0, fourth: 0, fifth: 0 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요거는 배열을 썼어도 됐을 것 같은데 배열의 인덱스로 key-value 를 만든 이유가 있을까요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
생각을 해봤는데 이유가 설득력이 떨어지는 것같고 배열로도 충분히 직관적인 표현을 할 수 있을 것 같다는 생각이 들었습니다.
한 번 고쳐보겠습니다!
|
#27 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수정해주신 내용 확인했습니다! 👍 이대로 하시면 3단계도 문제 없을 것 같아요! ㅎㅎ 고생하셨어요!
어머 제가 답변했었네요 죄송합니다ㅋㅋㅋㅋㅋㅋㅋㅋㅋ |
안녕하세요 @HyeonaKwon 님
2단계 PR 드립니다. 잘 부탁드립니다.
주안점
단계
1단계 - 금액을 입력해 1000원 단위로 자동 로또를 구매합니다.
2단계 - 당첨 결과 확인 및 다시 시작 기능
3단계 - 수동 구매 + 잔액은 자동구매하기
기능 구현 목록
데모
https://jho2301.github.io/javascript-lotto/
Web VSCode 환경
https://github.surf/jho2301/javascript-lotto/tree/step2
클래스 구조도
컴포넌트 구조
디렉토리 구조