-
Notifications
You must be signed in to change notification settings - Fork 31
[김희성] Sprint 6 #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[김희성] Sprint 6 #155
The head ref may contain hidden characters: "React-\uAE40\uD76C\uC131"
Conversation
dongqui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
희성님 이번 미션도 고생 많으셨습니다 💯
요구 사항도 꼼꼼하게 잘 챙겨주셨고, 구조도 깔끔해서 보기 편안했습니다.
빠르게 성장하시는 게 느껴지네요!!
| const handleDelete = () => { | ||
| setImage(null); | ||
| setShowWarning(false); | ||
| inputRef.current.value = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
꼼꼼하게 잘 챙겨주셨군요! 👍
| placeholder, | ||
| value, | ||
| name, | ||
| onChange, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기본 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 ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
조금 더 명시적으로 나타내주는 방법도 있습니다 :)
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)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
중복을 다루실 때 Set을 사용해 보시면 좋아요~!
| const formatted = rawValue.replace(/\B(?=(\d{3})+(?!\d))/g, ","); // 3자리마다 쉼표 추가 | ||
| setFormValue({ ...formValue, price: formatted }); | ||
| break; | ||
| default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
중요하진 않지만.. 이렇게 줄이는 방법도 있습니다 🤣
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 ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
깔끔하네요 👍
| // 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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
에러나던데, 해당 파일이 커밋에 안 들어갔나봐요~!
요구사항
기본
심화
주요 변경사항
스크린샷
PC 버전 등록
태블릿 버전 등록
모바일 버전 등록
버튼 활성화 조건
멘토에게