-
Notifications
You must be signed in to change notification settings - Fork 3
도메인 맥락 모달 추가 #41
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
Merged
Merged
도메인 맥락 모달 추가 #41
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
83c8b6f
feat: 할일 리스트 모달 추가
Jieunsse 35f8a93
feat: 멤버초대 모달 추가
Jieunsse 9837a09
feat: 비밀번호 리셋 모달 추가
Jieunsse aa170fa
feat: 비밀번호 변경 모달 추가
Jieunsse bdb0a90
style: 레이아웃 시프팅 보완
Jieunsse 4e6a306
feat: 경고 모달 추가
Jieunsse a086683
feat: 로그아웃 모달 추가
Jieunsse c14f745
feat: 프로필 모달 추가
Jieunsse 6732f71
refactor: 클린코드를 위한 리팩토링 진행
Jieunsse 4c1c7de
style: 레이아웃 시프트 현상 해결
Jieunsse 72631e0
chore: 누락된 프롭스 추가
Jieunsse f641117
refactor: 공용 버튼컴포넌트 반영
Jieunsse e10caa2
chore: jsDoc 추가, 폴더 경로 세분화
Jieunsse 307907b
refactor: 단일책임원칙에 의한 소스코드 분리
Jieunsse 8dfd136
style: css 연쇄선택자 제거
Jieunsse 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
5 changes: 5 additions & 0 deletions
5
src/components/Modal/domain/components/AddTodoList/AddTodoList.constants.ts
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,5 @@ | ||
| export const TITLE_ID = 'add-todo-list-title'; | ||
| export const CLOSE_BUTTON_ARIA_LABEL = '닫기'; | ||
| export const DEFAULT_TITLE = '할 일 목록'; | ||
| export const DEFAULT_PLACEHOLDER = '할 일을 입력하세요'; | ||
| export const DEFAULT_SUBMIT_LABEL = '만들기'; |
130 changes: 130 additions & 0 deletions
130
src/components/Modal/domain/components/AddTodoList/AddTodoList.module.css
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,130 @@ | ||
| section > .modalContent { | ||
| width: 384px; | ||
| height: 235px; | ||
| display: inline-flex; | ||
| padding: 16px 16px 32px; | ||
| flex-direction: column; | ||
| align-items: flex-start; | ||
| gap: 10px; | ||
| border-radius: 24px; | ||
| background: var(--Background-Primary, #fff); | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| .container { | ||
| width: 100%; | ||
| height: 100%; | ||
| display: flex; | ||
| flex-direction: column; | ||
| align-items: stretch; | ||
| gap: 10px; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| .buttonContainer { | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: flex-end; | ||
| margin-right: 8px; | ||
| } | ||
|
|
||
| .header { | ||
| display: flex; | ||
| width: 100%; | ||
| align-items: center; | ||
| justify-content: center; | ||
| gap: 12px; | ||
| } | ||
|
|
||
| .title { | ||
| margin: 0; | ||
| color: var(--Text-Primary, #1e293b); | ||
| font-family: Pretendard; | ||
| font-size: 16px; | ||
| font-style: normal; | ||
| font-weight: 500; | ||
| line-height: 19px; | ||
| } | ||
|
|
||
| .closeButton { | ||
| width: 24px; | ||
| height: 24px; | ||
| padding: 0; | ||
| border: none; | ||
| background: transparent; | ||
| display: inline-flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .buttonContainer .closeButton, | ||
| .buttonContainer .closeButton:hover:not(:disabled), | ||
| .buttonContainer .closeButton:active:not(:disabled) { | ||
| border: none; | ||
| background: transparent; | ||
| color: inherit; | ||
| } | ||
|
|
||
| .form { | ||
| display: flex; | ||
| flex: 1; | ||
| min-height: 0; | ||
| flex-direction: column; | ||
| gap: 24px; | ||
| } | ||
|
|
||
| .form .input { | ||
| display: flex; | ||
| width: 280px; | ||
| height: 48px; | ||
| padding: 16px; | ||
| align-items: center; | ||
| gap: 10px; | ||
| border-radius: 12px; | ||
| border: 1px solid var(--Border-Primary, #e2e8f0); | ||
| background: var(--Background-Primary, #fff); | ||
| box-sizing: border-box; | ||
| margin: 0 auto; | ||
| } | ||
|
|
||
| .form .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; | ||
| margin-top: auto; | ||
| } | ||
|
|
||
| .button { | ||
| display: flex; | ||
| width: 280px; | ||
| height: 48px; | ||
| justify-content: center; | ||
| align-items: center; | ||
| gap: 10px; | ||
| flex-shrink: 0; | ||
| border: none; | ||
| border-radius: 12px; | ||
| background: var(--Color-Brand-Primary, #5189fa); | ||
| color: var(--Text-inverse, #fff); | ||
| text-align: center; | ||
| font-family: Pretendard; | ||
| font-size: 16px; | ||
| font-style: normal; | ||
| font-weight: 600; | ||
| line-height: 19px; | ||
| } | ||
|
|
||
| @media (max-width: 480px) { | ||
| section > .modalContent { | ||
| border-radius: 24px 24px 0 0; | ||
| } | ||
| } |
90 changes: 90 additions & 0 deletions
90
src/components/Modal/domain/components/AddTodoList/AddTodoList.tsx
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,90 @@ | ||
| 'use client'; | ||
|
|
||
| import Image from 'next/image'; | ||
| import type { FormEvent } from 'react'; | ||
| import BaseButton from '@/components/Button/base/BaseButton'; | ||
| import { Input } from '@/components/input'; | ||
| import Modal from '../../../Modal'; | ||
| import styles from './AddTodoList.module.css'; | ||
| import xMarkBig from '@/assets/icons/xMark/xMarkBig.svg'; | ||
| import { | ||
| CLOSE_BUTTON_ARIA_LABEL, | ||
| DEFAULT_PLACEHOLDER, | ||
| DEFAULT_SUBMIT_LABEL, | ||
| DEFAULT_TITLE, | ||
| TITLE_ID, | ||
| } from './AddTodoList.constants'; | ||
| import type { AddTodoListProps } from './AddTodoList.types'; | ||
| export type { AddTodoListProps } from './AddTodoList.types'; | ||
|
|
||
| /** | ||
| * @param props.isOpen 모달 표시 여부를 boolean으로 전달합니다. | ||
| * @param props.onClose 모달을 닫을 때 실행할 함수를 전달합니다. | ||
| * @param props.onSubmit 할 일 생성 버튼 클릭 시 실행할 함수를 전달합니다. | ||
| * @param props.text 모달 제목과 버튼 문구 같은 텍스트 옵션을 객체로 전달합니다. | ||
| * @param props.input 할 일 입력창에 적용할 옵션을 객체로 전달합니다. | ||
| * @param props.closeOptions 오버레이 클릭과 Escape 닫힘 옵션을 객체로 전달합니다. | ||
| */ | ||
| export default function AddTodoList({ | ||
| isOpen, | ||
| onClose, | ||
| onSubmit, | ||
| text, | ||
| input, | ||
| closeOptions, | ||
| }: AddTodoListProps) { | ||
| const title = text?.title ?? DEFAULT_TITLE; | ||
| const submitLabel = text?.submitLabel ?? DEFAULT_SUBMIT_LABEL; | ||
| const inputPlaceholder = text?.inputPlaceholder ?? DEFAULT_PLACEHOLDER; | ||
| const closeOnOverlayClick = closeOptions?.overlayClick ?? true; | ||
| const closeOnEscape = closeOptions?.escape ?? true; | ||
|
|
||
| const handleSubmit = (e: FormEvent<HTMLFormElement>) => { | ||
| e.preventDefault(); | ||
| onSubmit(); | ||
| }; | ||
|
|
||
| return ( | ||
| <Modal | ||
| isOpen={isOpen} | ||
| onClose={onClose} | ||
| ariaLabelledby={TITLE_ID} | ||
| contentClassName={styles.modalContent} | ||
| closeOnOverlayClick={closeOnOverlayClick} | ||
| closeOnEscape={closeOnEscape} | ||
| > | ||
| <article className={styles.container}> | ||
| <div className={styles.buttonContainer}> | ||
| <BaseButton | ||
| type="button" | ||
| className={styles.closeButton} | ||
| aria-label={CLOSE_BUTTON_ARIA_LABEL} | ||
| onClick={onClose} | ||
| > | ||
| <Image src={xMarkBig} alt="" width={24} height={24} /> | ||
| </BaseButton> | ||
| </div> | ||
| <header className={styles.header}> | ||
| <h2 id={TITLE_ID} className={styles.title}> | ||
| {title} | ||
| </h2> | ||
| </header> | ||
|
|
||
| <form className={styles.form} onSubmit={handleSubmit}> | ||
| <Input | ||
| {...input?.props} | ||
| className={styles.input} | ||
| type="text" | ||
| name="todo" | ||
| placeholder={inputPlaceholder} | ||
| /> | ||
| <footer className={styles.footer}> | ||
| <BaseButton type="submit" variant="primary" className={styles.button}> | ||
| {submitLabel} | ||
| </BaseButton> | ||
| </footer> | ||
| </form> | ||
| </article> | ||
| </Modal> | ||
| ); | ||
| } | ||
20 changes: 20 additions & 0 deletions
20
src/components/Modal/domain/components/AddTodoList/AddTodoList.types.ts
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,20 @@ | ||
| import type { InputProps } from '@/components/input/types/types'; | ||
| import type { BaseDomainModalProps } from '../../types/types'; | ||
|
|
||
| export type TodoInputProps = Omit<InputProps, 'className' | 'type' | 'name' | 'placeholder'>; | ||
|
|
||
| export interface AddTodoListTextOptions { | ||
| title?: string; | ||
| submitLabel?: string; | ||
| inputPlaceholder?: string; | ||
| } | ||
|
|
||
| export interface AddTodoListInputOptions { | ||
| props?: TodoInputProps; | ||
| } | ||
|
|
||
| export interface AddTodoListProps extends BaseDomainModalProps { | ||
| onSubmit: () => void; | ||
| text?: AddTodoListTextOptions; | ||
| input?: AddTodoListInputOptions; | ||
| } |
10 changes: 10 additions & 0 deletions
10
src/components/Modal/domain/components/ChangePassword/ChangePassword.constants.ts
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,10 @@ | ||
| export const TITLE_ID = 'change-password-title'; | ||
| export const NEW_PASSWORD_NAME = 'newPassword'; | ||
| export const CONFIRM_PASSWORD_NAME = 'confirmPassword'; | ||
| export const DEFAULT_TITLE = '비밀번호 변경하기'; | ||
| export const DEFAULT_NEW_PASSWORD_LABEL = '새 비밀번호'; | ||
| export const DEFAULT_CONFIRM_PASSWORD_LABEL = '새 비밀번호 확인'; | ||
| export const DEFAULT_NEW_PASSWORD_PLACEHOLDER = '새 비밀번호를 입력해주세요.'; | ||
| export const DEFAULT_CONFIRM_PASSWORD_PLACEHOLDER = '새 비밀번호를 다시 한 번 입력해주세요.'; | ||
| export const DEFAULT_CLOSE_LABEL = '닫기'; | ||
| export const DEFAULT_SUBMIT_LABEL = '변경하기'; |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.