-
Notifications
You must be signed in to change notification settings - Fork 39
[명지우] sprint6 #197
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-\uBA85\uC9C0\uC6B0-sprint6"
[명지우] sprint6 #197
Changes from all commits
ca966ea
8ad5c18
b8c4601
b2e3a9c
cda5ff5
38c9952
2f6b8db
02978e3
7132404
03f6823
19b21ac
a941fb7
24ba981
9fa48b0
4b7ce2c
355327b
a6fa9d0
183b67c
8201084
7e99c77
bf6cb57
8836b97
95d8bb6
8efbf46
8487f4d
28b5042
89fe891
9ecb81c
a4c4eef
3bd4fb1
273218d
fbd931b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| const DeleteIcon = () => { | ||
| return ( | ||
| <svg | ||
| width="8" | ||
| height="8" | ||
| viewBox="0 0 10 10" | ||
| fill="none" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| > | ||
| <path | ||
| d="M1.08044 1L9.08044 9" | ||
| stroke="white" | ||
| strokeWidth="1.8" | ||
| strokeLinecap="round" | ||
| /> | ||
| <path | ||
| d="M8.99994 1L0.99994 9" | ||
| stroke="white" | ||
| strokeWidth="1.8" | ||
| strokeLinecap="round" | ||
| /> | ||
| </svg> | ||
| ); | ||
| }; | ||
|
|
||
| export default DeleteIcon; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| const PlusIcon = () => { | ||
| return ( | ||
| <svg | ||
| width="48" | ||
| height="48" | ||
| viewBox="0 0 48 48" | ||
| fill="none" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| > | ||
| <path | ||
| d="M10 24H38" | ||
| stroke="#9CA3AF" | ||
| strokeWidth="4" | ||
| strokeLinecap="round" | ||
| /> | ||
| <path | ||
| d="M24 38V10" | ||
| stroke="#9CA3AF" | ||
| strokeWidth="4" | ||
| strokeLinecap="round" | ||
| /> | ||
| </svg> | ||
| ); | ||
| }; | ||
|
|
||
| export default PlusIcon; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| const BaseForm = ({ children, onSubmit, ...props }) => { | ||
| return ( | ||
| <form onSubmit={onSubmit} {...props}> | ||
| {children} | ||
| </form> | ||
| ); | ||
| }; | ||
|
|
||
| export default BaseForm; | ||
|
Comment on lines
+1
to
+9
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. ❓ 질문 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import styled from "@emotion/styled"; | ||
|
|
||
| const BaseImageInput = ({ type = "file", onChange, ...props }) => { | ||
|
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. 💊 제안 |
||
| return <Input type={type} accept="image/*" onChange={onChange} {...props} />; | ||
|
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. 💊 제안 (사용자가 업로드창에서 옵션을 열어 확장자를 바꾸면 아래처럼 보입니다) https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/accept |
||
| }; | ||
|
|
||
| export default BaseImageInput; | ||
|
|
||
| const Input = styled.input` | ||
| display: none; | ||
| `; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import styled from "@emotion/styled"; | ||
|
|
||
| const BaseInput = ({ type = "text", value, onChange, ...props }) => { | ||
| return <Input type={type} value={value} onChange={onChange} {...props} />; | ||
| }; | ||
|
|
||
| export default BaseInput; | ||
|
|
||
| const Input = styled.input` | ||
| width: 100%; | ||
| padding: 1.4rem 2.4rem; | ||
| background-color: var(--gray100); | ||
| border-radius: 1.2rem; | ||
| border: 2px solid var(--gray100); | ||
| font-size: 1.4rem; | ||
|
|
||
| &:focus { | ||
| outline: none; | ||
| border: 2px solid var(--blue); | ||
| } | ||
| `; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import styled from "@emotion/styled"; | ||
|
|
||
| const BaseTextarea = ({ ref, value, onChange, ...props }) => { | ||
| return <Textarea ref={ref} value={value} onChange={onChange} {...props} />; | ||
| }; | ||
|
|
||
| export default BaseTextarea; | ||
|
|
||
| const Textarea = styled.textarea` | ||
| width: 100%; | ||
| height: auto; | ||
| min-height: 8rem; | ||
| resize: none; | ||
|
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. 👍 칭찬 |
||
| overflow: hidden; | ||
| padding: 1.6rem 2.4rem; | ||
| background-color: var(--gray100); | ||
| border-radius: 1.2rem; | ||
| border: 2px solid var(--gray100); | ||
| font-size: 1.4rem; | ||
|
|
||
| &:focus { | ||
| outline: none; | ||
| border: 2px solid var(--blue); | ||
| } | ||
| `; | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||
| import styled from "@emotion/styled"; | ||||||
| import DeleteIcon from "@assets/icons/delete"; | ||||||
|
|
||||||
| const BUTTON_SIZE = { | ||||||
| s: "1.6rem", | ||||||
| m: "2rem", | ||||||
| l: "2.4rem", | ||||||
| }; | ||||||
|
|
||||||
| const DeleteButton = ({ onClick, size = "s" }) => { | ||||||
| return ( | ||||||
| <DeleteButtonWrapper onClick={onClick} size={BUTTON_SIZE[size]}> | ||||||
|
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. ❗️ 수정요청
Suggested change
버튼으로 바꿔주시고 type을 명시하시는 것을 추천드려요~ |
||||||
| <DeleteIcon /> | ||||||
| </DeleteButtonWrapper> | ||||||
| ); | ||||||
| }; | ||||||
|
|
||||||
| export default DeleteButton; | ||||||
|
|
||||||
| const DeleteButtonWrapper = styled.div` | ||||||
| width: ${(props) => props.size}; | ||||||
| height: ${(props) => props.size}; | ||||||
|
|
||||||
| display: flex; | ||||||
| justify-content: center; | ||||||
| align-items: center; | ||||||
| border-radius: 100%; | ||||||
| background-color: var(--gray300); | ||||||
| cursor: pointer; | ||||||
|
|
||||||
| &:hover { | ||||||
| opacity: 0.7; | ||||||
| } | ||||||
| `; | ||||||

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.
💊 제안
최상단에서 useDeviceSize 훅을 호출해 isMobile가 변경되게 되면 모든 자식컴포넌트들이 리렌더링됩니다.
Toast 라이브러리를 위해 이렇게 처리하신 것 같은데 제가 문서를 봤을 때는 다른 방식으로도
원하시는 바를 구현하실 수 있을 것 같아요~
https://fkhadra.github.io/react-toastify/how-to-style