-
Notifications
You must be signed in to change notification settings - Fork 3
할일 리스트 모달 추가 #34
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
Closed
Closed
할일 리스트 모달 추가 #34
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| .container { | ||
| --dialog-max-width-mobile: 375px; | ||
| --dialog-padding: 16px 16px 32px; | ||
| --dialog-gap: 10px; | ||
| --control-height: 48px; | ||
| --close-button-size: 24px; | ||
| --input-max-width: 288px; | ||
| --button-max-width: 280px; | ||
|
|
||
| display: flex; | ||
| padding: var(--dialog-padding); | ||
| flex-direction: column; | ||
| gap: var(--dialog-gap); | ||
| align-items: stretch; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| .header { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: space-between; | ||
| gap: 12px; | ||
| } | ||
|
|
||
| .title { | ||
| color: var(--Text-Primary, #1e293b); | ||
| font-family: Pretendard; | ||
| font-size: 16px; | ||
| font-style: normal; | ||
| font-weight: 500; | ||
| line-height: 19px; | ||
| margin: 0; | ||
| } | ||
|
|
||
| .form { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 24px; | ||
| } | ||
|
|
||
| .input.input { | ||
| padding: 14px 16px; | ||
| width: 100%; | ||
| max-width: var(--input-max-width); | ||
| height: var(--control-height); | ||
| box-sizing: border-box; | ||
| align-self: center; | ||
| text-align: center; | ||
| } | ||
|
|
||
| .input.input::placeholder { | ||
| color: var(--Text-Default, #64748b); | ||
| font-family: Pretendard; | ||
| font-size: 16px; | ||
| font-style: normal; | ||
| font-weight: 400; | ||
| line-height: 19px; | ||
| } | ||
|
|
||
| .footer { | ||
| display: flex; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| .button { | ||
| display: flex; | ||
| width: 100%; | ||
| max-width: var(--button-max-width); | ||
| height: var(--control-height); | ||
| justify-content: center; | ||
| align-items: center; | ||
| gap: 10px; | ||
| flex-shrink: 0; | ||
| border-radius: 12px; | ||
| background: var(--Color-Brand-Primary, #5189fa); | ||
| border: none; | ||
| color: var(--color-text-inverse, #ffffff); | ||
| text-align: center; | ||
| font-family: Pretendard; | ||
| font-size: 16px; | ||
| font-style: normal; | ||
| font-weight: 600; | ||
| line-height: 19px; | ||
| } | ||
|
|
||
| .closeButton { | ||
| width: var(--close-button-size); | ||
| height: var(--close-button-size); | ||
| padding: 0; | ||
| border: none; | ||
| background: transparent; | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .modalContent.modalContent { | ||
| --dialog-radius-desktop: 24px; | ||
| --dialog-radius-mobile: 24px 24px 0 0; | ||
| border-radius: var(--dialog-radius-desktop); | ||
| } | ||
|
|
||
| @media (max-width: 480px) { | ||
| .container { | ||
| width: 100%; | ||
| max-width: var(--dialog-max-width-mobile); | ||
| } | ||
|
|
||
| .modalContent.modalContent { | ||
| border-radius: var(--dialog-radius-mobile); | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| 'use client'; | ||
|
|
||
| import Image from 'next/image'; | ||
| import type { FormEvent } from 'react'; | ||
| import { Input } from '@/components/input'; | ||
| import Modal from '../Modal'; | ||
| import styles from './AddTodoList.module.css'; | ||
| import xMarkBig from '@/assets/icons/xMark/xMarkBig.svg'; | ||
|
|
||
| const TITLE_ID = 'add-todo-list-title'; | ||
|
|
||
| export interface AddTodoListProps { | ||
| isOpen: boolean; | ||
| onClose: () => void; | ||
| onCreate: () => void; | ||
| } | ||
|
|
||
| export default function AddTodoList({ isOpen, onClose, onCreate }: AddTodoListProps) { | ||
| const handleSubmit = (e: FormEvent<HTMLFormElement>) => { | ||
| e.preventDefault(); | ||
| onCreate(); | ||
| }; | ||
|
|
||
| return ( | ||
| <Modal | ||
| isOpen={isOpen} | ||
| onClose={onClose} | ||
| ariaLabelledby={TITLE_ID} | ||
| contentClassName={styles.modalContent} | ||
| > | ||
| <article className={styles.container}> | ||
| <header className={styles.header}> | ||
| <h2 id={TITLE_ID} className={styles.title}> | ||
| 할 일 목록 | ||
| </h2> | ||
| <button type="button" className={styles.closeButton} aria-label="close" onClick={onClose}> | ||
| <Image src={xMarkBig} alt="" width={24} height={24} /> | ||
| </button> | ||
| </header> | ||
|
|
||
| <form className={styles.form} onSubmit={handleSubmit}> | ||
| <Input className={styles.input} placeholder="할 일을 입력하세요" /> | ||
| <footer className={styles.footer}> | ||
| <button type="submit" className={styles.button}> | ||
| 만들기 | ||
| </button> | ||
| </footer> | ||
| </form> | ||
| </article> | ||
| </Modal> | ||
| ); | ||
| } | ||
|
Comment on lines
+12
to
+52
Contributor
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. 현재 다음과 같이 수정하여 문제를 해결할 수 있습니다.
아래는 |
||
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
Oops, something went wrong.
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.
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.
여러 font 관련 속성들(
font-family,font-size,font-style,font-weight,line-height)을fontshorthand 속성을 사용하여 한 줄로 줄일 수 있습니다. 이렇게 하면 코드가 더 간결해집니다.이러한 변경은 이 파일의
.input.input::placeholder(53-57행) 및.button(79-83행) 선택자에도 유사하게 적용하여 코드 중복을 줄이고 가독성을 높일 수 있습니다.