-
Notifications
You must be signed in to change notification settings - Fork 7
[6주차] 이정윤 / 로그인 및 회원가입 기능 구현 #80
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
base: main
Are you sure you want to change the base?
The head ref may contain hidden characters: "\uC774\uC815\uC724/6\uC8FC\uCC28"
Conversation
yezzan9
left a 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.
6주차 과제도 수고하셨습니다 !!
전체적으로 기능 구현은 잘 되어있는데 스타일코드가 정돈되어있지 않거나, 컴포넌트 재사용면에서 조금 아쉬운 것 같아요🥺 해당부분 리팩토링 진행해주시면 더 좋은 코드가 될 것 같습니다 !!
| <div style={{ minHeight: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center', background: '#fff' }}> | ||
| <div className="form-box" style={{ minWidth: 480, maxWidth: 520, background: '#f3f3f3', padding: '40px 40px', borderRadius: '12px', boxShadow: '0 2px 12px #0001' }}> | ||
| <div style={{ textAlign: 'center', fontWeight: 'bold', fontSize: '2.5rem', marginBottom: 40, letterSpacing: '-2px' }}>로그인</div> | ||
| <form onSubmit={handleLogin} style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 24 }}> | ||
| <div style={{ flex: 1, display: 'flex', flexDirection: 'column', gap: 22 }}> | ||
| <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}> | ||
| <label htmlFor="id" style={{ width: 90, fontWeight: 600, fontSize: '1.35rem', textAlign: 'right' }}>아이디</label> | ||
| <input id="id" type="text" value={id} onChange={e => setId(e.target.value)} required style={{ flex: 1, height: 40, borderRadius: 8, border: '2px solid #444', padding: '0 12px', fontSize: '1.2rem', background: '#fff' }} /> | ||
| </div> | ||
| <div style={{ display: 'flex', alignItems: 'center', gap: 12 }}> | ||
| <label htmlFor="pw" style={{ width: 90, fontWeight: 600, fontSize: '1.35rem', textAlign: 'right' }}>비밀번호</label> | ||
| <input id="pw" type="password" value={pw} onChange={e => setPw(e.target.value)} required style={{ flex: 1, height: 40, borderRadius: 8, border: '2px solid #444', padding: '0 12px', fontSize: '1.2rem', background: '#fff' }} /> | ||
| </div> | ||
| </div> |
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.
styled-components가 아닌 인라인 스타일로 구현한 이유가 있을까용?-?
인라인 스타일의 경우 가독성이 좋지 않아서 ㅠ,ㅠ styled-components를 사용하거나, 기존에 구현하신 것처럼 별도의 css파일로 분리하면 좋을 것 같아요!!
1. 무엇을?
axios를 활용해 json-server와 통신
회원가입 시 중복 아이디 확인 → 에러 메시지 표시
로그인 성공 시 localStorage에 사용자 정보 저장
로그인 유지 기능 추가 (localStorage 활용)
2. 스크린샷