Compare commits

..

No commits in common. "778d3b6be8adb6fb883bb1f2477733f99ec2975a" and "69d81d892dea416bb426518222675a921f473c85" have entirely different histories.

6 changed files with 20 additions and 58 deletions

View File

@ -4,7 +4,4 @@
NEXT_PUBLIC_API_URL=http://localhost:3000
#qsp 로그인 api
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
#1:1문의 api
NEXT_PUBLIC_INQUIRY_API_URL=http://1.248.227.176:38080
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120

View File

@ -2,7 +2,4 @@
NEXT_PUBLIC_API_URL=http://172.30.1.35:3000
#qsp 로그인 api
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120
#1:1문의 api
NEXT_PUBLIC_INQUIRY_API_URL=http://1.248.227.176:38080
NEXT_PUBLIC_QSP_API_URL=http://1.248.227.176:8120

View File

@ -1,19 +1,10 @@
'use client'
import { usePopupController } from '@/store/popupController'
import React from 'react'
export default function DoubleBtnAlert() {
const { alertMsg, alert2BtnYes, alert2BtnNo, setAlert2 } = usePopupController()
const handleAlert2BtnYes = () => {
alert2BtnYes()
setAlert2(false)
}
const handleAlert2BtnNo = () => {
alert2BtnNo()
setAlert2(false)
}
const { alertMsg, alert2BtnYes, alert2BtnNo } = usePopupController()
return (
<div className="modal-popup alert">
@ -22,12 +13,12 @@ export default function DoubleBtnAlert() {
<div className="alert-tit">{alertMsg}</div>
<div className="alert-btn-wrap">
<div className="alert-btn-bx">
<button className="btn-frame red min" onClick={() => handleAlert2BtnYes()}>
<button className="btn-frame red min" onClick={() => alert2BtnYes()}>
</button>
</div>
<div className="alert-btn-bx">
<button className="btn-frame n-blue min" onClick={() => handleAlert2BtnNo()}>
<button className="btn-frame n-blue min" onClick={() => alert2BtnNo()}>
</button>
</div>

View File

@ -14,7 +14,6 @@ import { useTitle } from '@/hooks/useTitle'
import { axiosInstance } from '@/libs/axios'
import 'swiper/css'
import { confirmParamsSerialize } from '@/utils/window'
export default function Header() {
const router = useRouter()
@ -39,22 +38,6 @@ export default function Header() {
}
}
const handleYes = () => {
console.log('yes')
}
const handleNo = () => {
console.log('no')
}
const handleCofirm = () => {
window.neoConfirm(
'よろしいですか?',
() => console.log('yes'),
() => console.log('no'),
)
}
return (
<>
<div className="header-warp">
@ -62,7 +45,7 @@ export default function Header() {
<div className="header-inner">
{backBtn && (
<div className="back-button-wrap">
<button className="back-button" onClick={handleCofirm}></button>
<button className="back-button" onClick={() => router.back()}></button>
</div>
)}
<h2 className="logo">

View File

@ -7,12 +7,6 @@ import { usePathname } from 'next/navigation'
import { useEffect } from 'react'
import { useSessionStore } from '@/store/session'
declare global {
interface Window {
neoConfirm: (msg?: string, alertBtn2Yes?: Function, alertBtn2No?: Function) => boolean
}
}
interface EdgeProviderProps {
children: React.ReactNode
sessionData: string
@ -50,18 +44,25 @@ export default function EdgeProvider({ children, sessionData }: EdgeProviderProp
setAlert2(true)
}
//alert 함수 변경해서 바인딩
useEffect(() => {
//alert 함수 변경해서 바인딩
window.alert = function (msg, alertBtn = () => setAlert(false)) {
alertFunc(msg, alertBtn)
}
// confirm 함수 변경해서 바인딩
window.neoConfirm = function (msg: string | undefined, alertBtn2Yes?: Function, alertBtn2No?: Function) {
if (!msg) return false
alertFunc2(msg, alertBtn2Yes || (() => {}), alertBtn2No || (() => {}))
window.confirm = function (msg = '', alert2BtnYes = () => setAlert2(false), alert2BtnNo = () => setAlert2(false)) {
alertFunc2(
msg,
() => {
alert2BtnYes()
return true
},
() => {
alert2BtnNo()
return false
},
)
return false
}
// 서버 세션이 있으면 zuatand 세션 데이터 갱신
if (sessionData && sessionData !== '') {
setSession({
...session,

View File

@ -1,7 +0,0 @@
export const confirmParamsSerialize = ({ msg, yes, no }: { msg: string; yes: () => void; no: () => void }) => {
return JSON.stringify({ msg, yes, no })
}
export const confirmParamsDeserialize = (params: string) => {
return JSON.parse(params)
}