diff --git a/src/apis/popup.tsx b/src/apis/popup.tsx index e885d00..fceace9 100644 --- a/src/apis/popup.tsx +++ b/src/apis/popup.tsx @@ -24,11 +24,19 @@ export const useOpenPopUp = () => { setToken(mdl_tknValue); - window.open( + const width = 500; + const height = 400; + const left = window.screenX + (window.outerWidth - width) / 2; + const top = window.screenY + (window.outerHeight - height) / 2; + var popup = window.open( `/pass?mdl_tkn=${mdl_tknValue}`, '_blank', - 'resizable=no,width=570,height=830,left=50,top=50', + `resizable=no,width=${width},height=${height},left=${left},top=${top}`, ); + + popup!.onunload = function () { + alert('팝업이 닫혔습니다'); + }; }, }, );