[김희성] Sprint 6#155
Merged
dongqui merged 1 commit intocodeit-bootcamp-frontend:React-김희성from May 20, 2025
Hidden character warning
The head ref may contain hidden characters: "React-\uae40\ud76c\uc131"
Merged
Conversation
dongqui
approved these changes
May 20, 2025
Collaborator
dongqui
left a comment
There was a problem hiding this comment.
희성님 이번 미션도 고생 많으셨습니다 💯
요구 사항도 꼼꼼하게 잘 챙겨주셨고, 구조도 깔끔해서 보기 편안했습니다.
빠르게 성장하시는 게 느껴지네요!!
| const handleDelete = () => { | ||
| setImage(null); | ||
| setShowWarning(false); | ||
| inputRef.current.value = ""; |
| placeholder, | ||
| value, | ||
| name, | ||
| onChange, |
Collaborator
There was a problem hiding this comment.
기본 html 속성들이라면, 생략하시는 것도 괜찮습니다 :)
export default function InputBox({
title,
isInput = true,
height,
...rest
}) {
return (
<div className="input-wrapper">
<label>{title}</label>
{isInput ? (
<input {...rest} />
) : (
<textarea {...rest} />
)}
</div>
);
}| return ( | ||
| <div className="input-wrapper"> | ||
| <label>{title}</label> | ||
| {isInput ? ( |
Collaborator
There was a problem hiding this comment.
조금 더 명시적으로 나타내주는 방법도 있습니다 :)
jsx는 변수도 태그로 인식합니다!
export default function InputBox({
title,
as = "input", // 'input' or 'textarea'
height,
...rest
}) {
const Component = as;
return (
<div className="input-wrapper">
<label>{title}</label>
<Component {...rest} />
</div>
);
}|
|
||
| const newTag = input.trim(); | ||
|
|
||
| if (!tags.includes(newTag)) { |
Collaborator
There was a problem hiding this comment.
중복을 다루실 때 Set을 사용해 보시면 좋아요~!
| const formatted = rawValue.replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 3자리마다 쉼표 추가 | ||
| setFormValue({ ...formValue, price: formatted }); | ||
| break; | ||
| default: |
Collaborator
There was a problem hiding this comment.
중요하진 않지만.. 이렇게 줄이는 방법도 있습니다 🤣
switch (name) {
case "price":
const rawValue = value.replace(/,/g, "").replace(/\D/g, ""); // 문자 막음 -> 숫자만 가능하게
const formatted = rawValue.replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 3자리마다 쉼표 추가
setFormValue({ ...formValue, price: formatted });
break;
default:
setFormValue((prev) => ({ ...prev, [name]: value}));| ); | ||
| }; | ||
|
|
||
| return ( |
| // import Signup from "./pages/signup/Signup"; | ||
| import Items from "../pages/items/Items"; | ||
| import AddItem from "../pages/additem/AddItem"; | ||
| import ItemsDetail from "../pages/items/itemsDetail/ItemsDetail"; |
Collaborator
There was a problem hiding this comment.
에러나던데, 해당 파일이 커밋에 안 들어갔나봐요~!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요구사항
기본
심화
주요 변경사항
스크린샷
PC 버전 등록
태블릿 버전 등록
모바일 버전 등록
버튼 활성화 조건
멘토에게