Skip to content

Commit 5995ce2

Browse files
committed
[#43] ♻️ Refactoring PasswordInput props
1 parent 92e5c22 commit 5995ce2

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

src/components/common/input/PasswordInput.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,15 @@
11
import { IcEyeClosed, IcEyeOpen } from '@/assets/IconList'
2-
import { FieldValues, UseFormRegister } from 'react-hook-form'
32

43
import { useToggle } from '@/hooks/useToggle'
54

65
import { TextInput, TextInputProps } from './TextInput'
76

8-
interface PasswordInputProps
9-
extends Omit<TextInputProps, 'startAdornment' | 'endAdornment' | 'type'> {
10-
error?: boolean
11-
register?: ReturnType<UseFormRegister<FieldValues>>
12-
className?: string
13-
fullWidth?: boolean
14-
}
7+
type PasswordInputProps = Omit<
8+
TextInputProps,
9+
'startAdornment' | 'endAdornment' | 'type'
10+
>
1511

1612
export const PasswordInput = ({
17-
error = false,
18-
register,
19-
className = '',
20-
fullWidth = false,
2113
...props
2214
}: PasswordInputProps): JSX.Element => {
2315
const { isOpen: showPassword, toggle: toggleShowPassword } = useToggle()
@@ -29,9 +21,7 @@ export const PasswordInput = ({
2921

3022
return (
3123
<TextInput
32-
{...register}
3324
type={showPassword ? 'text' : 'password'}
34-
fullWidth={fullWidth}
3525
endAdornment={
3626
<button
3727
aria-label={showPassword ? '비밀번호 숨김' : '비밀번호 보임'}

0 commit comments

Comments
 (0)