@daeryun/dr_components 1.2.18 → 1.2.19
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/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/Daeryuntalk/ChatButton.jsx +1 -1
- package/dist/components/Daeryuntalk/ChatButton.tsx +1 -1
- package/dist/components/Daeryuntalk/ChatWidget.d.ts +1 -0
- package/dist/components/Daeryuntalk/ChatWidget.jsx +114 -31
- package/dist/components/Daeryuntalk/ChatWidget.tsx +120 -37
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +0 -9
- package/dist/components/Daeryuntalk/index.jsx +17 -1
- package/dist/components/Daeryuntalk/index.tsx +26 -2
- package/dist/components/DaeryuntalkBackup/ChatButton.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/ChatButton.jsx +123 -0
- package/dist/components/DaeryuntalkBackup/ChatButton.tsx +157 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.d.ts +21 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.jsx +259 -0
- package/dist/components/DaeryuntalkBackup/ChatConversation.tsx +390 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.d.ts +16 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.jsx +50 -0
- package/dist/components/DaeryuntalkBackup/ChatConversationItem/ChatConversationHeader.tsx +108 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.d.ts +14 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.jsx +147 -0
- package/dist/components/DaeryuntalkBackup/ChatHomeView.tsx +262 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.jsx +64 -0
- package/dist/components/DaeryuntalkBackup/ChatInput.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.jsx +19 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/AgeCheckBox.tsx +27 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.jsx +165 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatFile.tsx +244 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatLoading.tsx +25 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.jsx +100 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatPrivacyAuth.tsx +135 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.jsx +14 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/ChatWrapper.tsx +26 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.jsx +37 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/RichText.tsx +45 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.jsx +10 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TimeWrapper.tsx +21 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.d.ts +3 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.jsx +34 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/TypingComp.tsx +43 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.jsx +20 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowAuthForm.tsx +32 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.jsx +21 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowClickData.tsx +37 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.jsx +178 -0
- package/dist/components/DaeryuntalkBackup/ChatItem/WorkFlowImg.tsx +233 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.d.ts +20 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.jsx +198 -0
- package/dist/components/DaeryuntalkBackup/ChatMessage.tsx +295 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.jsx +39 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/FieldWorkObject.tsx +75 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.jsx +20 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectBack.tsx +39 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.jsx +138 -0
- package/dist/components/DaeryuntalkBackup/ChatObject/ObjectButton.tsx +177 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.jsx +154 -0
- package/dist/components/DaeryuntalkBackup/ChatWidget.tsx +221 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.d.ts +103 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.jsx +207 -0
- package/dist/components/DaeryuntalkBackup/DaeryuntalkContext.tsx +350 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.jsx +14 -0
- package/dist/components/DaeryuntalkBackup/DateSeparator.tsx +24 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.jsx +34 -0
- package/dist/components/DaeryuntalkBackup/FixedErrorBox.tsx +73 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.jsx +157 -0
- package/dist/components/DaeryuntalkBackup/History/AuthForm.tsx +206 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.d.ts +19 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.jsx +94 -0
- package/dist/components/DaeryuntalkBackup/HistoryView.tsx +182 -0
- package/dist/components/DaeryuntalkBackup/HomeView.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/HomeView.jsx +178 -0
- package/dist/components/DaeryuntalkBackup/HomeView.tsx +261 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.jsx +44 -0
- package/dist/components/DaeryuntalkBackup/NavigationFooter.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.jsx +40 -0
- package/dist/components/DaeryuntalkBackup/NoticeMessage.tsx +60 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.jsx +17 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/DisabledInput.tsx +28 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.d.ts +20 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.jsx +130 -0
- package/dist/components/DaeryuntalkBackup/Tiptap/Tiptap.tsx +181 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.d.ts +23 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.jsx +40 -0
- package/dist/components/DaeryuntalkBackup/Toast/DaeryuntalkToastProvider.tsx +70 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.d.ts +11 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.jsx +64 -0
- package/dist/components/DaeryuntalkBackup/Toast/Toast.tsx +98 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.d.ts +1 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.jsx +22 -0
- package/dist/components/DaeryuntalkBackup/Toast/ToastRender.tsx +30 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.jsx +98 -0
- package/dist/components/DaeryuntalkBackup/Viewer/ImageViewer.tsx +138 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.d.ts +18 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.jsx +104 -0
- package/dist/components/DaeryuntalkBackup/Viewer/MobileViewer.tsx +182 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.d.ts +24 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.jsx +141 -0
- package/dist/components/DaeryuntalkBackup/Viewer/TbPcViewer.tsx +278 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.jsx +25 -0
- package/dist/components/DaeryuntalkBackup/ViewportHandler.tsx +32 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.d.ts +177 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.js +801 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/index.ts +1097 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.d.ts +131 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.js +1 -0
- package/dist/components/DaeryuntalkBackup/_api/daeryuntalk/type/response.ts +159 -0
- package/dist/components/DaeryuntalkBackup/_api/index.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_api/index.js +6 -0
- package/dist/components/DaeryuntalkBackup/_api/index.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.d.ts +5 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.js +9 -0
- package/dist/components/DaeryuntalkBackup/_enums/ags_check_status.ts +9 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.js +25 -0
- package/dist/components/DaeryuntalkBackup/_enums/ask-status.ts +26 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.d.ts +109 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.js +254 -0
- package/dist/components/DaeryuntalkBackup/_enums/error.ts +289 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.js +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/message_type.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.js +16 -0
- package/dist/components/DaeryuntalkBackup/_enums/sender_type.ts +16 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.d.ts +34 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.js +46 -0
- package/dist/components/DaeryuntalkBackup/_enums/socket_type.ts +56 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.d.ts +32 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.js +76 -0
- package/dist/components/DaeryuntalkBackup/_enums/template.ts +81 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.d.ts +33 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.js +66 -0
- package/dist/components/DaeryuntalkBackup/_enums/work_flow_object_expose.ts +71 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.d.ts +48 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.js +465 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useChatHandler.ts +595 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.d.ts +1 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.jsx +15 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useFullURL.tsx +17 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.d.ts +24 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.js +112 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useHistoryHandler.ts +144 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.d.ts +44 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.js +534 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useSocketEventHandler.ts +706 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.js +18 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useViewerHook.ts +23 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.d.ts +9 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.js +109 -0
- package/dist/components/DaeryuntalkBackup/_hooks/talkprovider/useWorkFlow.ts +121 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.js +48 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useHoverScrollbar.ts +73 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.js +42 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useScrollShadow.ts +52 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.js +20 -0
- package/dist/components/DaeryuntalkBackup/_hooks/useWindowSize.ts +30 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.d.ts +2 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.js +26 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useChatSocketState.ts +43 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.d.ts +27 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.js +80 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHistoryView.ts +101 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.d.ts +18 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.js +66 -0
- package/dist/components/DaeryuntalkBackup/_hooks/view/useHomeView.ts +75 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.d.ts +7 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.js +103 -0
- package/dist/components/DaeryuntalkBackup/_lib/index.ts +136 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.d.ts +17 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.js +94 -0
- package/dist/components/DaeryuntalkBackup/_lib/utils.ts +119 -0
- package/dist/components/DaeryuntalkBackup/_types/message.d.ts +92 -0
- package/dist/components/DaeryuntalkBackup/_types/message.js +25 -0
- package/dist/components/DaeryuntalkBackup/_types/message.ts +156 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.d.ts +17 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.js +1 -0
- package/dist/components/DaeryuntalkBackup/_types/message_object.ts +18 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.d.ts +15 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.js +1 -0
- package/dist/components/DaeryuntalkBackup/_types/socket/workflow.ts +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.d.ts +6 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.jsx +5 -0
- package/dist/components/DaeryuntalkBackup/_ui/ShadowBox.tsx +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button1.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button2.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button3.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.d.ts +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.jsx +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/buttons/Button4.tsx +29 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.jsx +15 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox1.tsx +38 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.jsx +21 -0
- package/dist/components/DaeryuntalkBackup/_ui/checkboxs/CheckBox2.tsx +50 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.d.ts +12 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.jsx +9 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input1.tsx +39 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.d.ts +13 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.jsx +10 -0
- package/dist/components/DaeryuntalkBackup/_ui/inputs/Input2.tsx +43 -0
- package/dist/components/DaeryuntalkBackup/index.d.ts +8 -0
- package/dist/components/DaeryuntalkBackup/index.jsx +190 -0
- package/dist/components/DaeryuntalkBackup/index.tsx +261 -0
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/styles/globals.css +415 -410
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface IFixedErrorBoxProps {
|
|
4
|
+
isError?: boolean;
|
|
5
|
+
message?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const FixedErrorBox = ({ isError = false, message = '네트워크 연결이 원활하지 않습니다.' }: IFixedErrorBoxProps) => {
|
|
9
|
+
const WarningIcon = ({ className = '' }: { className?: string }) => {
|
|
10
|
+
return (
|
|
11
|
+
<svg
|
|
12
|
+
width="24"
|
|
13
|
+
height="24"
|
|
14
|
+
viewBox="0 0 24 24"
|
|
15
|
+
fill="none"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
17
|
+
className={className}
|
|
18
|
+
>
|
|
19
|
+
<g clipPath="url(#clip0_1775_25245)">
|
|
20
|
+
<path
|
|
21
|
+
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"
|
|
22
|
+
stroke="white"
|
|
23
|
+
strokeWidth="2"
|
|
24
|
+
strokeLinecap="round"
|
|
25
|
+
strokeLinejoin="round"
|
|
26
|
+
/>
|
|
27
|
+
<path
|
|
28
|
+
d="M12 16V16.01"
|
|
29
|
+
stroke="white"
|
|
30
|
+
strokeWidth="2"
|
|
31
|
+
strokeLinecap="round"
|
|
32
|
+
strokeLinejoin="round"
|
|
33
|
+
/>
|
|
34
|
+
<path
|
|
35
|
+
d="M12 8.5L12 13"
|
|
36
|
+
stroke="white"
|
|
37
|
+
strokeWidth="2"
|
|
38
|
+
strokeLinecap="round"
|
|
39
|
+
strokeLinejoin="round"
|
|
40
|
+
/>
|
|
41
|
+
</g>
|
|
42
|
+
<defs>
|
|
43
|
+
<clipPath id="clip0_1775_25245">
|
|
44
|
+
<rect width="24" height="24" fill="white" />
|
|
45
|
+
</clipPath>
|
|
46
|
+
</defs>
|
|
47
|
+
</svg>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
if (!isError) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div
|
|
56
|
+
className={`
|
|
57
|
+
absolute left-1/2 z-[60] w-[90%] -translate-x-1/2 transition-all duration-300
|
|
58
|
+
${isError ? 'bottom-[96px]' : 'pointer-events-none bottom-0'}
|
|
59
|
+
`}
|
|
60
|
+
>
|
|
61
|
+
<div className="flex h-[48px] w-full items-center justify-center space-x-[6px] rounded-[25px] bg-[#505050] text-white">
|
|
62
|
+
<div className="mt-0.5 flex-shrink-0">
|
|
63
|
+
<WarningIcon className="h-6 w-6 text-white" />
|
|
64
|
+
</div>
|
|
65
|
+
<div className="flex">
|
|
66
|
+
<p className="dr_talk_body_medium2 whitespace-pre-line">{message}</p>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default FixedErrorBox;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
goGetHistoryList: (data: {
|
|
4
|
+
version?: string;
|
|
5
|
+
}) => void;
|
|
6
|
+
handleGoRequestPhone: (name: string, cellPhoneNumber: string) => any;
|
|
7
|
+
handleGoHistoryPhoneAuth: (name: string, cellPhoneNumber: string, certificationNumber: string) => any;
|
|
8
|
+
}
|
|
9
|
+
declare const AuthForm: ({ goGetHistoryList, handleGoRequestPhone, handleGoHistoryPhoneAuth }: IProps) => React.JSX.Element;
|
|
10
|
+
export default AuthForm;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import React, { useState } from 'react';
|
|
12
|
+
import Input2 from '../_ui/inputs/Input2';
|
|
13
|
+
import { formatSecondsToMMSS, nameFilter, onlyNumbers, phoneCheck } from '../_lib/utils';
|
|
14
|
+
import Button2 from '../_ui/buttons/Button2';
|
|
15
|
+
import { useDaeryunTalkToast } from '../Toast/DaeryuntalkToastProvider';
|
|
16
|
+
import Button3 from '../_ui/buttons/Button3';
|
|
17
|
+
const AuthForm = ({ goGetHistoryList, handleGoRequestPhone, handleGoHistoryPhoneAuth }) => {
|
|
18
|
+
const [name, setName] = useState({ value: '', isValid: false });
|
|
19
|
+
const [phone, setPhone] = useState({ value: '', isValid: false });
|
|
20
|
+
const [authNumber, setAuthNumber] = useState('');
|
|
21
|
+
const [isConfirmState, setIsConfirmState] = useState(false);
|
|
22
|
+
const [timer, setTimer] = useState(180); // 3분(180초)
|
|
23
|
+
const [timerId, setTimerId] = useState(null);
|
|
24
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
25
|
+
const toast = useDaeryunTalkToast();
|
|
26
|
+
const resetTimerAndState = () => {
|
|
27
|
+
if (timerId)
|
|
28
|
+
clearInterval(timerId);
|
|
29
|
+
setTimer(180);
|
|
30
|
+
setIsConfirmState(false);
|
|
31
|
+
};
|
|
32
|
+
const handleInput = (e) => {
|
|
33
|
+
const { name: formName, value } = e.currentTarget;
|
|
34
|
+
if (formName === 'name') {
|
|
35
|
+
if (isConfirmState)
|
|
36
|
+
resetTimerAndState();
|
|
37
|
+
const { name: propsName, isValid } = nameFilter(value);
|
|
38
|
+
setName(prev => {
|
|
39
|
+
return {
|
|
40
|
+
value: propsName,
|
|
41
|
+
isValid: isValid
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (formName === 'phone') {
|
|
46
|
+
if (isConfirmState)
|
|
47
|
+
resetTimerAndState();
|
|
48
|
+
const { phoneNumber, isValid } = phoneCheck(value);
|
|
49
|
+
setPhone(prev => {
|
|
50
|
+
return {
|
|
51
|
+
value: phoneNumber,
|
|
52
|
+
isValid: isValid
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (formName === 'authNumber') {
|
|
57
|
+
setAuthNumber(onlyNumbers(value));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
// 인증번호 발송 클릭
|
|
61
|
+
const handleSendAuth = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
+
try {
|
|
63
|
+
setIsLoading(true);
|
|
64
|
+
const res = yield handleGoRequestPhone(name.value, phone.value);
|
|
65
|
+
if (res.result_info.result_type_cd === 'OK' || res.result_info.result_cd === 'OK') {
|
|
66
|
+
setIsConfirmState(true);
|
|
67
|
+
setAuthNumber('');
|
|
68
|
+
setTimer(180);
|
|
69
|
+
if (timerId)
|
|
70
|
+
clearInterval(timerId);
|
|
71
|
+
const id = setInterval(() => {
|
|
72
|
+
setTimer(prev => {
|
|
73
|
+
if (prev <= 1) {
|
|
74
|
+
clearInterval(id);
|
|
75
|
+
setIsConfirmState(false);
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
return prev - 1;
|
|
79
|
+
});
|
|
80
|
+
}, 1000);
|
|
81
|
+
setTimerId(id);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
console.error('인증번호 발송 실패', err);
|
|
86
|
+
toast.warning('다시 요청해주세요.');
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
setIsLoading(false);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
// 인증번호 확인
|
|
93
|
+
const handleSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
|
+
if (timer < 1) {
|
|
95
|
+
toast.warning('인증 유효 시간이 만료되었습니다.');
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
setIsLoading(true);
|
|
100
|
+
const res = yield handleGoHistoryPhoneAuth(name.value, phone.value, authNumber);
|
|
101
|
+
if (res.result_info.result_type_cd === 'OK' || res.result_info.result_cd === 'OK') {
|
|
102
|
+
yield goGetHistoryList({});
|
|
103
|
+
toast.success('인증이 완료되었습니다.');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
console.error('인증 처리 중 오류 발생:', e);
|
|
108
|
+
toast.warning('인증에 실패했습니다. 다시 시도해주세요.');
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
setIsLoading(false);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
return (<div className={`
|
|
115
|
+
mt-[40px] p-4
|
|
116
|
+
`}>
|
|
117
|
+
<div className={`px-[20px]`}>
|
|
118
|
+
<div className={` dr_talk_title_small `}>
|
|
119
|
+
문의 히스토리 확인을 위해 이전에 문의하실 때 입력하신 정보를 입력해 주세요.
|
|
120
|
+
</div>
|
|
121
|
+
<div className={`flex flex-col`}>
|
|
122
|
+
<div className={`mt-[40px] flex flex-col gap-[8px]`}>
|
|
123
|
+
<div className={`dr_talk_subtitle_medium`}>이름</div>
|
|
124
|
+
<Input2 onChange={handleInput} value={name.value} type="text" name="name" placeholder={'이름'} readOnly={isLoading || (isConfirmState ? timer > 150 : false)}/>
|
|
125
|
+
</div>
|
|
126
|
+
<div className={`mt-[20px] flex flex-col gap-[8px]`}>
|
|
127
|
+
<div className={`dr_talk_subtitle_medium`}>휴대폰 번호</div>
|
|
128
|
+
<div className={`flex flex-row gap-[4px]`}>
|
|
129
|
+
<Input2 onChange={handleInput} value={phone.value} type="text" name="phone" className={`!py-[12.5px]`} readOnly={isLoading || (isConfirmState ? timer > 150 : false)} maxLength={11} placeholder="숫자만 입력"/>
|
|
130
|
+
<Button2 isDisabled={isLoading || !name.isValid || !phone.isValid || (isConfirmState && timer > 150)} onClick={handleSendAuth} type={'button'} className={`w-[120px]`}>
|
|
131
|
+
{`${isConfirmState ? (timer > 150 ? `재전송(${timer - 150})` : '재전송') : '인증번호 발송'}`}
|
|
132
|
+
</Button2>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
{isConfirmState && (<div className={`dr_talk_body_small1 mt-[4px] text-drTalkGrayscale1`}>
|
|
136
|
+
인증번호가 발송되었습니다.
|
|
137
|
+
</div>)}
|
|
138
|
+
|
|
139
|
+
{isConfirmState && (<div className={`relative mt-[10px]`}>
|
|
140
|
+
<Input2 onChange={handleInput} value={authNumber} type="text" readOnly={isLoading} name="authNumber" maxLength={6} placeholder={'인증 번호 입력'}/>
|
|
141
|
+
<div className={`dr_talk_body_small2 absolute right-[8px] top-[15px] text-drTalkCrimson `}>
|
|
142
|
+
{formatSecondsToMMSS(timer)}
|
|
143
|
+
</div>
|
|
144
|
+
</div>)}
|
|
145
|
+
|
|
146
|
+
{isConfirmState && (<div className={`dr_talk_body_small1 mt-[20px] text-drTalkGrayscale1`}>
|
|
147
|
+
인증번호가 오지 않는 경우 휴대폰 번호 차단 여부를 확인해주세요.(대륜 고객센터 1800-7905)
|
|
148
|
+
</div>)}
|
|
149
|
+
|
|
150
|
+
{isConfirmState && (<Button3 onClick={handleSubmit} isDisabled={isLoading || authNumber.length < 5} className={`mt-[40px]`}>
|
|
151
|
+
인증번호 확인
|
|
152
|
+
</Button3>)}
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>);
|
|
156
|
+
};
|
|
157
|
+
export default AuthForm;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import Input2 from '../_ui/inputs/Input2';
|
|
4
|
+
import { formatSecondsToMMSS, nameFilter, onlyNumbers, phoneCheck } from '../_lib/utils';
|
|
5
|
+
import Button2 from '../_ui/buttons/Button2';
|
|
6
|
+
import { useDaeryunTalkToast } from '../Toast/DaeryuntalkToastProvider';
|
|
7
|
+
import Button3 from '../_ui/buttons/Button3';
|
|
8
|
+
|
|
9
|
+
interface IProps {
|
|
10
|
+
goGetHistoryList: (data: { version?: string }) => void;
|
|
11
|
+
handleGoRequestPhone: (name: string, cellPhoneNumber: string) => any;
|
|
12
|
+
handleGoHistoryPhoneAuth: (name: string, cellPhoneNumber: string, certificationNumber: string) => any;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const AuthForm = ({ goGetHistoryList, handleGoRequestPhone, handleGoHistoryPhoneAuth }: IProps) => {
|
|
16
|
+
const [name, setName] = useState<{ value: string; isValid: boolean }>({ value: '', isValid: false });
|
|
17
|
+
const [phone, setPhone] = useState<{ value: string; isValid: boolean }>({ value: '', isValid: false });
|
|
18
|
+
const [authNumber, setAuthNumber] = useState<string>('');
|
|
19
|
+
const [isConfirmState, setIsConfirmState] = useState<boolean>(false);
|
|
20
|
+
const [timer, setTimer] = useState<number>(180); // 3분(180초)
|
|
21
|
+
const [timerId, setTimerId] = useState<NodeJS.Timeout | null>(null);
|
|
22
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
23
|
+
const toast = useDaeryunTalkToast();
|
|
24
|
+
const resetTimerAndState = () => {
|
|
25
|
+
if (timerId) clearInterval(timerId);
|
|
26
|
+
setTimer(180);
|
|
27
|
+
setIsConfirmState(false);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const handleInput = (e: React.FormEvent<HTMLInputElement>) => {
|
|
31
|
+
const { name: formName, value } = e.currentTarget;
|
|
32
|
+
if (formName === 'name') {
|
|
33
|
+
if (isConfirmState) resetTimerAndState();
|
|
34
|
+
|
|
35
|
+
const { name: propsName, isValid } = nameFilter(value);
|
|
36
|
+
setName(prev => {
|
|
37
|
+
return {
|
|
38
|
+
value: propsName,
|
|
39
|
+
isValid: isValid
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (formName === 'phone') {
|
|
44
|
+
if (isConfirmState) resetTimerAndState();
|
|
45
|
+
|
|
46
|
+
const { phoneNumber, isValid } = phoneCheck(value);
|
|
47
|
+
setPhone(prev => {
|
|
48
|
+
return {
|
|
49
|
+
value: phoneNumber,
|
|
50
|
+
isValid: isValid
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (formName === 'authNumber') {
|
|
55
|
+
setAuthNumber(onlyNumbers(value));
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// 인증번호 발송 클릭
|
|
60
|
+
const handleSendAuth = async () => {
|
|
61
|
+
try {
|
|
62
|
+
setIsLoading(true);
|
|
63
|
+
const res = await handleGoRequestPhone(name.value, phone.value);
|
|
64
|
+
if (res.result_info.result_type_cd === 'OK' || res.result_info.result_cd === 'OK') {
|
|
65
|
+
setIsConfirmState(true);
|
|
66
|
+
setAuthNumber('');
|
|
67
|
+
setTimer(180);
|
|
68
|
+
|
|
69
|
+
if (timerId) clearInterval(timerId);
|
|
70
|
+
|
|
71
|
+
const id = setInterval(() => {
|
|
72
|
+
setTimer(prev => {
|
|
73
|
+
if (prev <= 1) {
|
|
74
|
+
clearInterval(id);
|
|
75
|
+
setIsConfirmState(false);
|
|
76
|
+
return 0;
|
|
77
|
+
}
|
|
78
|
+
return prev - 1;
|
|
79
|
+
});
|
|
80
|
+
}, 1000);
|
|
81
|
+
|
|
82
|
+
setTimerId(id);
|
|
83
|
+
}
|
|
84
|
+
} catch (err) {
|
|
85
|
+
console.error('인증번호 발송 실패', err);
|
|
86
|
+
toast.warning('다시 요청해주세요.');
|
|
87
|
+
} finally {
|
|
88
|
+
setIsLoading(false);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// 인증번호 확인
|
|
93
|
+
const handleSubmit = async () => {
|
|
94
|
+
if (timer < 1) {
|
|
95
|
+
toast.warning('인증 유효 시간이 만료되었습니다.');
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
try {
|
|
100
|
+
setIsLoading(true);
|
|
101
|
+
const res = await handleGoHistoryPhoneAuth(name.value, phone.value, authNumber);
|
|
102
|
+
|
|
103
|
+
if (res.result_info.result_type_cd === 'OK' || res.result_info.result_cd === 'OK') {
|
|
104
|
+
await goGetHistoryList({});
|
|
105
|
+
toast.success('인증이 완료되었습니다.');
|
|
106
|
+
}
|
|
107
|
+
} catch (e) {
|
|
108
|
+
console.error('인증 처리 중 오류 발생:', e);
|
|
109
|
+
toast.warning('인증에 실패했습니다. 다시 시도해주세요.');
|
|
110
|
+
} finally {
|
|
111
|
+
setIsLoading(false);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<div
|
|
117
|
+
className={`
|
|
118
|
+
mt-[40px] p-4
|
|
119
|
+
`}
|
|
120
|
+
>
|
|
121
|
+
<div className={`px-[20px]`}>
|
|
122
|
+
<div className={` dr_talk_title_small `}>
|
|
123
|
+
문의 히스토리 확인을 위해 이전에 문의하실 때 입력하신 정보를 입력해 주세요.
|
|
124
|
+
</div>
|
|
125
|
+
<div className={`flex flex-col`}>
|
|
126
|
+
<div className={`mt-[40px] flex flex-col gap-[8px]`}>
|
|
127
|
+
<div className={`dr_talk_subtitle_medium`}>이름</div>
|
|
128
|
+
<Input2
|
|
129
|
+
onChange={handleInput}
|
|
130
|
+
value={name.value}
|
|
131
|
+
type="text"
|
|
132
|
+
name="name"
|
|
133
|
+
placeholder={'이름'}
|
|
134
|
+
readOnly={isLoading || (isConfirmState ? timer > 150 : false)}
|
|
135
|
+
/>
|
|
136
|
+
</div>
|
|
137
|
+
<div className={`mt-[20px] flex flex-col gap-[8px]`}>
|
|
138
|
+
<div className={`dr_talk_subtitle_medium`}>휴대폰 번호</div>
|
|
139
|
+
<div className={`flex flex-row gap-[4px]`}>
|
|
140
|
+
<Input2
|
|
141
|
+
onChange={handleInput}
|
|
142
|
+
value={phone.value}
|
|
143
|
+
type="text"
|
|
144
|
+
name="phone"
|
|
145
|
+
className={`!py-[12.5px]`}
|
|
146
|
+
readOnly={isLoading || (isConfirmState ? timer > 150 : false)}
|
|
147
|
+
maxLength={11}
|
|
148
|
+
placeholder="숫자만 입력"
|
|
149
|
+
/>
|
|
150
|
+
<Button2
|
|
151
|
+
isDisabled={
|
|
152
|
+
isLoading || !name.isValid || !phone.isValid || (isConfirmState && timer > 150)
|
|
153
|
+
}
|
|
154
|
+
onClick={handleSendAuth}
|
|
155
|
+
type={'button'}
|
|
156
|
+
className={`w-[120px]`}
|
|
157
|
+
>
|
|
158
|
+
{`${isConfirmState ? (timer > 150 ? `재전송(${timer - 150})` : '재전송') : '인증번호 발송'}`}
|
|
159
|
+
</Button2>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
{isConfirmState && (
|
|
163
|
+
<div className={`dr_talk_body_small1 mt-[4px] text-drTalkGrayscale1`}>
|
|
164
|
+
인증번호가 발송되었습니다.
|
|
165
|
+
</div>
|
|
166
|
+
)}
|
|
167
|
+
|
|
168
|
+
{isConfirmState && (
|
|
169
|
+
<div className={`relative mt-[10px]`}>
|
|
170
|
+
<Input2
|
|
171
|
+
onChange={handleInput}
|
|
172
|
+
value={authNumber}
|
|
173
|
+
type="text"
|
|
174
|
+
readOnly={isLoading}
|
|
175
|
+
name="authNumber"
|
|
176
|
+
maxLength={6}
|
|
177
|
+
placeholder={'인증 번호 입력'}
|
|
178
|
+
/>
|
|
179
|
+
<div className={`dr_talk_body_small2 absolute right-[8px] top-[15px] text-drTalkCrimson `}>
|
|
180
|
+
{formatSecondsToMMSS(timer)}
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
)}
|
|
184
|
+
|
|
185
|
+
{isConfirmState && (
|
|
186
|
+
<div className={`dr_talk_body_small1 mt-[20px] text-drTalkGrayscale1`}>
|
|
187
|
+
인증번호가 오지 않는 경우 휴대폰 번호 차단 여부를 확인해주세요.(대륜 고객센터 1800-7905)
|
|
188
|
+
</div>
|
|
189
|
+
)}
|
|
190
|
+
|
|
191
|
+
{isConfirmState && (
|
|
192
|
+
<Button3
|
|
193
|
+
onClick={handleSubmit}
|
|
194
|
+
isDisabled={isLoading || authNumber.length < 5}
|
|
195
|
+
className={`mt-[40px]`}
|
|
196
|
+
>
|
|
197
|
+
인증번호 확인
|
|
198
|
+
</Button3>
|
|
199
|
+
)}
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export default AuthForm;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { History } from './_api/daeryuntalk/type/response';
|
|
3
|
+
type HistoryViewProps = {
|
|
4
|
+
onBackClick: () => void;
|
|
5
|
+
onChatHistoryClick: (historyId: string) => void;
|
|
6
|
+
onNewChatClick: () => void;
|
|
7
|
+
isAuthenticated: boolean;
|
|
8
|
+
historyLit: History[];
|
|
9
|
+
goGetHistoryList: (data: {
|
|
10
|
+
version?: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
isMobile: boolean;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
isHash: boolean;
|
|
15
|
+
handleGoRequestPhone: (name: string, cellPhoneNumber: string) => any;
|
|
16
|
+
handleGoHistoryPhoneAuth: (name: string, cellPhoneNumber: string, certificationNumber: string) => any;
|
|
17
|
+
};
|
|
18
|
+
declare const HistoryView: React.FC<HistoryViewProps>;
|
|
19
|
+
export default HistoryView;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import AuthForm from './History/AuthForm';
|
|
3
|
+
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
4
|
+
import ShadowBox from './_ui/ShadowBox';
|
|
5
|
+
import { formatTimestamp } from './_lib/utils';
|
|
6
|
+
import { useHoverScrollbar } from './_hooks/useHoverScrollbar';
|
|
7
|
+
import Image from 'next/image';
|
|
8
|
+
const HistoryView = ({ onBackClick, onChatHistoryClick, onNewChatClick, isAuthenticated, historyLit, goGetHistoryList, isMobile, onClose, isHash, handleGoRequestPhone, handleGoHistoryPhoneAuth }) => {
|
|
9
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
10
|
+
const LinkRight = `${s3Url}/daeryuntalk/link_right.svg`;
|
|
11
|
+
const EmptyMessage = `${s3Url}/daeryuntalk/empty_message.svg`;
|
|
12
|
+
const SendIcon = `${s3Url}/daeryuntalk/send.svg`;
|
|
13
|
+
const CloseSvgIcon = `${s3Url}/daeryuntalk/close.svg`;
|
|
14
|
+
const PrevIcon = `${s3Url}/daeryuntalk/prev.svg`;
|
|
15
|
+
const { containerRef, isScroll, isBottom, checkScroll } = useScrollShadow();
|
|
16
|
+
const { style: hoverStyle } = useHoverScrollbar(containerRef);
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
checkScroll();
|
|
19
|
+
}, [historyLit]);
|
|
20
|
+
const hasHistories = historyLit.length > 0;
|
|
21
|
+
return (<div className={`
|
|
22
|
+
no-scrollbar relative w-full rounded-t-[30px]
|
|
23
|
+
${isMobile
|
|
24
|
+
? ` flex h-[100%] flex-col items-center justify-start `
|
|
25
|
+
: ' flex h-[calc(100dvh)] flex-col items-center xs:h-[calc(100vh-165px)] lg:h-[calc(100vh-110px)] ' +
|
|
26
|
+
' xs:max-h-[690px] xs:min-h-[320px] '}
|
|
27
|
+
`}>
|
|
28
|
+
{/* 헤더 */}
|
|
29
|
+
<div className={`sub_title top-0 z-10 flex h-[56px] w-full items-center justify-between border-b border-gray-200 p-[16px]`}>
|
|
30
|
+
<button className="flex h-7 w-7 items-center justify-center" aria-label="이전" onClick={onBackClick}>
|
|
31
|
+
<Image src={PrevIcon} alt="이전" width={28} height={28}/>
|
|
32
|
+
{/* <PrevIcon width={28} height={28} /> */}
|
|
33
|
+
</button>
|
|
34
|
+
<div className="flex items-center">
|
|
35
|
+
<p className=" dr_talk_title_small ">히스토리</p>
|
|
36
|
+
</div>
|
|
37
|
+
<div
|
|
38
|
+
// className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : ' xs:pointer-events-none xs:!opacity-0 '} py-[14px] text-drTalkGrayscale2 hover:cursor-pointer`}
|
|
39
|
+
className={`py-[14px] text-black hover:cursor-pointer`} onClick={onClose}>
|
|
40
|
+
<Image src={CloseSvgIcon} alt="닫기" width={28} height={28}/>
|
|
41
|
+
{/* <CloseSvgIcon width={28} height={28} /> */}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
{!isAuthenticated ? (<AuthForm goGetHistoryList={goGetHistoryList} handleGoRequestPhone={handleGoRequestPhone} handleGoHistoryPhoneAuth={handleGoHistoryPhoneAuth}/>) : (<>
|
|
46
|
+
{/* 스크롤 가능한 컨텐츠 영역 */}
|
|
47
|
+
<div className="relative w-full flex-1 overflow-hidden">
|
|
48
|
+
<div ref={containerRef} className={`${isMobile ? 'overflow-y-auto px-[20px] ' : ' pl-[20px] pr-[5px] '} h-full pb-[20px] pt-[24px] `} style={Object.assign({}, (!isMobile ? hoverStyle : {}))}>
|
|
49
|
+
{hasHistories ? (historyLit === null || historyLit === void 0 ? void 0 : historyLit.map((history, index) => (<div key={`${history.chat_inquiry_number}-${index}`} className={`cursor-pointer border-b border-drTalkGrayscale4 px-[12px] py-[18px] hover:bg-gray-50`} onClick={() => onChatHistoryClick(history.chat_inquiry_number)}>
|
|
50
|
+
<div className="flex items-center justify-between">
|
|
51
|
+
<div className={`flex flex-row items-center gap-[10px]`}>
|
|
52
|
+
<span className="dr_talk_subtitle_medium">{history.customer_name}</span>
|
|
53
|
+
{history.unread_message_count && history.unread_message_count > 0 ? (<span className={`${history.unread_message_count > 99 ? ' h-[18px] w-[31px] rounded-[15.5px] ' : ' h-[18px] w-[18px] rounded-full '} dr_talk_subtitle_small2 flex items-center justify-center bg-drTalkCrimson text-drTalkWhite`}>
|
|
54
|
+
{history.unread_message_count}
|
|
55
|
+
</span>) : null}
|
|
56
|
+
</div>
|
|
57
|
+
<span className=" dr_talk_body_small1 text-drTalkGrayscale2 ">
|
|
58
|
+
{formatTimestamp(history.recent_message_date_time)}
|
|
59
|
+
</span>
|
|
60
|
+
</div>
|
|
61
|
+
<div className=" mt-[10px] flex items-center justify-between">
|
|
62
|
+
<p className={`${history.unread_message_count && history.unread_message_count > 0 ? 'text-black' : 'text-drTalkGrayscale2'} dr_talk_body_medium2 line-clamp-2 w-[calc(100%-24px)] `}>
|
|
63
|
+
{history.recent_message_content}
|
|
64
|
+
</p>
|
|
65
|
+
<Image src={LinkRight} alt="링크" width={18} height={18} className="flex-shrink-0"/>
|
|
66
|
+
{/* <LinkRight width={18} height={18} className="flex-shrink-0" /> */}
|
|
67
|
+
</div>
|
|
68
|
+
</div>))) : (<div className="flex h-full flex-col items-center justify-center p-4">
|
|
69
|
+
<div className="mb-4">
|
|
70
|
+
<Image src={EmptyMessage} alt="빈 메시지" width={82} height={64}/>
|
|
71
|
+
{/* <EmptyMessage /> */}
|
|
72
|
+
</div>
|
|
73
|
+
<p className="text-center text-gray-500">
|
|
74
|
+
이전 대화기록이 없습니다
|
|
75
|
+
<br />
|
|
76
|
+
대화를 시작해 보세요
|
|
77
|
+
</p>
|
|
78
|
+
</div>)}
|
|
79
|
+
</div>
|
|
80
|
+
{isScroll && !isBottom && <ShadowBox className={`!h-[110px]`}/>}
|
|
81
|
+
</div>
|
|
82
|
+
</>)}
|
|
83
|
+
|
|
84
|
+
{/* 새 문의하기 버튼 - 항상 하단에 고정 */}
|
|
85
|
+
{isAuthenticated && (<div className="w-full flex-shrink-0 border-t border-gray-100 bg-white p-4">
|
|
86
|
+
<button className="flex w-full items-center justify-center gap-2.5 rounded-[25px] bg-[#2E385B] px-6 py-3 text-white" onClick={onNewChatClick}>
|
|
87
|
+
새 문의하기
|
|
88
|
+
<Image src={SendIcon} alt="전송" width={24} height={24}/>
|
|
89
|
+
{/* <SendIcon width={24} height={24} /> */}
|
|
90
|
+
</button>
|
|
91
|
+
</div>)}
|
|
92
|
+
</div>);
|
|
93
|
+
};
|
|
94
|
+
export default HistoryView;
|