@daeryun/dr_components 1.1.9 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asset/images/daeryuntalk/history-icon.png +0 -0
- package/dist/asset/images/daeryuntalk/history-new-badge.png +0 -0
- package/dist/asset/images/map/close.webp +0 -0
- package/dist/asset/images/map/expand.webp +0 -0
- package/dist/asset/images/map/map.webp +0 -0
- package/dist/asset/images/map/officeBtn/arrow.svg +6 -0
- package/dist/asset/images/map/officeBtn/home_icon.svg +10 -0
- package/dist/asset/images/map/share.webp +0 -0
- package/dist/asset/images/map/youtube.webp +0 -0
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/Daeryuntalk/ChatButton.jsx +2 -1
- package/dist/components/Daeryuntalk/ChatButton.tsx +2 -1
- package/dist/components/Daeryuntalk/ChatConversation.d.ts +7 -1
- package/dist/components/Daeryuntalk/ChatConversation.jsx +10 -8
- package/dist/components/Daeryuntalk/ChatConversation.tsx +25 -12
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.d.ts +7 -2
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.jsx +29 -9
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.tsx +53 -15
- package/dist/components/Daeryuntalk/ChatHomeView.d.ts +1 -1
- package/dist/components/Daeryuntalk/ChatHomeView.jsx +68 -46
- package/dist/components/Daeryuntalk/ChatHomeView.tsx +68 -66
- package/dist/components/Daeryuntalk/ChatInput.jsx +2 -1
- package/dist/components/Daeryuntalk/ChatInput.tsx +3 -1
- package/dist/components/Daeryuntalk/ChatItem/ChatFile.jsx +2 -1
- package/dist/components/Daeryuntalk/ChatItem/ChatFile.tsx +2 -1
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.d.ts +4 -1
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.jsx +2 -2
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.tsx +5 -2
- package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.tsx +0 -1
- package/dist/components/Daeryuntalk/ChatItem/RichText.tsx +0 -1
- package/dist/components/Daeryuntalk/ChatItem/TypingComp.jsx +2 -1
- package/dist/components/Daeryuntalk/ChatItem/TypingComp.tsx +2 -1
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowAuthForm.tsx +0 -1
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.tsx +0 -1
- package/dist/components/Daeryuntalk/ChatMessage.jsx +3 -2
- package/dist/components/Daeryuntalk/ChatMessage.tsx +3 -2
- package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.tsx +1 -0
- package/dist/components/Daeryuntalk/ChatObject/ObjectBack.jsx +1 -0
- package/dist/components/Daeryuntalk/ChatObject/ObjectBack.tsx +1 -1
- package/dist/components/Daeryuntalk/ChatWidget.jsx +1 -1
- package/dist/components/Daeryuntalk/ChatWidget.tsx +1 -1
- package/dist/components/Daeryuntalk/DaeryuntalkContext.d.ts +2 -0
- package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +12 -5
- package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +41 -31
- package/dist/components/Daeryuntalk/HistoryView.jsx +12 -9
- package/dist/components/Daeryuntalk/HistoryView.tsx +12 -9
- package/dist/components/Daeryuntalk/HomeView.jsx +7 -6
- package/dist/components/Daeryuntalk/HomeView.tsx +8 -6
- package/dist/components/Daeryuntalk/NavigationFooter.d.ts +1 -1
- package/dist/components/Daeryuntalk/NavigationFooter.jsx +1 -0
- package/dist/components/Daeryuntalk/NavigationFooter.tsx +3 -1
- package/dist/components/Daeryuntalk/NoticeMessage.jsx +1 -0
- package/dist/components/Daeryuntalk/NoticeMessage.tsx +1 -0
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.tsx +1 -0
- package/dist/components/Daeryuntalk/Toast/Toast.jsx +1 -1
- package/dist/components/Daeryuntalk/Toast/Toast.tsx +2 -2
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.jsx +4 -3
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.tsx +4 -5
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.jsx +5 -4
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +7 -5
- package/dist/components/Daeryuntalk/ViewportHandler.d.ts +6 -1
- package/dist/components/Daeryuntalk/ViewportHandler.jsx +21 -6
- package/dist/components/Daeryuntalk/ViewportHandler.tsx +26 -44
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +4 -2
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +77 -16
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +100 -17
- package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.d.ts +3 -4
- package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.js +15 -11
- package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.ts +15 -13
- package/dist/components/Daeryuntalk/_hooks/view/useHomeView.d.ts +0 -1
- package/dist/components/Daeryuntalk/_hooks/view/useHomeView.js +8 -6
- package/dist/components/Daeryuntalk/_hooks/view/useHomeView.ts +8 -7
- package/dist/components/Daeryuntalk/index.jsx +2 -11
- package/dist/components/Daeryuntalk/index.tsx +2 -12
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/components/common/types/map/index.d.ts +33 -0
- package/dist/components/common/types/map/index.js +1 -0
- package/dist/components/common/types/map/index.ts +34 -0
- package/dist/components/page/Login/LoginShareCheckContainer.jsx +6 -4
- package/dist/components/page/Login/LoginShareCheckContainer.tsx +6 -4
- package/dist/components/page/Login/_hooks/useAppLoginDetect.js +9 -7
- package/dist/components/page/Login/_hooks/useAppLoginDetect.ts +11 -8
- package/dist/components/page/MapPage/MapModal.d.ts +10 -0
- package/dist/components/page/MapPage/MapModal.jsx +48 -0
- package/dist/components/page/MapPage/MapModal.tsx +76 -0
- package/dist/components/page/MapPage/MapPage.d.ts +6 -0
- package/dist/components/page/MapPage/MapPage.jsx +147 -0
- package/dist/components/page/MapPage/MapPage.stories.d.ts +7 -0
- package/dist/components/page/MapPage/MapPage.stories.jsx +83 -0
- package/dist/components/page/MapPage/MapPage.stories.tsx +98 -0
- package/dist/components/page/MapPage/MapPage.tsx +197 -0
- package/dist/components/page/MapPage/MobileMapKeyDetail.d.ts +11 -0
- package/dist/components/page/MapPage/MobileMapKeyDetail.jsx +99 -0
- package/dist/components/page/MapPage/MobileMapKeyDetail.tsx +177 -0
- package/dist/components/page/MapPage/PcMapKeyDetail.d.ts +11 -0
- package/dist/components/page/MapPage/PcMapKeyDetail.jsx +99 -0
- package/dist/components/page/MapPage/PcMapKeyDetail.tsx +178 -0
- package/dist/components/page/index.d.ts +1 -0
- package/dist/components/page/index.js +1 -0
- package/dist/components/page/index.ts +1 -0
- package/dist/styles/globals.css +721 -375
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -7,11 +7,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
export const useHistoryView = ({ attendRoomByHistory, startSelectedChat, setViewState,
|
|
10
|
+
export const useHistoryView = ({ attendRoomByHistory, startSelectedChat, setViewState,
|
|
11
|
+
// setIsLoading,
|
|
12
|
+
createNewChat, goRequestPhone, goHistoryPhoneAuth,
|
|
13
|
+
// setPreviewState
|
|
14
|
+
chatInquiryNumber }) => {
|
|
11
15
|
const handleChatHistoryClick = (chatNumber) => __awaiter(void 0, void 0, void 0, function* () {
|
|
12
16
|
var _a, _b;
|
|
13
17
|
try {
|
|
14
|
-
setIsLoading(true);
|
|
18
|
+
// setIsLoading(true);
|
|
15
19
|
const response = yield attendRoomByHistory(chatNumber);
|
|
16
20
|
if (((_a = response === null || response === void 0 ? void 0 : response.result_info) === null || _a === void 0 ? void 0 : _a.result_cd) === 'OK' || ((_b = response === null || response === void 0 ? void 0 : response.result_info) === null || _b === void 0 ? void 0 : _b.result_type_cd) === 'OK') {
|
|
17
21
|
yield startSelectedChat(chatNumber);
|
|
@@ -22,13 +26,13 @@ export const useHistoryView = ({ attendRoomByHistory, startSelectedChat, setView
|
|
|
22
26
|
console.error('e', e);
|
|
23
27
|
}
|
|
24
28
|
finally {
|
|
25
|
-
setIsLoading(false);
|
|
29
|
+
// setIsLoading(false);
|
|
26
30
|
}
|
|
27
31
|
});
|
|
28
32
|
// 히스토리 + conversatoion 에서 사용
|
|
29
33
|
const handleNewStartChat = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
30
34
|
try {
|
|
31
|
-
setIsLoading(true);
|
|
35
|
+
// setIsLoading(true);
|
|
32
36
|
// 채팅 시작 - 새 문의 생성 또는 기존 문의 조회 처리
|
|
33
37
|
yield createNewChat();
|
|
34
38
|
// 대화 화면으로 전환
|
|
@@ -38,7 +42,7 @@ export const useHistoryView = ({ attendRoomByHistory, startSelectedChat, setView
|
|
|
38
42
|
console.error('신규 채팅 실패:', error);
|
|
39
43
|
}
|
|
40
44
|
finally {
|
|
41
|
-
setIsLoading(false);
|
|
45
|
+
// setIsLoading(false);
|
|
42
46
|
}
|
|
43
47
|
});
|
|
44
48
|
// 히스토리 점유 인증번호 요청
|
|
@@ -58,19 +62,19 @@ export const useHistoryView = ({ attendRoomByHistory, startSelectedChat, setView
|
|
|
58
62
|
return res;
|
|
59
63
|
});
|
|
60
64
|
const handleHistoryClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
|
-
setPreviewState('history');
|
|
65
|
+
// setPreviewState('history');
|
|
62
66
|
setViewState('history');
|
|
63
67
|
});
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
setViewState('
|
|
67
|
-
};
|
|
68
|
+
const handleBackClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
69
|
+
chatInquiryNumber && (yield startSelectedChat(chatInquiryNumber || ''));
|
|
70
|
+
setViewState('conversation');
|
|
71
|
+
});
|
|
68
72
|
return {
|
|
69
73
|
handleChatHistoryClick,
|
|
70
74
|
handleNewStartChat,
|
|
71
75
|
handleHistoryClick,
|
|
72
76
|
handleGoRequestPhone,
|
|
73
77
|
handleGoHistoryPhoneAuth,
|
|
74
|
-
|
|
78
|
+
handleBackClick
|
|
75
79
|
};
|
|
76
80
|
};
|
|
@@ -2,7 +2,7 @@ import { Dispatch, SetStateAction } from 'react';
|
|
|
2
2
|
import { ViewState } from '../../ChatHomeView';
|
|
3
3
|
|
|
4
4
|
interface IHistoryProps {
|
|
5
|
-
setIsLoading: Dispatch<SetStateAction<boolean>>;
|
|
5
|
+
// setIsLoading: Dispatch<SetStateAction<boolean>>;
|
|
6
6
|
setViewState: Dispatch<SetStateAction<ViewState>>;
|
|
7
7
|
attendRoomByHistory: (chatNumber: string) => any;
|
|
8
8
|
startSelectedChat: (chatNumber: string) => any;
|
|
@@ -17,22 +17,24 @@ interface IHistoryProps {
|
|
|
17
17
|
cellPhoneNumber: string;
|
|
18
18
|
certificationNumber: string;
|
|
19
19
|
}) => any;
|
|
20
|
-
|
|
20
|
+
chatInquiryNumber: string | null;
|
|
21
|
+
// setPreviewState: (state: ViewState) => void;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export const useHistoryView = ({
|
|
24
25
|
attendRoomByHistory,
|
|
25
26
|
startSelectedChat,
|
|
26
27
|
setViewState,
|
|
27
|
-
setIsLoading,
|
|
28
|
+
// setIsLoading,
|
|
28
29
|
createNewChat,
|
|
29
30
|
goRequestPhone,
|
|
30
31
|
goHistoryPhoneAuth,
|
|
31
|
-
setPreviewState
|
|
32
|
+
// setPreviewState
|
|
33
|
+
chatInquiryNumber
|
|
32
34
|
}: IHistoryProps) => {
|
|
33
35
|
const handleChatHistoryClick = async (chatNumber: string) => {
|
|
34
36
|
try {
|
|
35
|
-
setIsLoading(true);
|
|
37
|
+
// setIsLoading(true);
|
|
36
38
|
const response = await attendRoomByHistory(chatNumber);
|
|
37
39
|
if (response?.result_info?.result_cd === 'OK' || response?.result_info?.result_type_cd === 'OK') {
|
|
38
40
|
await startSelectedChat(chatNumber);
|
|
@@ -41,14 +43,14 @@ export const useHistoryView = ({
|
|
|
41
43
|
} catch (e) {
|
|
42
44
|
console.error('e', e);
|
|
43
45
|
} finally {
|
|
44
|
-
setIsLoading(false);
|
|
46
|
+
// setIsLoading(false);
|
|
45
47
|
}
|
|
46
48
|
};
|
|
47
49
|
|
|
48
50
|
// 히스토리 + conversatoion 에서 사용
|
|
49
51
|
const handleNewStartChat = async () => {
|
|
50
52
|
try {
|
|
51
|
-
setIsLoading(true);
|
|
53
|
+
// setIsLoading(true);
|
|
52
54
|
// 채팅 시작 - 새 문의 생성 또는 기존 문의 조회 처리
|
|
53
55
|
await createNewChat();
|
|
54
56
|
// 대화 화면으로 전환
|
|
@@ -56,7 +58,7 @@ export const useHistoryView = ({
|
|
|
56
58
|
} catch (error) {
|
|
57
59
|
console.error('신규 채팅 실패:', error);
|
|
58
60
|
} finally {
|
|
59
|
-
setIsLoading(false);
|
|
61
|
+
// setIsLoading(false);
|
|
60
62
|
}
|
|
61
63
|
};
|
|
62
64
|
|
|
@@ -79,13 +81,13 @@ export const useHistoryView = ({
|
|
|
79
81
|
};
|
|
80
82
|
|
|
81
83
|
const handleHistoryClick = async () => {
|
|
82
|
-
setPreviewState('history');
|
|
84
|
+
// setPreviewState('history');
|
|
83
85
|
setViewState('history');
|
|
84
86
|
};
|
|
85
87
|
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
setViewState('
|
|
88
|
+
const handleBackClick =async () => {
|
|
89
|
+
chatInquiryNumber && await startSelectedChat(chatInquiryNumber || '');
|
|
90
|
+
setViewState('conversation');
|
|
89
91
|
};
|
|
90
92
|
|
|
91
93
|
return {
|
|
@@ -94,6 +96,6 @@ export const useHistoryView = ({
|
|
|
94
96
|
handleHistoryClick,
|
|
95
97
|
handleGoRequestPhone,
|
|
96
98
|
handleGoHistoryPhoneAuth,
|
|
97
|
-
|
|
99
|
+
handleBackClick
|
|
98
100
|
};
|
|
99
101
|
};
|
|
@@ -14,6 +14,5 @@ interface IHomeProps {
|
|
|
14
14
|
export declare const useHomeView: ({ setIsLoading, setViewState, retryInquiryMain, inquiryMainData, startChat, preViewState, viewState, setPreviewState }: IHomeProps) => {
|
|
15
15
|
handleStartChat: () => Promise<void>;
|
|
16
16
|
handleHashStartChat: () => Promise<void>;
|
|
17
|
-
handleBackToHome: () => void;
|
|
18
17
|
};
|
|
19
18
|
export {};
|
|
@@ -51,14 +51,16 @@ export const useHomeView = ({ setIsLoading, setViewState, retryInquiryMain, inqu
|
|
|
51
51
|
setIsLoading(false);
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
const handleBackToHome = () => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
// const handleBackToHome = () => {
|
|
55
|
+
// if (preViewState === 'conversation') {
|
|
56
|
+
// setViewState('conversation');
|
|
57
|
+
// } else {
|
|
58
|
+
// setViewState('history');
|
|
59
|
+
// }
|
|
60
|
+
// };
|
|
59
61
|
return {
|
|
60
62
|
handleStartChat,
|
|
61
63
|
handleHashStartChat,
|
|
62
|
-
handleBackToHome
|
|
64
|
+
// handleBackToHome
|
|
63
65
|
};
|
|
64
66
|
};
|
|
@@ -13,7 +13,6 @@ interface IHomeProps {
|
|
|
13
13
|
viewState: ViewState;
|
|
14
14
|
setPreviewState: (state: ViewState) => void;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
16
|
export const useHomeView = ({
|
|
18
17
|
setIsLoading,
|
|
19
18
|
setViewState,
|
|
@@ -60,15 +59,17 @@ export const useHomeView = ({
|
|
|
60
59
|
setIsLoading(false);
|
|
61
60
|
}
|
|
62
61
|
};
|
|
63
|
-
const handleBackToHome = () => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
// const handleBackToHome = () => {
|
|
63
|
+
// if (preViewState === 'conversation') {
|
|
64
|
+
// setViewState('conversation');
|
|
65
|
+
// } else {
|
|
66
|
+
// setViewState('history');
|
|
67
|
+
// }
|
|
68
|
+
// };
|
|
68
69
|
|
|
69
70
|
return {
|
|
70
71
|
handleStartChat,
|
|
71
72
|
handleHashStartChat,
|
|
72
|
-
handleBackToHome
|
|
73
|
+
// handleBackToHome
|
|
73
74
|
};
|
|
74
75
|
};
|
|
@@ -7,13 +7,13 @@ import { DaeryuntalkToastProvider } from './Toast/DaeryuntalkToastProvider';
|
|
|
7
7
|
import mobile from 'is-mobile';
|
|
8
8
|
import Head from 'next/head';
|
|
9
9
|
import { usePathname } from 'next/navigation';
|
|
10
|
+
import ViewportHandler from './ViewportHandler';
|
|
10
11
|
const Daeryuntalk = ({ tel = '1800-7905', centerCode = 'CT0000', bannerHeight = 0 }) => {
|
|
11
12
|
const [isOpen, setIsOpen] = useState(false);
|
|
12
13
|
const [isMobile, setIsMobile] = useState(false);
|
|
13
14
|
const pathName = usePathname();
|
|
14
15
|
// const isMobile = mobile();
|
|
15
16
|
const [hashValue, setHashValue] = useState(null);
|
|
16
|
-
const isLocal = process.env.NODE_ENV === 'development';
|
|
17
17
|
const [showCustomTitle, setShowCustomTitle] = useState(false); // ← 추가
|
|
18
18
|
// 상태 관리 (컴포넌트 내부에 추가)
|
|
19
19
|
const [animationState, setAnimationState] = useState('hidden'); // 'hidden', 'entering', 'visible', 'exiting'
|
|
@@ -41,15 +41,6 @@ const Daeryuntalk = ({ tel = '1800-7905', centerCode = 'CT0000', bannerHeight =
|
|
|
41
41
|
else {
|
|
42
42
|
openModal();
|
|
43
43
|
}
|
|
44
|
-
// setIsOpen(prev => {
|
|
45
|
-
// if (prev) {
|
|
46
|
-
// openModal();
|
|
47
|
-
// return false;
|
|
48
|
-
// } else {
|
|
49
|
-
// // closeModal();
|
|
50
|
-
// return true;
|
|
51
|
-
// }
|
|
52
|
-
// });
|
|
53
44
|
};
|
|
54
45
|
useEffect(() => {
|
|
55
46
|
if (typeof window !== 'undefined') {
|
|
@@ -103,7 +94,7 @@ const Daeryuntalk = ({ tel = '1800-7905', centerCode = 'CT0000', bannerHeight =
|
|
|
103
94
|
<title>법무법인 (유한)대륜 채팅상담</title>
|
|
104
95
|
</Head>)}
|
|
105
96
|
<DaeryuntalkToastProvider>
|
|
106
|
-
|
|
97
|
+
<ViewportHandler isMobile={isMobile} isDisable={!isOpen || !isMobile}/>
|
|
107
98
|
<DaeryuntalkProvider propsTel={tel} isMobile={isMobile} onClose={closeModal} centerCode={currentCenterCode || ''}>
|
|
108
99
|
{isMobile ? (isOpen || !currentCenterCode ? null : (<ChatButton isOpen={isOpen} isMobile={isMobile} hashValue={hashValue} onClick={toggleChat}/>)) : !currentCenterCode ? null : (<ChatButton isOpen={isOpen} isMobile={isMobile} hashValue={hashValue} onClick={toggleChat} bannerHeight={bannerHeight}/>)}
|
|
109
100
|
<ChatWidget isOpen={hashValue ? true : isOpen} isMobile={isMobile} onClose={closeModal} hashValue={hashValue} setHashValue={setHashValue} animationState={animationState}/>
|
|
@@ -6,9 +6,9 @@ import ChatWidget from './ChatWidget';
|
|
|
6
6
|
import { DaeryuntalkProvider } from './DaeryuntalkContext';
|
|
7
7
|
import { DaeryuntalkToastProvider } from './Toast/DaeryuntalkToastProvider';
|
|
8
8
|
import mobile from 'is-mobile';
|
|
9
|
-
import ViewportHandler from './ViewportHandler';
|
|
10
9
|
import Head from 'next/head';
|
|
11
10
|
import { usePathname } from 'next/navigation';
|
|
11
|
+
import ViewportHandler from './ViewportHandler';
|
|
12
12
|
|
|
13
13
|
type DaeryuntalkProps = {
|
|
14
14
|
tel?: string;
|
|
@@ -23,7 +23,6 @@ const Daeryuntalk: React.FC<DaeryuntalkProps> = ({ tel = '1800-7905', centerCode
|
|
|
23
23
|
|
|
24
24
|
// const isMobile = mobile();
|
|
25
25
|
const [hashValue, setHashValue] = useState<string | null>(null);
|
|
26
|
-
const isLocal = process.env.NODE_ENV === 'development';
|
|
27
26
|
|
|
28
27
|
const [showCustomTitle, setShowCustomTitle] = useState(false); // ← 추가
|
|
29
28
|
|
|
@@ -55,15 +54,6 @@ const Daeryuntalk: React.FC<DaeryuntalkProps> = ({ tel = '1800-7905', centerCode
|
|
|
55
54
|
} else {
|
|
56
55
|
openModal();
|
|
57
56
|
}
|
|
58
|
-
// setIsOpen(prev => {
|
|
59
|
-
// if (prev) {
|
|
60
|
-
// openModal();
|
|
61
|
-
// return false;
|
|
62
|
-
// } else {
|
|
63
|
-
// // closeModal();
|
|
64
|
-
// return true;
|
|
65
|
-
// }
|
|
66
|
-
// });
|
|
67
57
|
};
|
|
68
58
|
useEffect(() => {
|
|
69
59
|
if (typeof window !== 'undefined') {
|
|
@@ -127,7 +117,7 @@ const Daeryuntalk: React.FC<DaeryuntalkProps> = ({ tel = '1800-7905', centerCode
|
|
|
127
117
|
</Head>
|
|
128
118
|
)}
|
|
129
119
|
<DaeryuntalkToastProvider>
|
|
130
|
-
|
|
120
|
+
<ViewportHandler isMobile={isMobile} isDisable={!isOpen || !isMobile} />
|
|
131
121
|
<DaeryuntalkProvider
|
|
132
122
|
propsTel={tel}
|
|
133
123
|
isMobile={isMobile}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface IMap {
|
|
2
|
+
modified_at: string;
|
|
3
|
+
idx: number;
|
|
4
|
+
key: string;
|
|
5
|
+
lat: string;
|
|
6
|
+
lng: string;
|
|
7
|
+
tab_name: string;
|
|
8
|
+
title: string;
|
|
9
|
+
sub_title: string;
|
|
10
|
+
address: string;
|
|
11
|
+
address_arr: string[] | null;
|
|
12
|
+
worktime: string;
|
|
13
|
+
tel: string;
|
|
14
|
+
parking_info: string | null;
|
|
15
|
+
parking_info_arr: string[] | null;
|
|
16
|
+
keyword: string;
|
|
17
|
+
description: string;
|
|
18
|
+
img: string | null;
|
|
19
|
+
thumbnail_img: string | null;
|
|
20
|
+
detail_img: string | null;
|
|
21
|
+
place_id: string | null;
|
|
22
|
+
domain: string | null;
|
|
23
|
+
modified_br_name: string | null;
|
|
24
|
+
br_code?: string | null;
|
|
25
|
+
}
|
|
26
|
+
export interface IOfficeListTypes {
|
|
27
|
+
tab_name: string;
|
|
28
|
+
m_sort: number | null;
|
|
29
|
+
key: string;
|
|
30
|
+
br_name: string | null;
|
|
31
|
+
modified_br_name?: string | null;
|
|
32
|
+
br_code?: string | null;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface IMap {
|
|
2
|
+
modified_at: string;
|
|
3
|
+
idx: number;
|
|
4
|
+
key: string;
|
|
5
|
+
lat: string;
|
|
6
|
+
lng: string;
|
|
7
|
+
tab_name: string;
|
|
8
|
+
title: string;
|
|
9
|
+
sub_title: string;
|
|
10
|
+
address: string;
|
|
11
|
+
address_arr: string[] | null;
|
|
12
|
+
worktime: string;
|
|
13
|
+
tel: string;
|
|
14
|
+
parking_info: string | null;
|
|
15
|
+
parking_info_arr: string[] | null;
|
|
16
|
+
keyword: string;
|
|
17
|
+
description: string;
|
|
18
|
+
img: string | null;
|
|
19
|
+
thumbnail_img: string | null;
|
|
20
|
+
detail_img: string | null;
|
|
21
|
+
place_id: string | null;
|
|
22
|
+
domain: string | null;
|
|
23
|
+
modified_br_name: string | null;
|
|
24
|
+
br_code?: string | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface IOfficeListTypes {
|
|
28
|
+
tab_name: string;
|
|
29
|
+
m_sort: number | null;
|
|
30
|
+
key: string;
|
|
31
|
+
br_name: string | null;
|
|
32
|
+
modified_br_name?: string | null;
|
|
33
|
+
br_code?: string | null;
|
|
34
|
+
}
|
|
@@ -189,10 +189,12 @@ const LoginShareCheckContainer = ({ children, setUserInfo }) => {
|
|
|
189
189
|
}
|
|
190
190
|
});
|
|
191
191
|
useEffect(() => {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
if (pathName) {
|
|
193
|
+
const routeCheck = CHECK_ROUTE.some(route => pathName.startsWith(route));
|
|
194
|
+
if (routeCheck) {
|
|
195
|
+
initializeUser();
|
|
196
|
+
handlePageTransitionCheck();
|
|
197
|
+
}
|
|
196
198
|
}
|
|
197
199
|
}, [pathName]);
|
|
198
200
|
return <>{children}</>;
|
|
@@ -201,10 +201,12 @@ const LoginShareCheckContainer = ({ children, setUserInfo }: Props) => {
|
|
|
201
201
|
};
|
|
202
202
|
|
|
203
203
|
useEffect(() => {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
if (pathName) {
|
|
205
|
+
const routeCheck = CHECK_ROUTE.some(route => pathName.startsWith(route));
|
|
206
|
+
if (routeCheck) {
|
|
207
|
+
initializeUser();
|
|
208
|
+
handlePageTransitionCheck();
|
|
209
|
+
}
|
|
208
210
|
}
|
|
209
211
|
}, [pathName]);
|
|
210
212
|
|
|
@@ -75,13 +75,15 @@ export const checkAppLoginDetect = (userInfo, setUserInfo, isThirdCookie) => __a
|
|
|
75
75
|
// useEffect에서 올바르게 사용
|
|
76
76
|
const useAppLoginDetect = (userInfo, pathname, setUserInfo) => {
|
|
77
77
|
useEffect(() => {
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
if (pathname) {
|
|
79
|
+
const checkLogin = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
+
const isCookie = yield checkThirdPartyCookie();
|
|
81
|
+
yield checkAppLoginDetect(userInfo, setUserInfo, isCookie);
|
|
82
|
+
});
|
|
83
|
+
const routeCheck = CHECK_ROUTE.some(route => pathname.startsWith(route));
|
|
84
|
+
if (routeCheck) {
|
|
85
|
+
checkLogin();
|
|
86
|
+
}
|
|
85
87
|
}
|
|
86
88
|
}, [userInfo, pathname]);
|
|
87
89
|
};
|
|
@@ -75,15 +75,18 @@ const useAppLoginDetect = (
|
|
|
75
75
|
setUserInfo: React.Dispatch<React.SetStateAction<ILoginInfo>>
|
|
76
76
|
) => {
|
|
77
77
|
useEffect(() => {
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
if(pathname){
|
|
79
|
+
const checkLogin = async () => {
|
|
80
|
+
const isCookie = await checkThirdPartyCookie();
|
|
81
|
+
await checkAppLoginDetect(userInfo, setUserInfo, isCookie);
|
|
82
|
+
};
|
|
83
|
+
const routeCheck = CHECK_ROUTE.some(route => pathname.startsWith(route));
|
|
84
|
+
|
|
85
|
+
if (routeCheck) {
|
|
86
|
+
checkLogin();
|
|
87
|
+
}
|
|
86
88
|
}
|
|
89
|
+
|
|
87
90
|
}, [userInfo, pathname]);
|
|
88
91
|
};
|
|
89
92
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IMap } from '../../common/types/map';
|
|
3
|
+
interface MapModalProps {
|
|
4
|
+
showModal: boolean;
|
|
5
|
+
setShowModal: (value: boolean) => void;
|
|
6
|
+
mapPath: string;
|
|
7
|
+
mapInfo: IMap;
|
|
8
|
+
}
|
|
9
|
+
declare const MapModal: ({ showModal, setShowModal, mapPath, mapInfo }: MapModalProps) => React.JSX.Element | null;
|
|
10
|
+
export default MapModal;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import imgClose from '../../../asset/images/map/close.webp';
|
|
5
|
+
const MapModal = ({ showModal, setShowModal, mapPath, mapInfo }) => {
|
|
6
|
+
const wrapperRef = React.useRef(null);
|
|
7
|
+
React.useEffect(() => {
|
|
8
|
+
const handleClickOutside = (event) => {
|
|
9
|
+
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
10
|
+
setShowModal(false);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
14
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
15
|
+
}, [setShowModal]);
|
|
16
|
+
if (!showModal)
|
|
17
|
+
return null;
|
|
18
|
+
return (<div>
|
|
19
|
+
<div className="fixed inset-0 z-50 flex items-center justify-center overflow-y-auto overflow-x-hidden outline-none focus:outline-none">
|
|
20
|
+
<div className="fixed inset-0 bg-black opacity-70"></div>
|
|
21
|
+
<div className="relative w-[90%] ">
|
|
22
|
+
<div className="relative mx-auto my-6 max-w-3xl overflow-x-auto" ref={wrapperRef}>
|
|
23
|
+
<div className="relative h-[auto] w-[45em] bg-white md:h-full md:w-full">
|
|
24
|
+
<Image src={`${mapPath}/${mapInfo.img}`} alt={mapInfo.title + ' 오시는길 약도'} width={1200} height={600} className="h-full md:rounded-[20px]"/>
|
|
25
|
+
</div>
|
|
26
|
+
<button onClick={() => {
|
|
27
|
+
setShowModal(false);
|
|
28
|
+
}} onKeyDown={e => {
|
|
29
|
+
if (e.key === 'Tab')
|
|
30
|
+
setShowModal(false);
|
|
31
|
+
}} className="absolute right-[16px] top-[16px] z-[9] hidden md:block">
|
|
32
|
+
<Image src={imgClose} alt="지도이미지 닫기" width={18} height={18}/>
|
|
33
|
+
</button>
|
|
34
|
+
</div>
|
|
35
|
+
<button onClick={() => {
|
|
36
|
+
setShowModal(false);
|
|
37
|
+
}} onKeyDown={e => {
|
|
38
|
+
if (e.key === 'Tab')
|
|
39
|
+
setShowModal(false);
|
|
40
|
+
}} className="absolute right-[3%] top-[10%] z-[999] md:hidden">
|
|
41
|
+
<Image src={imgClose} alt="지도이미지 닫기" width={18} height={18}/>
|
|
42
|
+
</button>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
<div className="fixed inset-0 z-40 bg-black opacity-25"></div>
|
|
46
|
+
</div>);
|
|
47
|
+
};
|
|
48
|
+
export default MapModal;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, { RefObject } from 'react';
|
|
4
|
+
import Image from 'next/image';
|
|
5
|
+
import { IMap } from '../../common/types/map';
|
|
6
|
+
import imgClose from '../../../asset/images/map/close.webp';
|
|
7
|
+
|
|
8
|
+
interface MapModalProps {
|
|
9
|
+
showModal: boolean;
|
|
10
|
+
setShowModal: (value: boolean) => void;
|
|
11
|
+
mapPath: string;
|
|
12
|
+
mapInfo: IMap;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const MapModal = ({ showModal, setShowModal, mapPath, mapInfo }: MapModalProps) => {
|
|
16
|
+
const wrapperRef = React.useRef<HTMLDivElement>(null);
|
|
17
|
+
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
const handleClickOutside = (event: MouseEvent) => {
|
|
20
|
+
if (wrapperRef.current && !wrapperRef.current.contains(event.target as Node)) {
|
|
21
|
+
setShowModal(false);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
26
|
+
return () => document.removeEventListener('mousedown', handleClickOutside);
|
|
27
|
+
}, [setShowModal]);
|
|
28
|
+
|
|
29
|
+
if (!showModal) return null;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div>
|
|
33
|
+
<div className="fixed inset-0 z-50 flex items-center justify-center overflow-y-auto overflow-x-hidden outline-none focus:outline-none">
|
|
34
|
+
<div className="fixed inset-0 bg-black opacity-70"></div>
|
|
35
|
+
<div className="relative w-[90%] ">
|
|
36
|
+
<div className="relative mx-auto my-6 max-w-3xl overflow-x-auto" ref={wrapperRef}>
|
|
37
|
+
<div className="relative h-[auto] w-[45em] bg-white md:h-full md:w-full">
|
|
38
|
+
<Image
|
|
39
|
+
src={`${mapPath}/${mapInfo.img}`}
|
|
40
|
+
alt={mapInfo.title + ' 오시는길 약도'}
|
|
41
|
+
width={1200}
|
|
42
|
+
height={600}
|
|
43
|
+
className="h-full md:rounded-[20px]"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
<button
|
|
47
|
+
onClick={() => {
|
|
48
|
+
setShowModal(false);
|
|
49
|
+
}}
|
|
50
|
+
onKeyDown={e => {
|
|
51
|
+
if (e.key === 'Tab') setShowModal(false);
|
|
52
|
+
}}
|
|
53
|
+
className="absolute right-[16px] top-[16px] z-[9] hidden md:block"
|
|
54
|
+
>
|
|
55
|
+
<Image src={imgClose} alt="지도이미지 닫기" width={18} height={18} />
|
|
56
|
+
</button>
|
|
57
|
+
</div>
|
|
58
|
+
<button
|
|
59
|
+
onClick={() => {
|
|
60
|
+
setShowModal(false);
|
|
61
|
+
}}
|
|
62
|
+
onKeyDown={e => {
|
|
63
|
+
if (e.key === 'Tab') setShowModal(false);
|
|
64
|
+
}}
|
|
65
|
+
className="absolute right-[3%] top-[10%] z-[999] md:hidden"
|
|
66
|
+
>
|
|
67
|
+
<Image src={imgClose} alt="지도이미지 닫기" width={18} height={18} />
|
|
68
|
+
</button>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
<div className="fixed inset-0 z-40 bg-black opacity-25"></div>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default MapModal;
|