-
Notifications
You must be signed in to change notification settings - Fork 44
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
[오동혁] Week11 #362
The head ref may contain hidden characters: "part2-\uC624\uB3D9\uD601"
[오동혁] Week11 #362
Changes from all commits
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 |
---|---|---|
@@ -1,43 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<html lang="ko"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="Web site created using create-react-app" | ||
/> | ||
<meta name="description" content="Web site created using create-react-app" /> | ||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" /> | ||
<!-- | ||
manifest.json provides metadata used when your web app is installed on a | ||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
--> | ||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> | ||
<!-- | ||
Notice the use of %PUBLIC_URL% in the tags above. | ||
It will be replaced with the URL of the `public` folder during the build. | ||
Only files inside the `public` folder can be referenced from the HTML. | ||
|
||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | ||
work correctly both with client-side routing and a non-root public URL. | ||
Learn how to configure a non-root public URL by running `npm run build`. | ||
--> | ||
<title>React App</title> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
<!-- | ||
This HTML file is a template. | ||
If you open it directly in the browser, you will see an empty page. | ||
|
||
You can add webfonts, meta tags, or analytics to this file. | ||
The build step will place the bundled scripts into the <body> tag. | ||
|
||
To begin the development, run `npm start` or `yarn start`. | ||
To create a production bundle, use `npm run build` or `yarn build`. | ||
--> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import styled from 'styled-components'; | ||
|
||
const StyledInput = styled.input` | ||
box-sizing: border-box; | ||
width: ${(props) => props.$width}; | ||
height: ${(props) => props.$height}; | ||
margin: ${(props) => props.$margin}; | ||
border-radius: 8px; | ||
border: 1px solid #ccd5e3; | ||
padding: 0 15px; | ||
font-size: 16px; | ||
line-height: 24px; | ||
|
||
&:hover { | ||
border: 1px solid #6d6afe; | ||
} | ||
|
||
&:focus { | ||
outline: 1px solid #6d6afe; | ||
} | ||
`; | ||
|
||
export default function Input({ width, height, margin, placeholder }) { | ||
return <StyledInput $width={width} $height={height} $margin={margin} placeholder={placeholder} />; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import styled from 'styled-components'; | ||
import close from '../../images/close.png'; | ||
|
||
const ModalBack = styled.div` | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
bottom: 0; | ||
right: 0; | ||
background: rgba(0, 0, 0, 0.4); | ||
z-index: 998; | ||
`; | ||
|
||
const ModalDiv = styled.div` | ||
position: fixed; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
box-sizing: border-box; | ||
width: ${(props) => props.$width}; | ||
height: ${(props) => props.$height}; | ||
border-radius: 15px; | ||
padding: ${(props) => props.$padding}; | ||
background-color: white; | ||
z-index: 999; | ||
`; | ||
|
||
const TitleDiv = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
width: 100%; | ||
font-size: 20px; | ||
font-weight: bold; | ||
`; | ||
|
||
const CloseButton = styled.button` | ||
position: absolute; | ||
top: 15px; | ||
right: 15px; | ||
border: none; | ||
background: none; | ||
cursor: pointer; | ||
`; | ||
|
||
export default function Modal({ title, width, height, padding, setter, children }) { | ||
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. width, height의 경우는 기본 값을 미리 정해두면 어떨까요~? 다양한 곳에서 사용할 때 항상 width와 height를 넣어주는 것은 다소 번거로울 수 있을 것 같아요. 또 좋은 방법으로는 width, height를 주지 않으면 내부 컴포넌트에 fit하게 만드는 것도 방법이에요! |
||
const handleClose = () => { | ||
setter?.(false); | ||
}; | ||
|
||
return ( | ||
<ModalBack> | ||
<ModalDiv $width={width} $height={height} $padding={padding}> | ||
<CloseButton onClick={handleClose}> | ||
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. 닫기 버튼은 기능적으로 중요한 �요소인데요, 이 버튼에 대한 접근성을 높이기 위해 aria-label을 추가하는 것을 고려해야 합니다. 현재는 이미지 태그에만 alt 속성이 있는데, 버튼 자체에도 추가적인 설명이 있으면 좋겠습니다! |
||
<img src={close} alt='Modal close button' /> | ||
</CloseButton> | ||
<TitleDiv>{title}</TitleDiv> | ||
{children} | ||
</ModalDiv> | ||
</ModalBack> | ||
); | ||
} |
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.
js와 jsx로 파일이름이 나뉘어진 컴포넌트들이 꽤 있네요. 혹시 어떤 이유로 파일 확장자가 다른 것인지 알 수 있을까요~?