[IntroPanel, TPopUp] 팝업 미동의 이벤트
Detail Notes : 1. 미동의 버튼 클릭시 앱 닫는 이벤트 추가
This commit is contained in:
@@ -25,6 +25,7 @@ const KINDS = [
|
||||
"optionPopup",
|
||||
"eventBannerPopup",
|
||||
"supportPopup",
|
||||
"exitPopup",
|
||||
];
|
||||
|
||||
export default function TPopUp({
|
||||
@@ -69,6 +70,15 @@ export default function TPopUp({
|
||||
[onClick]
|
||||
);
|
||||
|
||||
const _onExit = useCallback(
|
||||
(e) => {
|
||||
if (onExit) {
|
||||
onExit(e);
|
||||
}
|
||||
},
|
||||
[onExit]
|
||||
);
|
||||
|
||||
const _onClose = useCallback(
|
||||
(e) => {
|
||||
if (onClose) {
|
||||
@@ -147,7 +157,7 @@ export default function TPopUp({
|
||||
spotlightId="tPopupBtn1"
|
||||
onClick={() => {
|
||||
if (onClick) _onClick();
|
||||
else if (kind === "exit") onExit;
|
||||
else if (kind === "exitPopup") _onExit();
|
||||
else _onClose();
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -63,8 +63,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// kind
|
||||
// kind
|
||||
|
||||
.introTermsPopup {
|
||||
.default-style();
|
||||
@@ -84,20 +83,18 @@
|
||||
|
||||
.productDetail {
|
||||
.default-style();
|
||||
|
||||
|
||||
.info {
|
||||
.size(@w: 1100px , @h: 824px);
|
||||
padding: 60px 42px 30px 60px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
img {
|
||||
.size(@w: 200px, @h: 200px)
|
||||
.size(@w: 200px, @h: 200px);
|
||||
}
|
||||
|
||||
}
|
||||
.textPopup {
|
||||
.textPopup,
|
||||
.exitPopup {
|
||||
.default-style();
|
||||
|
||||
.info {
|
||||
|
||||
@@ -58,7 +58,13 @@ export default function IntroPanel({ children, ...rest }) {
|
||||
setShowExitButton(true);
|
||||
}, [showExitButton]);
|
||||
|
||||
const confirmExit = useCallback(() => {}, []);
|
||||
const confirmExit = useCallback(() => {
|
||||
if (typeof window === "object") {
|
||||
window.close();
|
||||
} else {
|
||||
window.location.relad();
|
||||
}
|
||||
}, [showExitButton]);
|
||||
|
||||
const cancelExit = useCallback(() => {
|
||||
setShowExitButton(false);
|
||||
@@ -141,7 +147,7 @@ export default function IntroPanel({ children, ...rest }) {
|
||||
|
||||
{/* DO NOT AGREE */}
|
||||
<TPopUp
|
||||
kind="textPopup"
|
||||
kind="exitPopup"
|
||||
open={showExitButton}
|
||||
onExit={confirmExit}
|
||||
onClose={cancelExit}
|
||||
|
||||
Reference in New Issue
Block a user