Skip to content

Commit

Permalink
Merge pull request #51 from woochul2/responsive
Browse files Browse the repository at this point in the history
헤더, 프로필 반응형 디자인
  • Loading branch information
woochul2 authored May 22, 2022
2 parents 6e0d08d + 97a16a7 commit 40cb6b8
Show file tree
Hide file tree
Showing 49 changed files with 744 additions and 146 deletions.
134 changes: 134 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"next-redux-wrapper": "^7.0.5",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-focus-lock": "^2.9.1",
"react-redux": "^8.0.1",
"react-textarea-autosize": "^8.3.3",
"sockjs-client": "^1.6.0",
Expand Down
46 changes: 24 additions & 22 deletions src/components/DeleteModal/DeleteModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Button from 'components/Button';
import { MouseEventHandler } from 'react';
import styles from './DeleteModal.module.scss';
import FocusLock from 'react-focus-lock';

export type DeleteModalProps = {
title: string;
Expand All @@ -10,7 +11,6 @@ export type DeleteModalProps = {
buttonName?: string;
};

// TODO: 포커스 트랩
function DeleteModal({
title,
message,
Expand All @@ -19,29 +19,31 @@ function DeleteModal({
buttonName,
}: DeleteModalProps) {
return (
<div
className={styles.container}
onClick={(event) => {
const target = event.target as HTMLElement;
if (target.classList.contains(styles.container)) {
onCancel(event);
}
}}
data-testid="delete-modal"
>
<div className={styles.main}>
<h3>{title}</h3>
<p>{message}</p>
<div className={styles.buttonsContainer}>
<Button variant="plain" onClick={onCancel} ariaLabel="삭제 취소">
취소
</Button>
<Button onClick={onConfirm} variant="error">
{buttonName || '삭제'}
</Button>
<FocusLock>
<div
className={styles.container}
onClick={(event) => {
const target = event.target as HTMLElement;
if (target.classList.contains(styles.container)) {
onCancel(event);
}
}}
data-testid="delete-modal"
>
<div className={styles.main}>
<h3>{title}</h3>
<p>{message}</p>
<div className={styles.buttonsContainer}>
<Button variant="plain" onClick={onCancel} ariaLabel="삭제 취소">
취소
</Button>
<Button onClick={onConfirm} variant="error">
{buttonName || '삭제'}
</Button>
</div>
</div>
</div>
</div>
</FocusLock>
);
}

Expand Down
Loading

0 comments on commit 40cb6b8

Please sign in to comment.