@daeryun/dr_components 0.8.47 → 0.8.48
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/close.svg +2 -2
- package/dist/asset/images/daeryuntalk/time.svg +2 -2
- package/dist/asset/images/daeryuntalk/viewer/zoom-out.svg +2 -4
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/Daeryuntalk/ChatButton.jsx +5 -2
- package/dist/components/Daeryuntalk/ChatButton.tsx +5 -2
- package/dist/components/Daeryuntalk/ChatConversation.d.ts +2 -0
- package/dist/components/Daeryuntalk/ChatConversation.jsx +22 -63
- package/dist/components/Daeryuntalk/ChatConversation.tsx +42 -79
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.d.ts +11 -0
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.jsx +27 -0
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.tsx +57 -0
- package/dist/components/Daeryuntalk/ChatHomeView.d.ts +3 -2
- package/dist/components/Daeryuntalk/ChatHomeView.jsx +59 -181
- package/dist/components/Daeryuntalk/ChatHomeView.tsx +102 -206
- package/dist/components/Daeryuntalk/ChatItem/ChatFile.jsx +15 -14
- package/dist/components/Daeryuntalk/ChatItem/ChatFile.tsx +15 -14
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.d.ts +3 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.jsx +11 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.tsx +21 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.jsx +4 -4
- package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.tsx +4 -4
- package/dist/components/Daeryuntalk/ChatItem/RichText.jsx +2 -1
- package/dist/components/Daeryuntalk/ChatItem/RichText.tsx +2 -1
- package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.d.ts +9 -0
- package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.jsx +9 -0
- package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.tsx +20 -0
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.jsx +3 -3
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.tsx +3 -3
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.jsx +2 -2
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.tsx +2 -2
- package/dist/components/Daeryuntalk/ChatMessage.d.ts +1 -0
- package/dist/components/Daeryuntalk/ChatMessage.jsx +31 -36
- package/dist/components/Daeryuntalk/ChatMessage.tsx +34 -38
- package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.jsx +2 -2
- package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.tsx +2 -2
- package/dist/components/Daeryuntalk/ChatObject/ObjectBack.jsx +1 -1
- package/dist/components/Daeryuntalk/ChatObject/ObjectBack.tsx +1 -1
- package/dist/components/Daeryuntalk/ChatObject/ObjectButton.jsx +6 -23
- package/dist/components/Daeryuntalk/ChatObject/ObjectButton.tsx +6 -23
- package/dist/components/Daeryuntalk/ChatWidget.jsx +60 -23
- package/dist/components/Daeryuntalk/ChatWidget.tsx +72 -34
- package/dist/components/Daeryuntalk/DaeryuntalkContext.d.ts +2 -2
- package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +2 -2
- package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +5 -5
- package/dist/components/Daeryuntalk/DateSeparator.jsx +2 -2
- package/dist/components/Daeryuntalk/DateSeparator.tsx +2 -2
- package/dist/components/Daeryuntalk/FixedErrorBox.d.ts +7 -0
- package/dist/components/Daeryuntalk/FixedErrorBox.jsx +33 -0
- package/dist/components/Daeryuntalk/FixedErrorBox.tsx +73 -0
- package/dist/components/Daeryuntalk/History/AuthForm.d.ts +3 -1
- package/dist/components/Daeryuntalk/History/AuthForm.jsx +15 -45
- package/dist/components/Daeryuntalk/History/AuthForm.tsx +21 -53
- package/dist/components/Daeryuntalk/HistoryView.d.ts +4 -0
- package/dist/components/Daeryuntalk/HistoryView.jsx +17 -40
- package/dist/components/Daeryuntalk/HistoryView.tsx +36 -48
- package/dist/components/Daeryuntalk/HomeView.d.ts +12 -0
- package/dist/components/Daeryuntalk/HomeView.jsx +102 -0
- package/dist/components/Daeryuntalk/HomeView.tsx +150 -0
- package/dist/components/Daeryuntalk/NavigationFooter.jsx +17 -10
- package/dist/components/Daeryuntalk/NavigationFooter.tsx +22 -12
- package/dist/components/Daeryuntalk/NoticeMessage.jsx +7 -7
- package/dist/components/Daeryuntalk/NoticeMessage.tsx +7 -7
- package/dist/components/Daeryuntalk/Toast/ToastRender.jsx +1 -1
- package/dist/components/Daeryuntalk/Toast/ToastRender.tsx +2 -2
- package/dist/components/Daeryuntalk/Viewer/ImageViewer.d.ts +6 -0
- package/dist/components/Daeryuntalk/Viewer/ImageViewer.jsx +18 -90
- package/dist/components/Daeryuntalk/Viewer/ImageViewer.tsx +49 -135
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.d.ts +16 -0
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.jsx +66 -0
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.tsx +121 -0
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.d.ts +22 -0
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.jsx +104 -0
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +195 -0
- package/dist/components/Daeryuntalk/_api/daeryuntalk/index.d.ts +4 -3
- package/dist/components/Daeryuntalk/_api/daeryuntalk/index.js +81 -105
- package/dist/components/Daeryuntalk/_api/daeryuntalk/index.ts +105 -121
- package/dist/components/Daeryuntalk/_enums/ask-status.d.ts +7 -0
- package/dist/components/Daeryuntalk/_enums/ask-status.js +14 -0
- package/dist/components/Daeryuntalk/_enums/ask-status.ts +14 -0
- package/dist/components/Daeryuntalk/_enums/error.d.ts +3 -0
- package/dist/components/Daeryuntalk/_enums/error.js +125 -0
- package/dist/components/Daeryuntalk/_enums/error.ts +143 -0
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.d.ts +8 -8
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.js +227 -179
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.ts +261 -185
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.d.ts +1 -1
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.js +54 -18
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.ts +68 -15
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +2 -2
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +8 -7
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +13 -6
- package/dist/components/Daeryuntalk/_hooks/view/useChatSocketState.d.ts +2 -0
- package/dist/components/Daeryuntalk/_hooks/{talkprovider → view}/useChatSocketState.js +7 -1
- package/dist/components/Daeryuntalk/_hooks/{talkprovider → view}/useChatSocketState.ts +13 -1
- package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.d.ts +26 -0
- package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.js +72 -0
- package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.ts +93 -0
- package/dist/components/Daeryuntalk/_hooks/view/useHomeView.d.ts +16 -0
- package/dist/components/Daeryuntalk/_hooks/view/useHomeView.js +61 -0
- package/dist/components/Daeryuntalk/_hooks/view/useHomeView.ts +64 -0
- package/dist/components/Daeryuntalk/_lib/utils.d.ts +1 -0
- package/dist/components/Daeryuntalk/_lib/utils.js +27 -0
- package/dist/components/Daeryuntalk/_lib/utils.ts +33 -0
- package/dist/components/Daeryuntalk/_ui/buttons/Button2.jsx +3 -3
- package/dist/components/Daeryuntalk/_ui/buttons/Button2.tsx +3 -3
- package/dist/components/Daeryuntalk/_ui/buttons/Button3.d.ts +10 -0
- package/dist/components/Daeryuntalk/_ui/buttons/Button3.jsx +12 -0
- package/dist/components/Daeryuntalk/_ui/buttons/Button3.tsx +29 -0
- package/dist/components/Daeryuntalk/_ui/inputs/Input2.jsx +2 -1
- package/dist/components/Daeryuntalk/_ui/inputs/Input2.tsx +2 -1
- package/dist/components/Daeryuntalk/index.jsx +1 -1
- package/dist/components/Daeryuntalk/index.tsx +12 -1
- package/dist/styles/globals.css +510 -168
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/components/Daeryuntalk/_enums/error_code.d.ts +0 -21
- package/dist/components/Daeryuntalk/_enums/error_code.js +0 -23
- package/dist/components/Daeryuntalk/_enums/error_code.ts +0 -22
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatSocketState.d.ts +0 -1
|
@@ -3,40 +3,77 @@ import ChatHomeView from './ChatHomeView';
|
|
|
3
3
|
import ImageViewer from './Viewer/ImageViewer';
|
|
4
4
|
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
5
5
|
import ShadowBox from './_ui/ShadowBox';
|
|
6
|
-
import ToastRenderer from './Toast/ToastRender';
|
|
7
6
|
const ChatWidget = ({ isOpen, isMobile, onClose, hashValue, setHashValue }) => {
|
|
8
7
|
const { containerRef, isScroll, isBottom } = useScrollShadow();
|
|
9
|
-
const isHash = !!hashValue;
|
|
8
|
+
const isHash = !!hashValue; // 해쉬 있을 경우
|
|
9
|
+
// 모바일 웹
|
|
10
|
+
const mobileWrapperCss = `
|
|
11
|
+
fixed inset-0 h-[100dvh] w-screen max-w-[100vw] max-h-[100dvh] bg-white z-[999998] rounded-none flex flex-col
|
|
12
|
+
duration-500 ease-in-out
|
|
13
|
+
${isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
14
|
+
`;
|
|
15
|
+
// 웹 모바일 ~480px
|
|
16
|
+
const webSmallWrapperCss = `
|
|
17
|
+
${isHash ? `` : `duration-300 ease-in-out`}
|
|
18
|
+
|
|
19
|
+
${isHash ? '' : isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
20
|
+
fixed w-screen max-w-[100vw] z-[999998] rounded-none flex flex-col
|
|
21
|
+
bottom-0 right-0 h-[100dvh]
|
|
22
|
+
`;
|
|
23
|
+
// 해쉬 있을 경우는 여기서 중앙배치 css로
|
|
24
|
+
const webTbPCWrapperCss = `
|
|
25
|
+
${isHash ? '' : 'duration-300 ease-in-out'}
|
|
26
|
+
${isHash ? '' : isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
27
|
+
${isHash
|
|
28
|
+
? `
|
|
29
|
+
xs:fixed xs:flex xs:justify-center xs:items-center xs:inset-0 xs:bg-white
|
|
30
|
+
xs:w-screen xs:h-[100dvh] xs:inset-0 xs:pt-[70px]
|
|
31
|
+
|
|
32
|
+
`
|
|
33
|
+
: `
|
|
34
|
+
xs:bottom-[165px] xs:right-[30px] xs:max-w-[400px]
|
|
35
|
+
xs:max-h-[calc(100vh-165px)] xs:rounded-[30px]
|
|
36
|
+
lg:bottom-[110px] lg:max-h-[calc(100vh-110px)]
|
|
37
|
+
`}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
`;
|
|
41
|
+
// // // // //
|
|
42
|
+
const innerMobileWrapperCss = `
|
|
43
|
+
rounded-none sm:max-w-[640px] sm:m-auto
|
|
44
|
+
`;
|
|
45
|
+
const innerWebSmallWrapperCss = `
|
|
46
|
+
rounded-none
|
|
47
|
+
xs:max-h-[690px]
|
|
48
|
+
xs:mx-[10px] xs:shadow-[0px_4px_10px_0px_#00000026]
|
|
49
|
+
`;
|
|
50
|
+
// 웹 480~1023px , pc 1024px~
|
|
51
|
+
const innerWebTbPCWrapperCss = `
|
|
52
|
+
|
|
53
|
+
xs:rounded-[30px]
|
|
54
|
+
`;
|
|
55
|
+
// 웹 모바일
|
|
56
|
+
// 태블릿 크기 이상
|
|
10
57
|
return (<>
|
|
11
58
|
<ImageViewer />
|
|
12
59
|
|
|
13
60
|
<div className="relative z-[999998] ">
|
|
14
61
|
<div className={`
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
bg-white shadow-[0px_4px_10px_0px_#00000026]
|
|
18
|
-
${isMobile ? '' : 'duration-300 ease-in-out'}
|
|
19
|
-
${isHash && isMobile
|
|
20
|
-
? 'inset-0 h-[100dvh] w-screen rounded-none'
|
|
21
|
-
: isMobile || isHash
|
|
22
|
-
? 'inset-0 h-[100dvh] w-screen rounded-none'
|
|
23
|
-
: 'bottom-[165px] right-[30px] max-w-[390px] rounded-[30px] lg:bottom-[110px]'}
|
|
62
|
+
flex justify-end
|
|
63
|
+
${isMobile ? `${mobileWrapperCss}` : `${webSmallWrapperCss} ${webTbPCWrapperCss} `}
|
|
24
64
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<div ref={containerRef} className={`${isMobile ? 'rounded-none' : 'rounded-[30px]'} no-scrollbar relative flex h-full items-center justify-center overflow-auto bg-white`}>
|
|
34
|
-
<ChatHomeView hashValue={hashValue} setHashValue={setHashValue} isMobile={isMobile} isHash={isHash}/>
|
|
65
|
+
`}>
|
|
66
|
+
{/*모바일일 경우 전체 를 차지*/}
|
|
67
|
+
<div ref={containerRef} className={`
|
|
68
|
+
no-scrollbar relative flex h-full items-center justify-center overflow-auto
|
|
69
|
+
${isMobile ? `${innerMobileWrapperCss}` : `${innerWebSmallWrapperCss} ${innerWebTbPCWrapperCss}`}
|
|
70
|
+
`}>
|
|
71
|
+
{/*className={`${isMobile ? 'rounded-none' : 'rounded-[30px]'} no-scrollbar relative flex h-full items-center justify-center overflow-auto bg-white`}*/}
|
|
72
|
+
<ChatHomeView hashValue={hashValue} isMobile={isMobile} isHash={isHash} onClose={onClose}/>
|
|
35
73
|
</div>
|
|
36
74
|
|
|
37
75
|
{/* 투명 그라데이션 그림자 표시 */}
|
|
38
|
-
{
|
|
39
|
-
{!isMobile && !isHash && <ToastRenderer />}
|
|
76
|
+
{isScroll && !isBottom && <ShadowBox />}
|
|
40
77
|
</div>
|
|
41
78
|
</div>
|
|
42
79
|
</>);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React, { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import ChatHomeView from './ChatHomeView';
|
|
3
3
|
import ImageViewer from './Viewer/ImageViewer';
|
|
4
|
-
import { DaeryuntalkToastProvider } from './Toast/DaeryuntalkToastProvider';
|
|
5
4
|
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
6
5
|
import ShadowBox from './_ui/ShadowBox';
|
|
7
|
-
import ToastRenderer from './Toast/ToastRender';
|
|
8
6
|
|
|
9
7
|
interface ChatWidgetProps {
|
|
10
8
|
isOpen: boolean;
|
|
@@ -16,7 +14,66 @@ interface ChatWidgetProps {
|
|
|
16
14
|
|
|
17
15
|
const ChatWidget: React.FC<ChatWidgetProps> = ({ isOpen, isMobile, onClose, hashValue, setHashValue }) => {
|
|
18
16
|
const { containerRef, isScroll, isBottom } = useScrollShadow<HTMLDivElement>();
|
|
19
|
-
const isHash = !!hashValue;
|
|
17
|
+
const isHash = !!hashValue; // 해쉬 있을 경우
|
|
18
|
+
|
|
19
|
+
// 모바일 웹
|
|
20
|
+
const mobileWrapperCss = `
|
|
21
|
+
fixed inset-0 h-[100dvh] w-screen max-w-[100vw] max-h-[100dvh] bg-white z-[999998] rounded-none flex flex-col
|
|
22
|
+
duration-500 ease-in-out
|
|
23
|
+
${isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
// 웹 모바일 ~480px
|
|
27
|
+
const webSmallWrapperCss = `
|
|
28
|
+
${isHash ? `` : `duration-300 ease-in-out`}
|
|
29
|
+
|
|
30
|
+
${isHash ? '' : isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
31
|
+
fixed w-screen max-w-[100vw] z-[999998] rounded-none flex flex-col
|
|
32
|
+
bottom-0 right-0 h-[100dvh]
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
// 해쉬 있을 경우는 여기서 중앙배치 css로
|
|
36
|
+
const webTbPCWrapperCss = `
|
|
37
|
+
${isHash ? '' : 'duration-300 ease-in-out'}
|
|
38
|
+
${isHash ? '' : isOpen ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0 pointer-events-none'}
|
|
39
|
+
${
|
|
40
|
+
isHash
|
|
41
|
+
? `
|
|
42
|
+
xs:fixed xs:flex xs:justify-center xs:items-center xs:inset-0 xs:bg-white
|
|
43
|
+
xs:w-screen xs:h-[100dvh] xs:inset-0 xs:pt-[70px]
|
|
44
|
+
|
|
45
|
+
`
|
|
46
|
+
: `
|
|
47
|
+
xs:bottom-[165px] xs:right-[30px] xs:max-w-[400px]
|
|
48
|
+
xs:max-h-[calc(100vh-165px)] xs:rounded-[30px]
|
|
49
|
+
lg:bottom-[110px] lg:max-h-[calc(100vh-110px)]
|
|
50
|
+
`
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
// // // // //
|
|
57
|
+
const innerMobileWrapperCss = `
|
|
58
|
+
rounded-none sm:max-w-[640px] sm:m-auto
|
|
59
|
+
`;
|
|
60
|
+
|
|
61
|
+
const innerWebSmallWrapperCss = `
|
|
62
|
+
rounded-none
|
|
63
|
+
xs:max-h-[690px]
|
|
64
|
+
xs:mx-[10px] xs:shadow-[0px_4px_10px_0px_#00000026]
|
|
65
|
+
`;
|
|
66
|
+
|
|
67
|
+
// 웹 480~1023px , pc 1024px~
|
|
68
|
+
const innerWebTbPCWrapperCss = `
|
|
69
|
+
|
|
70
|
+
xs:rounded-[30px]
|
|
71
|
+
`;
|
|
72
|
+
|
|
73
|
+
// 웹 모바일
|
|
74
|
+
|
|
75
|
+
// 태블릿 크기 이상
|
|
76
|
+
|
|
20
77
|
return (
|
|
21
78
|
<>
|
|
22
79
|
<ImageViewer />
|
|
@@ -24,44 +81,25 @@ const ChatWidget: React.FC<ChatWidgetProps> = ({ isOpen, isMobile, onClose, hash
|
|
|
24
81
|
<div className="relative z-[999998] ">
|
|
25
82
|
<div
|
|
26
83
|
className={`
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
${
|
|
32
|
-
isHash && isMobile
|
|
33
|
-
? 'inset-0 h-[100dvh] w-screen rounded-none'
|
|
34
|
-
: isMobile || isHash
|
|
35
|
-
? 'inset-0 h-[100dvh] w-screen rounded-none'
|
|
36
|
-
: 'bottom-[165px] right-[30px] max-w-[390px] rounded-[30px] lg:bottom-[110px]'
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
${
|
|
40
|
-
isMobile
|
|
41
|
-
? isOpen
|
|
42
|
-
? 'translate-y-0'
|
|
43
|
-
: 'translate-y-full'
|
|
44
|
-
: isOpen
|
|
45
|
-
? 'translate-y-0 scale-100 opacity-100'
|
|
46
|
-
: 'pointer-events-none translate-y-6 opacity-0'
|
|
47
|
-
}
|
|
48
|
-
`}
|
|
84
|
+
flex justify-end
|
|
85
|
+
${isMobile ? `${mobileWrapperCss}` : `${webSmallWrapperCss} ${webTbPCWrapperCss} `}
|
|
86
|
+
|
|
87
|
+
`}
|
|
49
88
|
>
|
|
89
|
+
{/*모바일일 경우 전체 를 차지*/}
|
|
50
90
|
<div
|
|
51
91
|
ref={containerRef}
|
|
52
|
-
className={
|
|
92
|
+
className={`
|
|
93
|
+
no-scrollbar relative flex h-full items-center justify-center overflow-auto
|
|
94
|
+
${isMobile ? `${innerMobileWrapperCss}` : `${innerWebSmallWrapperCss} ${innerWebTbPCWrapperCss}`}
|
|
95
|
+
`}
|
|
53
96
|
>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
setHashValue={setHashValue}
|
|
57
|
-
isMobile={isMobile}
|
|
58
|
-
isHash={isHash}
|
|
59
|
-
/>
|
|
97
|
+
{/*className={`${isMobile ? 'rounded-none' : 'rounded-[30px]'} no-scrollbar relative flex h-full items-center justify-center overflow-auto bg-white`}*/}
|
|
98
|
+
<ChatHomeView hashValue={hashValue} isMobile={isMobile} isHash={isHash} onClose={onClose} />
|
|
60
99
|
</div>
|
|
61
100
|
|
|
62
101
|
{/* 투명 그라데이션 그림자 표시 */}
|
|
63
|
-
{
|
|
64
|
-
{!isMobile && !isHash && <ToastRenderer />}
|
|
102
|
+
{isScroll && !isBottom && <ShadowBox />}
|
|
65
103
|
</div>
|
|
66
104
|
</div>
|
|
67
105
|
</>
|
|
@@ -7,10 +7,10 @@ type DaeryuntalkContextType = {
|
|
|
7
7
|
inquiryStatus: string;
|
|
8
8
|
messageObject: MessageObject | null;
|
|
9
9
|
isNextPage: boolean | null;
|
|
10
|
-
isConnected: boolean;
|
|
10
|
+
isConnected: boolean | null;
|
|
11
11
|
isLoading: boolean;
|
|
12
12
|
sendMessage: (htmlContent: string, jsonData: any) => void;
|
|
13
|
-
initializeDaeryuntalk: (hashValue: string, version?: string) => void;
|
|
13
|
+
initializeDaeryuntalk: (hashValue: string, isOpen: boolean, version?: string) => void;
|
|
14
14
|
startChat: (inquiryNumber?: string) => Promise<any>;
|
|
15
15
|
createNewChat: () => void;
|
|
16
16
|
startWorkFlow: (data: {
|
|
@@ -19,7 +19,7 @@ const DaeryuntalkContext = createContext({
|
|
|
19
19
|
messageObject: null,
|
|
20
20
|
isNextPage: null,
|
|
21
21
|
//
|
|
22
|
-
isConnected:
|
|
22
|
+
isConnected: null,
|
|
23
23
|
isLoading: false,
|
|
24
24
|
sendMessage: () => { },
|
|
25
25
|
initializeDaeryuntalk: () => { },
|
|
@@ -105,7 +105,7 @@ export const DaeryuntalkProvider = ({ children, propsTel }) => {
|
|
|
105
105
|
});
|
|
106
106
|
// 이미지 뷰어용
|
|
107
107
|
const { isImageViewerOpen, selectedImageFile, imageViewerMessage, openImageViewer, closeImageViewer } = useViewerHook();
|
|
108
|
-
//
|
|
108
|
+
// 폰 요청
|
|
109
109
|
const { goRequestPhone, goHistoryPhoneAuth, goGetHistoryList } = useHistoryHandler({
|
|
110
110
|
setIsAuthenticated,
|
|
111
111
|
setHistoryList
|
|
@@ -13,10 +13,10 @@ type DaeryuntalkContextType = {
|
|
|
13
13
|
messageObject: MessageObject | null;
|
|
14
14
|
isNextPage: boolean | null;
|
|
15
15
|
|
|
16
|
-
isConnected: boolean;
|
|
16
|
+
isConnected: boolean | null;
|
|
17
17
|
isLoading: boolean;
|
|
18
18
|
sendMessage: (htmlContent: string, jsonData: any) => void;
|
|
19
|
-
initializeDaeryuntalk: (hashValue: string, version?: string) => void;
|
|
19
|
+
initializeDaeryuntalk: (hashValue: string, isOpen: boolean, version?: string) => void;
|
|
20
20
|
startChat: (inquiryNumber?: string) => Promise<any>;
|
|
21
21
|
createNewChat: () => void;
|
|
22
22
|
startWorkFlow: (data: {
|
|
@@ -87,7 +87,7 @@ const DaeryuntalkContext = createContext<DaeryuntalkContextType>({
|
|
|
87
87
|
messageObject: null,
|
|
88
88
|
isNextPage: null,
|
|
89
89
|
//
|
|
90
|
-
isConnected:
|
|
90
|
+
isConnected: null,
|
|
91
91
|
isLoading: false,
|
|
92
92
|
sendMessage: () => {},
|
|
93
93
|
initializeDaeryuntalk: () => {},
|
|
@@ -146,7 +146,7 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({ childr
|
|
|
146
146
|
const [chatInquiryNumber, setChatInquiryNumber] = useState<string | null>(null);
|
|
147
147
|
|
|
148
148
|
// 전역 소켓 연결 상태
|
|
149
|
-
const [isConnected, setIsConnected] = useState<boolean>(false);
|
|
149
|
+
const [isConnected, setIsConnected] = useState<boolean | null>(false);
|
|
150
150
|
const [isLoading, setIsLoading] = useState<boolean>(false);
|
|
151
151
|
const [inquiryMainData, setInquiryMainData] = useState<IChatInquiryMainDataResponse | null>(null);
|
|
152
152
|
|
|
@@ -209,7 +209,7 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({ childr
|
|
|
209
209
|
const { isImageViewerOpen, selectedImageFile, imageViewerMessage, openImageViewer, closeImageViewer } =
|
|
210
210
|
useViewerHook();
|
|
211
211
|
|
|
212
|
-
//
|
|
212
|
+
// 폰 요청
|
|
213
213
|
const { goRequestPhone, goHistoryPhoneAuth, goGetHistoryList } = useHistoryHandler({
|
|
214
214
|
setIsAuthenticated,
|
|
215
215
|
setHistoryList
|
|
@@ -6,8 +6,8 @@ const DateSeparator = ({ date }) => {
|
|
|
6
6
|
const day = date.getDate();
|
|
7
7
|
return `${year}년 ${month}월 ${day}일`;
|
|
8
8
|
};
|
|
9
|
-
return (<div className="mb-
|
|
10
|
-
<div className="
|
|
9
|
+
return (<div className="mb-[20px] flex items-center justify-center">
|
|
10
|
+
<div className="dr_talk_body_small1 text-drTalkGrayscale3">{formatDate(date)}</div>
|
|
11
11
|
</div>);
|
|
12
12
|
};
|
|
13
13
|
export default DateSeparator;
|
|
@@ -14,8 +14,8 @@ const DateSeparator: React.FC<DateSeparatorProps> = ({ date }) => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
return (
|
|
17
|
-
<div className="mb-
|
|
18
|
-
<div className="
|
|
17
|
+
<div className="mb-[20px] flex items-center justify-center">
|
|
18
|
+
<div className="dr_talk_body_small1 text-drTalkGrayscale3">{formatDate(date)}</div>
|
|
19
19
|
</div>
|
|
20
20
|
);
|
|
21
21
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
const FixedErrorBox = ({ isError = false, message = '네트워크 연결이 원활하지 않습니다.' }) => {
|
|
3
|
+
const WarningIcon = ({ className = '' }) => {
|
|
4
|
+
return (<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" className={className}>
|
|
5
|
+
<g clipPath="url(#clip0_1775_25245)">
|
|
6
|
+
<path d="M3 12C3 13.1819 3.23279 14.3522 3.68508 15.4442C4.13738 16.5361 4.80031 17.5282 5.63604 18.364C6.47177 19.1997 7.46392 19.8626 8.55585 20.3149C9.64778 20.7672 10.8181 21 12 21C13.1819 21 14.3522 20.7672 15.4442 20.3149C16.5361 19.8626 17.5282 19.1997 18.364 18.364C19.1997 17.5282 19.8626 16.5361 20.3149 15.4442C20.7672 14.3522 21 13.1819 21 12C21 9.61305 20.0518 7.32387 18.364 5.63604C16.6761 3.94821 14.3869 3 12 3C9.61305 3 7.32387 3.94821 5.63604 5.63604C3.94821 7.32387 3 9.61305 3 12Z" stroke="white" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
7
|
+
<path d="M12 16V16.01" stroke="white" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
8
|
+
<path d="M12 8.5L12 13" stroke="white" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/>
|
|
9
|
+
</g>
|
|
10
|
+
<defs>
|
|
11
|
+
<clipPath id="clip0_1775_25245">
|
|
12
|
+
<rect width="24" height="24" fill="white"/>
|
|
13
|
+
</clipPath>
|
|
14
|
+
</defs>
|
|
15
|
+
</svg>);
|
|
16
|
+
};
|
|
17
|
+
if (!isError) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
return (<div className="absolute bottom-0 left-1/2 z-[50] w-[90%] -translate-x-1/2">
|
|
21
|
+
<div className={`transition-all duration-300 ${isError ? '-translate-y-[96px] opacity-100' : 'pointer-events-none translate-y-0 opacity-0 '}`}>
|
|
22
|
+
<div className=" flex h-[48px] w-full items-center justify-center space-x-[6px] rounded-[25px] bg-[#505050] text-white">
|
|
23
|
+
<div className="mt-0.5 flex-shrink-0">
|
|
24
|
+
<WarningIcon className="h-6 w-6 text-white"/>
|
|
25
|
+
</div>
|
|
26
|
+
<div className="flex">
|
|
27
|
+
<h3 className="text-[14px] font-[400] leading-[130%] tracking-[-4%]">{message}</h3>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</div>);
|
|
32
|
+
};
|
|
33
|
+
export default FixedErrorBox;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface IFixedErrorBoxProps {
|
|
4
|
+
isError?: boolean;
|
|
5
|
+
message?: string;
|
|
6
|
+
}
|
|
7
|
+
const FixedErrorBox = ({ isError = false, message = '네트워크 연결이 원활하지 않습니다.' }: IFixedErrorBoxProps) => {
|
|
8
|
+
const WarningIcon = ({ className = '' }: { className?: string }) => {
|
|
9
|
+
return (
|
|
10
|
+
<svg
|
|
11
|
+
width="24"
|
|
12
|
+
height="24"
|
|
13
|
+
viewBox="0 0 24 24"
|
|
14
|
+
fill="none"
|
|
15
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
+
className={className}
|
|
17
|
+
>
|
|
18
|
+
<g clipPath="url(#clip0_1775_25245)">
|
|
19
|
+
<path
|
|
20
|
+
d="M3 12C3 13.1819 3.23279 14.3522 3.68508 15.4442C4.13738 16.5361 4.80031 17.5282 5.63604 18.364C6.47177 19.1997 7.46392 19.8626 8.55585 20.3149C9.64778 20.7672 10.8181 21 12 21C13.1819 21 14.3522 20.7672 15.4442 20.3149C16.5361 19.8626 17.5282 19.1997 18.364 18.364C19.1997 17.5282 19.8626 16.5361 20.3149 15.4442C20.7672 14.3522 21 13.1819 21 12C21 9.61305 20.0518 7.32387 18.364 5.63604C16.6761 3.94821 14.3869 3 12 3C9.61305 3 7.32387 3.94821 5.63604 5.63604C3.94821 7.32387 3 9.61305 3 12Z"
|
|
21
|
+
stroke="white"
|
|
22
|
+
strokeWidth="2"
|
|
23
|
+
strokeLinecap="round"
|
|
24
|
+
strokeLinejoin="round"
|
|
25
|
+
/>
|
|
26
|
+
<path
|
|
27
|
+
d="M12 16V16.01"
|
|
28
|
+
stroke="white"
|
|
29
|
+
strokeWidth="2"
|
|
30
|
+
strokeLinecap="round"
|
|
31
|
+
strokeLinejoin="round"
|
|
32
|
+
/>
|
|
33
|
+
<path
|
|
34
|
+
d="M12 8.5L12 13"
|
|
35
|
+
stroke="white"
|
|
36
|
+
strokeWidth="2"
|
|
37
|
+
strokeLinecap="round"
|
|
38
|
+
strokeLinejoin="round"
|
|
39
|
+
/>
|
|
40
|
+
</g>
|
|
41
|
+
<defs>
|
|
42
|
+
<clipPath id="clip0_1775_25245">
|
|
43
|
+
<rect width="24" height="24" fill="white" />
|
|
44
|
+
</clipPath>
|
|
45
|
+
</defs>
|
|
46
|
+
</svg>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
if (!isError) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<div className="absolute bottom-0 left-1/2 z-[50] w-[90%] -translate-x-1/2">
|
|
55
|
+
<div
|
|
56
|
+
className={`transition-all duration-300 ${
|
|
57
|
+
isError ? '-translate-y-[96px] opacity-100' : 'pointer-events-none translate-y-0 opacity-0 '
|
|
58
|
+
}`}
|
|
59
|
+
>
|
|
60
|
+
<div className=" flex h-[48px] w-full items-center justify-center space-x-[6px] rounded-[25px] bg-[#505050] text-white">
|
|
61
|
+
<div className="mt-0.5 flex-shrink-0">
|
|
62
|
+
<WarningIcon className="h-6 w-6 text-white" />
|
|
63
|
+
</div>
|
|
64
|
+
<div className="flex">
|
|
65
|
+
<h3 className="text-[14px] font-[400] leading-[130%] tracking-[-4%]">{message}</h3>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default FixedErrorBox;
|
|
@@ -3,6 +3,8 @@ interface IProps {
|
|
|
3
3
|
goGetHistoryList: (data: {
|
|
4
4
|
version?: string;
|
|
5
5
|
}) => void;
|
|
6
|
+
handleGoRequestPhone: (name: string, cellPhoneNumber: string) => any;
|
|
7
|
+
handleGoHistoryPhoneAuth: (name: string, cellPhoneNumber: string, certificationNumber: string) => any;
|
|
6
8
|
}
|
|
7
|
-
declare const AuthForm: ({ goGetHistoryList }: IProps) => React.JSX.Element;
|
|
9
|
+
declare const AuthForm: ({ goGetHistoryList, handleGoRequestPhone, handleGoHistoryPhoneAuth }: IProps) => React.JSX.Element;
|
|
8
10
|
export default AuthForm;
|
|
@@ -11,10 +11,9 @@ import React, { useState } from 'react';
|
|
|
11
11
|
import Input2 from '../_ui/inputs/Input2';
|
|
12
12
|
import { formatSecondsToMMSS, nameFilter, onlyNumbers, phoneCheck } from '../_lib/utils';
|
|
13
13
|
import Button2 from '../_ui/buttons/Button2';
|
|
14
|
-
import { historyPhoneAuth, requestPhone } from '../_api';
|
|
15
|
-
import { AuthErrorCode } from '../_enums/error_code';
|
|
16
14
|
import { useDaeryunTalkToast } from '../Toast/DaeryuntalkToastProvider';
|
|
17
|
-
|
|
15
|
+
import Button3 from '../_ui/buttons/Button3';
|
|
16
|
+
const AuthForm = ({ goGetHistoryList, handleGoRequestPhone, handleGoHistoryPhoneAuth }) => {
|
|
18
17
|
const [name, setName] = useState({ value: '', isValid: false });
|
|
19
18
|
const [phone, setPhone] = useState({ value: '', isValid: false });
|
|
20
19
|
const [authNumber, setAuthNumber] = useState('');
|
|
@@ -61,7 +60,7 @@ const AuthForm = ({ goGetHistoryList }) => {
|
|
|
61
60
|
const handleSendAuth = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
61
|
try {
|
|
63
62
|
setIsLoading(true);
|
|
64
|
-
const res = yield
|
|
63
|
+
const res = yield handleGoRequestPhone(name.value, phone.value);
|
|
65
64
|
if (res.result_info.result_type_cd === 'OK' || res.result_info.result_cd === 'OK') {
|
|
66
65
|
setIsConfirmState(true);
|
|
67
66
|
setAuthNumber('');
|
|
@@ -80,14 +79,6 @@ const AuthForm = ({ goGetHistoryList }) => {
|
|
|
80
79
|
}, 1000);
|
|
81
80
|
setTimerId(id);
|
|
82
81
|
}
|
|
83
|
-
else {
|
|
84
|
-
if (res.result_info.result_cd === AuthErrorCode.OWNERSHIP_DUPLICATE_REQUEST_ERROR) {
|
|
85
|
-
toast.warning('중복된 요청입니다.');
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
toast.warning('다시 요청해주세요.');
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
82
|
}
|
|
92
83
|
catch (err) {
|
|
93
84
|
console.error('인증번호 발송 실패', err);
|
|
@@ -105,27 +96,11 @@ const AuthForm = ({ goGetHistoryList }) => {
|
|
|
105
96
|
}
|
|
106
97
|
try {
|
|
107
98
|
setIsLoading(true);
|
|
108
|
-
const res = yield
|
|
109
|
-
name: name.value,
|
|
110
|
-
cellPhoneNumber: phone.value,
|
|
111
|
-
certificationNumber: authNumber
|
|
112
|
-
});
|
|
99
|
+
const res = yield handleGoHistoryPhoneAuth(name.value, phone.value, authNumber);
|
|
113
100
|
if (res.result_info.result_type_cd === 'OK' || res.result_info.result_cd === 'OK') {
|
|
114
101
|
yield goGetHistoryList({});
|
|
115
102
|
toast.success('인증이 완료되었습니다.');
|
|
116
103
|
}
|
|
117
|
-
else {
|
|
118
|
-
switch (res.result_info.result_cd) {
|
|
119
|
-
case AuthErrorCode.OWNERSHIP_CODE_MISMATCH:
|
|
120
|
-
toast.warning('잘못된 인증번호입니다.');
|
|
121
|
-
break;
|
|
122
|
-
case AuthErrorCode.OWNERSHIP_EXPIRED:
|
|
123
|
-
toast.warning('인증번호가 만료되었습니다.');
|
|
124
|
-
break;
|
|
125
|
-
default:
|
|
126
|
-
toast.warning('인증에 실패했습니다. 다시 시도해주세요.');
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
104
|
}
|
|
130
105
|
catch (e) {
|
|
131
106
|
console.error('인증 처리 중 오류 발생:', e);
|
|
@@ -136,19 +111,19 @@ const AuthForm = ({ goGetHistoryList }) => {
|
|
|
136
111
|
}
|
|
137
112
|
});
|
|
138
113
|
return (<div className={`
|
|
139
|
-
mt-[
|
|
114
|
+
mt-[40px] p-4
|
|
140
115
|
`}>
|
|
141
|
-
<div className={`
|
|
142
|
-
<div className={`
|
|
116
|
+
<div className={`px-[20px]`}>
|
|
117
|
+
<div className={` dr_talk_title_small `}>
|
|
143
118
|
문의 히스토리 확인을 위해 이전에 문의하실 때 입력하신 정보를 입력해 주세요.
|
|
144
119
|
</div>
|
|
145
120
|
<div className={`flex flex-col`}>
|
|
146
121
|
<div className={`mt-[40px] flex flex-col gap-[8px]`}>
|
|
147
|
-
<div className={`
|
|
122
|
+
<div className={`dr_talk_subtitle_medium`}>이름</div>
|
|
148
123
|
<Input2 onChange={handleInput} value={name.value} type="text" name="name" placeholder={'이름'} readOnly={isLoading || (isConfirmState ? timer > 150 : false)}/>
|
|
149
124
|
</div>
|
|
150
125
|
<div className={`mt-[20px] flex flex-col gap-[8px]`}>
|
|
151
|
-
<div className={`
|
|
126
|
+
<div className={`dr_talk_subtitle_medium`}>휴대폰 번호</div>
|
|
152
127
|
<div className={`flex flex-row gap-[4px]`}>
|
|
153
128
|
<Input2 onChange={handleInput} value={phone.value} type="text" name="phone" className={`!py-[12.5px]`} readOnly={isLoading || (isConfirmState ? timer > 150 : false)} maxLength={11} placeholder="숫자만 입력"/>
|
|
154
129
|
<Button2 isDisabled={isLoading || !name.isValid || !phone.isValid || (isConfirmState && timer > 150)} onClick={handleSendAuth} type={'button'} className={`w-[120px]`}>
|
|
@@ -156,29 +131,24 @@ const AuthForm = ({ goGetHistoryList }) => {
|
|
|
156
131
|
</Button2>
|
|
157
132
|
</div>
|
|
158
133
|
</div>
|
|
159
|
-
{isConfirmState && (<div className={`mt-[4px] text-
|
|
134
|
+
{isConfirmState && (<div className={`dr_talk_body_small1 mt-[4px] text-drTalkGrayscale1`}>
|
|
160
135
|
인증번호가 발송되었습니다.
|
|
161
136
|
</div>)}
|
|
162
137
|
|
|
163
138
|
{isConfirmState && (<div className={`relative mt-[10px]`}>
|
|
164
139
|
<Input2 onChange={handleInput} value={authNumber} type="text" readOnly={isLoading} name="authNumber" maxLength={6} placeholder={'인증 번호 입력'}/>
|
|
165
|
-
<div className={`absolute right-[8px] top-[15px] text-
|
|
140
|
+
<div className={`dr_talk_body_small2 absolute right-[8px] top-[15px] text-drTalkCrimson `}>
|
|
166
141
|
{formatSecondsToMMSS(timer)}
|
|
167
142
|
</div>
|
|
168
143
|
</div>)}
|
|
169
144
|
|
|
170
|
-
{isConfirmState && (<div className={`mt-[20px] text-
|
|
145
|
+
{isConfirmState && (<div className={`dr_talk_body_small1 mt-[20px] text-drTalkGrayscale1`}>
|
|
171
146
|
인증번호가 오지 않는 경우 휴대폰 번호 차단 여부를 확인해주세요.(대륜 고객센터 1800-7905)
|
|
172
147
|
</div>)}
|
|
173
148
|
|
|
174
|
-
{isConfirmState && (<
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
px-6 py-3 text-white disabled:bg-[#D2D2D2]
|
|
178
|
-
`} onClick={handleSubmit}>
|
|
179
|
-
인증번호 확인
|
|
180
|
-
</button>
|
|
181
|
-
</div>)}
|
|
149
|
+
{isConfirmState && (<Button3 onClick={handleSubmit} isDisabled={isLoading || authNumber.length < 5} className={`mt-[40px]`}>
|
|
150
|
+
인증번호 확인
|
|
151
|
+
</Button3>)}
|
|
182
152
|
</div>
|
|
183
153
|
</div>
|
|
184
154
|
</div>);
|