-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 비밀번호 입력 컴포넌트 구현 * refactor: input 타입 변경 * refactor: 함수명 수정,event->e로 네이밍 변경 * refactor: 수정 사항 반영
- Loading branch information
Showing
5 changed files
with
46 additions
and
0 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
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 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,35 @@ | ||
import { ChangeEvent, ComponentPropsWithoutRef } from 'react' | ||
import { PassWord, PassWordConfirm } from '@/assets/icons' | ||
|
||
interface PasswordInputProps | ||
extends Omit<ComponentPropsWithoutRef<'input'>, 'onChange'> { | ||
type: 'password' | 'confirmation' | ||
handlePassWordChange?: (e: ChangeEvent<HTMLInputElement>) => void | ||
disabled?: boolean | ||
placeholder?: string | ||
} | ||
|
||
const PassWordInput = ({ | ||
type, | ||
placeholder, | ||
disabled, | ||
handlePassWordChange, | ||
...rest | ||
}: PasswordInputProps) => { | ||
return ( | ||
<div className="items-center2 relative flex h-fit w-fit flex-row content-center justify-center gap-2 border-2 border-black"> | ||
<input | ||
className="input border-0 bg-white pl-8 text-black" | ||
placeholder={placeholder ?? '새 비밀번호 입력'} | ||
disabled={disabled} | ||
onChange={handlePassWordChange} | ||
{...rest} | ||
/> | ||
<i className="flex items-center"> | ||
{type === 'password' ? <PassWord /> : <PassWordConfirm />} | ||
</i> | ||
</div> | ||
) | ||
} | ||
|
||
export default PassWordInput |
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