Skip to content

Commit

Permalink
Merge pull request #118 from bsideproject/moon
Browse files Browse the repository at this point in the history
[feat] addRooms Modal, Filter에서 복사해서 우선 Commit.!!
  • Loading branch information
KinDDoGGang authored Aug 15, 2023
2 parents 1188d4b + 896f74d commit 1c974a2
Show file tree
Hide file tree
Showing 6 changed files with 725 additions and 6 deletions.
12 changes: 10 additions & 2 deletions components/Modal/ModalBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import useModal from '../../hooks/useModal.ts';
import useOutSideClick from '../../hooks/useOutSideClick.ts';
import Button from '../Button/Button.tsx';
import Header from '../Header/Header.tsx';
import DefaultLayout from '../layouts/DefaultLayout.tsx';

function Modal({
children,
Expand All @@ -15,6 +14,7 @@ function Modal({
title = '',
content = '',
custom = false,
customHeader = false,
buttonType = 'none',
handleClose,
buttonName = '',
Expand Down Expand Up @@ -78,6 +78,14 @@ function Modal({
const goBack = () => {
closeModal();
};
const defaultHeader = () => {
let result = <Header type="title" title={title} right="close" logoColor="black" handleButtonClick={goBack} />;
// TODO 나중에 여기 layoutHeader쪽 Component를 받는 거로 변경
if (customHeader) {
result = <Header type="back" logoColor="black" bgColor="white" title="Add rooms" handleButtonClick={goBack} />;
}
return result;
};

return size === 'md' ? (
<div className={styles.overlay}>
Expand All @@ -102,7 +110,7 @@ function Modal({
</div>
) : (
<div className={styles.full}>
<Header type="title" title={title} right="close" logoColor="black" handleButtonClick={goBack} />
{defaultHeader()}
<div className="mt-[62px] px-[20px] text-g6 text-[16px] font-light">{custom ? children : content}</div>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions components/Modal/ModalContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface ModalProps {
title?: string;
content?: string;
custom?: boolean;
customHeader?: boolean;
buttonType?: 'none' | 'both' | 'outline' | 'default';
handleClose?: () => void;
buttonName?: string;
Expand Down
Loading

0 comments on commit 1c974a2

Please sign in to comment.