Skip to content

Commit

Permalink
[feat] Email Reaonly 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
JAEMOONLEE committed Nov 14, 2023
1 parent 54cbdc0 commit 2fc2df6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/Input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ interface InputProps {
error?: FieldError;
maxLength?: number;
disabled?: boolean;
readOnly?: boolean;
fixedWord?: string;
}

function Input({ placeholder, register, type, error, maxLength, disabled, fixedWord }: InputProps) {
function Input({ placeholder, register, type, error, maxLength, disabled, readOnly, fixedWord }: InputProps) {
const hasError = error && error.message;
const [isPasswordShow, setIsPasswordShow] = useState(false);
const inputType = useMemo(() => {
Expand Down Expand Up @@ -53,6 +54,7 @@ function Input({ placeholder, register, type, error, maxLength, disabled, fixedW
{...register}
onChange={handleChange}
value={inputValue}
readOnly={readOnly}
/>
<button
className="absolute inset-y-0 right-0 flex items-center mx-4 text-gray-600 h-fit pt-[12px]"
Expand Down
1 change: 1 addition & 0 deletions pages/userInfo/editProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export default function EditProfile({ _imageSrc, userInfo }: ProfileProps) {
},
})}
error={errors.email as FieldError}
readOnly
fixedWord={userInfo?.email || ''}
/>
</div>
Expand Down

0 comments on commit 2fc2df6

Please sign in to comment.