Skip to content

Commit

Permalink
remove unnecessary LimitedInput component
Browse files Browse the repository at this point in the history
  • Loading branch information
sonsurim committed Jan 21, 2024
1 parent 9a346d7 commit 7063429
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 41 deletions.
26 changes: 0 additions & 26 deletions src/components/common/LimitedInput/index.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions src/components/common/LimitedInput/types.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/components/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export * from './CommonModal'
export * from './Header'
export * from './AlertModal'
export * from './Dialog'
export * from './LimitedInput'
11 changes: 5 additions & 6 deletions src/components/shop/EditProfileModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import {
Icon,
useImageUploader
} from '@offer-ui/react'
import type { ReactElement } from 'react'
import type { ChangeEventHandler, ReactElement } from 'react'
import { useState } from 'react'
import { Styled } from './styled'
import type { EditProfileForm, EditProfileModalProps } from './types'
import { LimitedInput } from '@components/common'

const NICK_NAME_MAX_LENGTH = 20

Expand All @@ -37,8 +36,8 @@ export const EditProfileModal = ({
}
})

const handleChangeNickname = (nickname: string) => {
setProfileForm({ ...profileForm, nickname })
const handleChangeNickname: ChangeEventHandler<HTMLInputElement> = e => {
setProfileForm({ ...profileForm, nickname: e.target.value })
}
const handleClickDuplicateButton = () => {
onValidateNickname(profileForm.nickname.trim())
Expand Down Expand Up @@ -79,11 +78,11 @@ export const EditProfileModal = ({
<Text color="grayScale70" styleType="body01M" tag="p">
닉네임
</Text>
<LimitedInput
<input
maxLength={NICK_NAME_MAX_LENGTH}
placeholder="닉네임을 입력해 주세요."
value={profileForm.nickname}
onChangeValue={handleChangeNickname}
onChange={handleChangeNickname}
/>
<Text color="grayScale50" styleType="caption01M" tag="p">
{profileForm.nickname.length}/{NICK_NAME_MAX_LENGTH}
Expand Down

0 comments on commit 7063429

Please sign in to comment.