-
Notifications
You must be signed in to change notification settings - Fork 20
[노현지] Sprint7 #69
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
The head ref may contain hidden characters: "React-\uB178\uD604\uC9C0-sprint7"
[노현지] Sprint7 #69
Changes from all commits
324ee73
b6b0163
bdb8b5d
e3b3943
da1a388
0b89c72
e4e5fbc
1edefa7
662aed1
24c7059
633e8e4
6428a66
03b7bfc
c8caed0
f55c062
55bd12e
b763621
19750c3
94c36cd
3706efe
2235af0
62ab22c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import DeleteIcon from "../../assets/icon/ic_delete.svg"; | ||
| import styles from "./DeleteButton.module.css"; | ||
|
|
||
| function DeleteButton({ className = "", onClick = () => {} }) { | ||
| return ( | ||
| <button type="button" onClick={onClick} className={className}> | ||
| <img src={DeleteIcon} alt="" className={styles.deleteIcon} /> | ||
| </button> | ||
| ); | ||
| } | ||
|
|
||
| export default DeleteButton; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| .deleteIcon { | ||
| padding: 0.5rem; | ||
| border-radius: 100%; | ||
| background-color: var(--gray400); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import MenuIcon from "../../assets/icon/ic_menu.svg"; | ||
| import styles from "./MenuButton.module.css"; | ||
|
|
||
| function MenuButton({ className = "", onClick = () => {} }) { | ||
| return ( | ||
| <button | ||
| type="button" | ||
| onClick={onClick} | ||
| className={`${className} ${styles.menuButton}`} | ||
| > | ||
| <img src={MenuIcon} alt="" /> | ||
| </button> | ||
| ); | ||
| } | ||
|
|
||
| export default MenuButton; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| .menuButton { | ||
| border-radius: 100%; | ||
| } | ||
|
|
||
| .menuButton:hover { | ||
| background-color: var(--gray100); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import React from "react"; | ||
| import styles from "./PrimaryButton.module.css"; | ||
|
|
||
| function PrimaryButton({ | ||
| children, | ||
| className = "", | ||
| onClick = () => {}, | ||
| disabled = false, | ||
| }) { | ||
| const buttonClass = `${styles.button} ${className}`; | ||
| return ( | ||
| <button className={buttonClass} onClick={onClick} disabled={disabled}> | ||
| {children} | ||
| </button> | ||
| ); | ||
| } | ||
|
Comment on lines
+4
to
+16
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (심화/제안/고민해보기) 혹시 버튼 컴포넌트들을 공통 버튼 컴포넌트로 리팩토링 할 수는 없을까요?
예를 들어서 다음과 같은 컴포넌트를 만들어볼 수 있을 것 같아요: import styles from "./Button.module.css";
function Button({
children,
variant = "primary",
icon,
// onClick = () => {},
className = "",
// disabled = false,
...rest
}) {
return (
<button
className={`${styles.button} ${styles[variant]} ${className}`}
// onClick={onClick}
// disabled={disabled} 해당 내용들은 `rest`에 자동 등재
{...rest}
>
{icon && <img src={icon} alt="" className={styles.icon} />}
{children}
</button>
);
}
export default Button;
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 방금 제안드린 내용에서 추가사실, 여기서 <Button variant="error" className="flex justify-between w-24 items-center">삭제<DeleteIcon /></Button> |
||
|
|
||
| export default PrimaryButton; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| .button { | ||
| background-color: var(--blue); | ||
| color: var(--gray100); | ||
| } | ||
|
|
||
| .button:hover { | ||
| background-color: #1967d6; | ||
| } | ||
|
|
||
| .button:focus { | ||
| background-color: #1251aa; | ||
| } | ||
|
|
||
| .button:disabled { | ||
| background-color: var(--gray400); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import { useState, useEffect } from "react"; | ||
| import debounce from "lodash.debounce"; | ||
|
|
||
| function useWindowSize() { | ||
| function useWindowSize(delay = 300) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 크으 ~ 피드백 반영 좋습니다 현지님 👍 |
||
| const [windowSize, setWindowSize] = useState({ | ||
| width: window.innerWidth, | ||
| height: window.innerHeight, | ||
|
|
@@ -13,7 +13,7 @@ function useWindowSize() { | |
| width: window.innerWidth, | ||
| height: window.innerHeight, | ||
| }); | ||
| }, 300); | ||
| }, delay); | ||
|
|
||
| window.addEventListener("resize", handleResize); | ||
| return () => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,11 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { Link } from "react-router-dom"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { Helmet } from "react-helmet"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import PrimaryButton from "../../components/UI/PrimaryButton"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import BannerTopImg from "../../assets/image/Img_home_top.svg"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import BannerBottomImg from "../../assets/image/Img_home_bottom.svg"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import HomeImg1 from "../../assets/image/Img_home_01.png"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import HomeImg2 from "../../assets/image/Img_home_02.png"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import HomeImg3 from "../../assets/image/Img_home_03.png"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import styles from "./HomePage.module.css"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| function HomePage() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -7,6 +14,80 @@ function HomePage() { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Helmet> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <title>판다마켓 - 일상의 모든 물건을 거래해 보세요</title> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Helmet> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className={`${styles.banner} ${styles.top}`}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className={styles.wrapper}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className={styles.bannerContainer}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className={styles.bannerLeft}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h1 className={styles.title}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 일상의 모든 물건을 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <br className={styles.mobile} /> 거래해 보세요 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </h1> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <Link to="/items"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <PrimaryButton className={styles.itemsLinkButton}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 구경하러 가기 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </PrimaryButton> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </Link> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className={styles.bannerRight}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <img src={BannerTopImg} alt="상단 배너 이미지" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className={`${styles.features} ${styles.wrapper}`}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className={styles.feature}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <img src={HomeImg1} width="68.5%" alt="인기 상품" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className={styles.featureContent}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h2 className={styles.featureTag}>Hot item</h2> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <h3 className={styles.bold}>인기 상품을 확인해 보세요</h3> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <p className={styles.featureDescription}> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 가장 HOT한 중고거래 물품을 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <br /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 판다 마켓에서 확인해 보세요 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </p> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+37
to
+49
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (제안/선택)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div className={`${styles.features} ${styles.wrapper}`}> | |
| <div className={styles.feature}> | |
| <img src={HomeImg1} width="68.5%" alt="인기 상품" /> | |
| <div className={styles.featureContent}> | |
| <h2 className={styles.featureTag}>Hot item</h2> | |
| <h3 className={styles.bold}>인기 상품을 확인해 보세요</h3> | |
| <p className={styles.featureDescription}> | |
| 가장 HOT한 중고거래 물품을 | |
| <br /> | |
| 판다 마켓에서 확인해 보세요 | |
| </p> | |
| </div> | |
| </div> | |
| <section className={`${styles.features} ${styles.wrapper}`}> | |
| <div className={styles.feature}> | |
| <img src={HomeImg1} width="68.5%" alt="인기 상품" /> | |
| <div className={styles.featureContent}> | |
| <h2 className={styles.featureTag}>Hot item</h2> | |
| <h3 className={styles.bold}>인기 상품을 확인해 보세요</h3> | |
| <p className={styles.featureDescription}> | |
| 가장 HOT한 중고거래 물품을 | |
| <br /> | |
| 판다 마켓에서 확인해 보세요 | |
| </p> | |
| </div> | |
| </section> |
영역이 구분되며 h로 각 섹션의 정체성이 명확하므로 section태그도 괜찮은 의미일 것 같아서 제안드려요:
다음은 MDN의 <section>에 대한 설명 중 첫 문장입니다.
The
<section>HTML element represents a generic standalone section of a document, which doesn't have a more specific semantic element to represent it. Sections should always have a heading, with very few exceptions.
<section>HTML 요소는 문서의 일반적인 독립형 섹션을 나타내며 이를 나타내는 더 구체적인 의미 요소가 없습니다. 섹션에는 거의 예외를 제외하고 항상 제목이 있어야 합니다.
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.
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.
쿼리는
URLSearchParams로 손쉽게 사용할 수 있어요 !URLSearchParams와 함께 객체로 손쉽게 핸들링할 수 있습니다 !객체로 구성할 수 있어 가독성이 좋고, URL 인코딩을 자동으로 처리하여 특수 문자나 공백이 포함된 값에서도 안전하게 동작합니다 !