forked from codeit-sprint-fullstack/3-sprint-mission-fe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
181316a
commit 39c78a9
Showing
3 changed files
with
40 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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 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 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 |
---|---|---|
@@ -1,4 +1,26 @@ | ||
export const setVisibleInput = (e) => { | ||
const pwdInput = e.target.previousElementSibling; | ||
pwdInput.type = e.target.checked ? 'text' : 'password'; | ||
const errMsgType = { | ||
email: { | ||
invalid: '이메일 형식이 올바르지 않습니다.', | ||
empty: '이메일을 입력해주세요.' | ||
}, | ||
password: { | ||
invalid: '비밀번호는 8자 이상이어야 합니다.', | ||
empty: '비밀번호를 입력해주세요.' | ||
} | ||
} | ||
|
||
export const toggleInputVisibility = (target) => { | ||
const pwdInput = target.previousElementSibling; | ||
pwdInput.type = target.checked ? 'text' : 'password'; | ||
} | ||
|
||
/** | ||
* | ||
* @param { HTMLInputElement } target | ||
*/ | ||
export const setValidationMsg = (target) => { | ||
const errMsg = target.parentElement.querySelector('.form-error-msg'); | ||
const { valid } = target.validity; | ||
console.log(valid) | ||
|
||
} |