-
Notifications
You must be signed in to change notification settings - Fork 2
20260304 fe #255 about mypage #295
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ce915dd
[FE][FIX]myPage design
yyunee 29a6298
[FEAT] profileEditModal
yyunee 1994b19
[FIX] Connecting userPointsHistoryApi
yyunee 8e4747d
[FEAT] Connecting myPageMenuAPI
yyunee ed6b824
[FIX] rabbit review
yyunee 7c3930d
[FIX] undefined error
yyunee c4bf624
[FIX] About Rabbit review
yyunee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| import { useState, useEffect } from 'react'; | ||
| import styles from './EditProfileModal.module.css'; | ||
|
|
||
| const passwordPolicy = [ | ||
| { label: '8~20자 이내', test: (pw) => pw.length >= 8 && pw.length <= 20 }, | ||
| { label: '최소 1개의 대문자 포함', test: (pw) => /[A-Z]/.test(pw) }, | ||
| { label: '최소 1개의 소문자 포함', test: (pw) => /[a-z]/.test(pw) }, | ||
| { label: '최소 1개의 숫자 포함', test: (pw) => /[0-9]/.test(pw) }, | ||
| { label: '최소 1개의 특수문자 포함', test: (pw) => /[\W_]/.test(pw) }, | ||
| ]; | ||
|
|
||
| export default function ChangeInfoForm({ onValidChange }) { | ||
| const [currentPassword, setCurrentPassword] = useState(''); | ||
| const [newPassword, setNewPassword] = useState(''); | ||
| const [confirmPassword, setConfirmPassword] = useState(''); | ||
|
|
||
| const passwordValid = passwordPolicy.every((p) => p.test(newPassword)); | ||
|
|
||
| const isValid = | ||
| currentPassword && passwordValid && newPassword === confirmPassword; | ||
|
|
||
| useEffect(() => { | ||
| onValidChange( | ||
| isValid | ||
| ? { | ||
| currentPassword, | ||
| newPassword, | ||
| } | ||
| : null | ||
| ); | ||
| }, [isValid, currentPassword, newPassword, onValidChange]); | ||
|
|
||
| return ( | ||
| <div className={styles.modalContent}> | ||
| <div className={styles.inputGroup}> | ||
| <label className={styles.label}>현재 비밀번호</label> | ||
|
|
||
| <input | ||
| className={styles.codeInput} | ||
| type="password" | ||
| value={currentPassword} | ||
| onChange={(e) => setCurrentPassword(e.target.value)} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className={styles.inputGroup}> | ||
| <label className={styles.label}>새 비밀번호</label> | ||
|
|
||
| <input | ||
| className={styles.codeInput} | ||
| type="password" | ||
| value={newPassword} | ||
| onChange={(e) => setNewPassword(e.target.value)} | ||
| /> | ||
| </div> | ||
|
|
||
| <div className={styles.inputGroup}> | ||
| <label className={styles.label}>비밀번호 확인</label> | ||
|
|
||
| <input | ||
| className={styles.codeInput} | ||
| type="password" | ||
| value={confirmPassword} | ||
| onChange={(e) => setConfirmPassword(e.target.value)} | ||
| /> | ||
| </div> | ||
|
|
||
| <div> | ||
| {passwordPolicy.map((rule, index) => ( | ||
| <p key={index}> | ||
| {rule.test(newPassword) ? '✅' : '❌'} {rule.label} | ||
| </p> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.