-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat(apply): implement the function to preview the application form before final submission #649
Changes from 1 commit
f925cf6
c4dc97c
33c6513
b39596d
53c22e0
5b950d7
9cdbdd0
1cdb355
75dc3ed
50a1043
24b7697
08a4d3d
76095e5
7cfb738
a5d21b7
749238a
47f7b84
1332944
665b0a8
3ac8aa6
5d824c6
76ef71a
088a1c5
4451f19
37d6963
c63d990
64ed0c3
0c49bf1
6d18199
be7b7e1
f9203e2
a804967
0634200
8d11b2f
fc98c15
5ad7d64
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,5 +1,4 @@ | ||
import classNames from "classnames"; | ||
import useModalContext from "../../../hooks/useModalContext"; | ||
import styles from "./ModalWindow.module.css"; | ||
|
||
interface ModalWindowProps | ||
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. r : 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. 반영했습니다 😓 4f623bb |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,27 @@ | ||
import { useState } from "react"; | ||
import React, { useState } from "react"; | ||
import ModalPortal from "../components/Modal/ModalPortal/ModalPortal"; | ||
import { ModalContext } from "../hooks/useModalContext"; | ||
|
||
export type ModalContextValue = { | ||
Modal: (props: { children: NonNullable<React.ReactNode> }) => JSX.Element | null; | ||
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. r : 해당 children 타입과 해당 children 타입 ModalPortal 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. ..!! d567def |
||
openModal: () => void; | ||
closeModal: () => void; | ||
}; | ||
|
||
const ModalProvider = ({ children }: { children: React.ReactNode }) => { | ||
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. r : 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. 분리했습니다. 0cf7ff6 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.
|
||
const [isModalOpened, setIsModalOpened] = useState(false); | ||
|
||
const openModal = () => { | ||
const openModal: ModalContextValue["openModal"] = () => { | ||
document.body.style.overflow = "hidden"; | ||
setIsModalOpened(true); | ||
}; | ||
|
||
const closeModal = () => { | ||
const closeModal: ModalContextValue["closeModal"] = () => { | ||
document.body.style.overflow = "auto"; | ||
setIsModalOpened(false); | ||
}; | ||
|
||
const Modal: React.FC<{ children: NonNullable<React.ReactNode> }> = (props) => { | ||
const Modal: ModalContextValue["Modal"] = (props) => { | ||
if (isModalOpened) { | ||
return <ModalPortal closeModal={closeModal} {...props} />; | ||
} | ||
|
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.
r : ref가
undefined
타입도 추론되어서 명시적으로 null로 초기화하면 좋을 것 같네요.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.
놓쳤었네요 반영했습니다 :DD e53b044