refactor: QInput, QSelect 컴포넌트 내 div 제거

This commit is contained in:
Daseul Kim 2024-10-08 18:15:33 +09:00
parent 8c16562292
commit a192c66c39
2 changed files with 34 additions and 46 deletions

View File

@ -41,9 +41,7 @@ export default function QInput({ type, readOnly = false, options = [], value, on
)
return (
<div className="input-content light">
<div className="input-wrap">
<div className="form-input">
<>
{type === 'text' ? (
<div className="mb5">
<input type={type} className="input-light" readOnly={readOnly ? true : false} value={value} onChange={handleTextChange} />
@ -65,8 +63,6 @@ export default function QInput({ type, readOnly = false, options = [], value, on
))}
</div>
) : null}
</div>
</div>
</div>
</>
)
}

View File

@ -18,25 +18,17 @@ export default function QSelect({ placeholder, options, disabled = false, dark =
)
return (
<div className="input-content light">
<div className="input-wrap">
<div className="form-input">
<div className="mb5">
<select className={`select-light ${dark ? 'dark' : ''}`} value={value} onChange={handleChange} disabled={disabled ? true : false}>
{placeholder?.length > 0 ? (
{placeholder && (
<option value="" disabled hidden>
{placeholder}
</option>
) : null}
)}
{options.map((option) => (
<option key={option.name} value={option.value}>
{option.name}
</option>
))}
</select>
</div>
</div>
</div>
</div>
)
}