@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,182 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import AuthForm from './History/AuthForm';
|
|
3
|
+
import { History } from './_api/daeryuntalk/type/response';
|
|
4
|
+
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
5
|
+
import ShadowBox from './_ui/ShadowBox';
|
|
6
|
+
import { formatTimestamp } from './_lib/utils';
|
|
7
|
+
import { useHoverScrollbar } from './_hooks/useHoverScrollbar';
|
|
8
|
+
import Image from 'next/image';
|
|
9
|
+
|
|
10
|
+
// 이미지
|
|
11
|
+
// import LinkRight from '../../asset/images/daeryuntalk/link_right.svg';
|
|
12
|
+
// import EmptyMessage from '../../asset/images/daeryuntalk/empty_message.svg';
|
|
13
|
+
// import SendIcon from '../../asset/images/daeryuntalk/send.svg';
|
|
14
|
+
// import CloseSvgIcon from '../../asset/images/daeryuntalk/close.svg';
|
|
15
|
+
// import PrevIcon from '../../asset/images/daeryuntalk/prev.svg';
|
|
16
|
+
|
|
17
|
+
type HistoryViewProps = {
|
|
18
|
+
onBackClick: () => void;
|
|
19
|
+
onChatHistoryClick: (historyId: string) => void;
|
|
20
|
+
onNewChatClick: () => void;
|
|
21
|
+
isAuthenticated: boolean;
|
|
22
|
+
historyLit: History[];
|
|
23
|
+
goGetHistoryList: (data: { version?: string }) => void;
|
|
24
|
+
isMobile: boolean;
|
|
25
|
+
onClose: () => void;
|
|
26
|
+
isHash: boolean;
|
|
27
|
+
handleGoRequestPhone: (name: string, cellPhoneNumber: string) => any;
|
|
28
|
+
handleGoHistoryPhoneAuth: (name: string, cellPhoneNumber: string, certificationNumber: string) => any;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const HistoryView: React.FC<HistoryViewProps> = ({
|
|
32
|
+
onBackClick,
|
|
33
|
+
onChatHistoryClick,
|
|
34
|
+
onNewChatClick,
|
|
35
|
+
isAuthenticated,
|
|
36
|
+
historyLit,
|
|
37
|
+
goGetHistoryList,
|
|
38
|
+
isMobile,
|
|
39
|
+
onClose,
|
|
40
|
+
isHash,
|
|
41
|
+
handleGoRequestPhone,
|
|
42
|
+
handleGoHistoryPhoneAuth
|
|
43
|
+
}) => {
|
|
44
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
45
|
+
const LinkRight = `${s3Url}/daeryuntalk/link_right.svg`;
|
|
46
|
+
const EmptyMessage = `${s3Url}/daeryuntalk/empty_message.svg`;
|
|
47
|
+
const SendIcon = `${s3Url}/daeryuntalk/send.svg`;
|
|
48
|
+
const CloseSvgIcon = `${s3Url}/daeryuntalk/close.svg`;
|
|
49
|
+
const PrevIcon = `${s3Url}/daeryuntalk/prev.svg`;
|
|
50
|
+
const { containerRef, isScroll, isBottom, checkScroll } = useScrollShadow<HTMLDivElement>();
|
|
51
|
+
const { style: hoverStyle } = useHoverScrollbar(containerRef);
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
checkScroll();
|
|
55
|
+
}, [historyLit]);
|
|
56
|
+
|
|
57
|
+
const hasHistories = historyLit.length > 0;
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div
|
|
61
|
+
className={`
|
|
62
|
+
no-scrollbar relative w-full rounded-t-[30px]
|
|
63
|
+
${
|
|
64
|
+
isMobile
|
|
65
|
+
? ` flex h-[100%] flex-col items-center justify-start `
|
|
66
|
+
: ' flex h-[calc(100dvh)] flex-col items-center xs:h-[calc(100vh-165px)] lg:h-[calc(100vh-110px)] ' +
|
|
67
|
+
' xs:max-h-[690px] xs:min-h-[320px] '
|
|
68
|
+
}
|
|
69
|
+
`}
|
|
70
|
+
>
|
|
71
|
+
{/* 헤더 */}
|
|
72
|
+
<div
|
|
73
|
+
className={`sub_title top-0 z-10 flex h-[56px] w-full items-center justify-between border-b border-gray-200 p-[16px]`}
|
|
74
|
+
>
|
|
75
|
+
<button className="flex h-7 w-7 items-center justify-center" aria-label="이전" onClick={onBackClick}>
|
|
76
|
+
<Image src={PrevIcon} alt="이전" width={28} height={28} />
|
|
77
|
+
{/* <PrevIcon width={28} height={28} /> */}
|
|
78
|
+
</button>
|
|
79
|
+
<div className="flex items-center">
|
|
80
|
+
<p className=" dr_talk_title_small ">히스토리</p>
|
|
81
|
+
</div>
|
|
82
|
+
<div
|
|
83
|
+
// className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : ' xs:pointer-events-none xs:!opacity-0 '} py-[14px] text-drTalkGrayscale2 hover:cursor-pointer`}
|
|
84
|
+
className={`py-[14px] text-black hover:cursor-pointer`}
|
|
85
|
+
onClick={onClose}
|
|
86
|
+
>
|
|
87
|
+
<Image src={CloseSvgIcon} alt="닫기" width={28} height={28} />
|
|
88
|
+
{/* <CloseSvgIcon width={28} height={28} /> */}
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
{!isAuthenticated ? (
|
|
93
|
+
<AuthForm
|
|
94
|
+
goGetHistoryList={goGetHistoryList}
|
|
95
|
+
handleGoRequestPhone={handleGoRequestPhone}
|
|
96
|
+
handleGoHistoryPhoneAuth={handleGoHistoryPhoneAuth}
|
|
97
|
+
/>
|
|
98
|
+
) : (
|
|
99
|
+
<>
|
|
100
|
+
{/* 스크롤 가능한 컨텐츠 영역 */}
|
|
101
|
+
<div className="relative w-full flex-1 overflow-hidden">
|
|
102
|
+
<div
|
|
103
|
+
ref={containerRef}
|
|
104
|
+
className={`${isMobile ? 'overflow-y-auto px-[20px] ' : ' pl-[20px] pr-[5px] '} h-full pb-[20px] pt-[24px] `}
|
|
105
|
+
style={{ ...(!isMobile ? hoverStyle : {}) }}
|
|
106
|
+
>
|
|
107
|
+
{hasHistories ? (
|
|
108
|
+
historyLit?.map((history, index) => (
|
|
109
|
+
<div
|
|
110
|
+
key={`${history.chat_inquiry_number}-${index}`}
|
|
111
|
+
className={`cursor-pointer border-b border-drTalkGrayscale4 px-[12px] py-[18px] hover:bg-gray-50`}
|
|
112
|
+
onClick={() => onChatHistoryClick(history.chat_inquiry_number)}
|
|
113
|
+
>
|
|
114
|
+
<div className="flex items-center justify-between">
|
|
115
|
+
<div className={`flex flex-row items-center gap-[10px]`}>
|
|
116
|
+
<span className="dr_talk_subtitle_medium">{history.customer_name}</span>
|
|
117
|
+
{history.unread_message_count && history.unread_message_count > 0 ? (
|
|
118
|
+
<span
|
|
119
|
+
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`}
|
|
120
|
+
>
|
|
121
|
+
{history.unread_message_count}
|
|
122
|
+
</span>
|
|
123
|
+
) : null}
|
|
124
|
+
</div>
|
|
125
|
+
<span className=" dr_talk_body_small1 text-drTalkGrayscale2 ">
|
|
126
|
+
{formatTimestamp(history.recent_message_date_time)}
|
|
127
|
+
</span>
|
|
128
|
+
</div>
|
|
129
|
+
<div className=" mt-[10px] flex items-center justify-between">
|
|
130
|
+
<p
|
|
131
|
+
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)] `}
|
|
132
|
+
>
|
|
133
|
+
{history.recent_message_content}
|
|
134
|
+
</p>
|
|
135
|
+
<Image
|
|
136
|
+
src={LinkRight}
|
|
137
|
+
alt="링크"
|
|
138
|
+
width={18}
|
|
139
|
+
height={18}
|
|
140
|
+
className="flex-shrink-0"
|
|
141
|
+
/>
|
|
142
|
+
{/* <LinkRight width={18} height={18} className="flex-shrink-0" /> */}
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
))
|
|
146
|
+
) : (
|
|
147
|
+
<div className="flex h-full flex-col items-center justify-center p-4">
|
|
148
|
+
<div className="mb-4">
|
|
149
|
+
<Image src={EmptyMessage} alt="빈 메시지" width={82} height={64} />
|
|
150
|
+
{/* <EmptyMessage /> */}
|
|
151
|
+
</div>
|
|
152
|
+
<p className="text-center text-gray-500">
|
|
153
|
+
이전 대화기록이 없습니다
|
|
154
|
+
<br />
|
|
155
|
+
대화를 시작해 보세요
|
|
156
|
+
</p>
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
</div>
|
|
160
|
+
{isScroll && !isBottom && <ShadowBox className={`!h-[110px]`} />}
|
|
161
|
+
</div>
|
|
162
|
+
</>
|
|
163
|
+
)}
|
|
164
|
+
|
|
165
|
+
{/* 새 문의하기 버튼 - 항상 하단에 고정 */}
|
|
166
|
+
{isAuthenticated && (
|
|
167
|
+
<div className="w-full flex-shrink-0 border-t border-gray-100 bg-white p-4">
|
|
168
|
+
<button
|
|
169
|
+
className="flex w-full items-center justify-center gap-2.5 rounded-[25px] bg-[#2E385B] px-6 py-3 text-white"
|
|
170
|
+
onClick={onNewChatClick}
|
|
171
|
+
>
|
|
172
|
+
새 문의하기
|
|
173
|
+
<Image src={SendIcon} alt="전송" width={24} height={24} />
|
|
174
|
+
{/* <SendIcon width={24} height={24} /> */}
|
|
175
|
+
</button>
|
|
176
|
+
</div>
|
|
177
|
+
)}
|
|
178
|
+
</div>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export default HistoryView;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IChatInquiryMainDataResponse } from './_api/daeryuntalk/type/response';
|
|
3
|
+
interface IHomeViewProps {
|
|
4
|
+
inquiryMainData: IChatInquiryMainDataResponse | null;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
handleStartChat: () => void;
|
|
7
|
+
isMobile: boolean;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
isHash: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const HomeView: ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClose, isHash }: IHomeViewProps) => React.JSX.Element;
|
|
12
|
+
export default HomeView;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import ShadowBox from './_ui/ShadowBox';
|
|
5
|
+
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
6
|
+
import Button3 from './_ui/buttons/Button3';
|
|
7
|
+
import { useHoverScrollbar } from './_hooks/useHoverScrollbar';
|
|
8
|
+
import { useWindowSize } from './_hooks/useWindowSize';
|
|
9
|
+
const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClose, isHash }) => {
|
|
10
|
+
const { containerRef, isScroll, isBottom, checkScroll, isScrolling } = useScrollShadow();
|
|
11
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
12
|
+
const DaeryuntalkIntro = `${s3Url}/daeryuntalk/daeryuntalk_home_bg.png`;
|
|
13
|
+
const TimeIcon = `${s3Url}/daeryuntalk/time.svg`;
|
|
14
|
+
const DaeryunLogoIcon = `${s3Url}/daeryuntalk/daeryun-logo.svg`;
|
|
15
|
+
const SendIcon = `${s3Url}/daeryuntalk/send.svg`;
|
|
16
|
+
const InfoIcon = `${s3Url}/daeryuntalk/info.svg`;
|
|
17
|
+
const CloseSvgIcon = `${s3Url}/daeryuntalk/close.svg`;
|
|
18
|
+
const wrapperRef = useRef(null);
|
|
19
|
+
const [contentHeight, setContentHeight] = useState(210);
|
|
20
|
+
const currentHeightRef = useRef(210);
|
|
21
|
+
const prevWrapperHeightRef = useRef(null);
|
|
22
|
+
const { style: hoverStyle } = useHoverScrollbar(containerRef);
|
|
23
|
+
const browserSize = useWindowSize();
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const updateContentHeight = () => {
|
|
26
|
+
var _a;
|
|
27
|
+
if (!wrapperRef.current)
|
|
28
|
+
return;
|
|
29
|
+
// 모바일이거나 width가 480px 미만이면 contentHeight를 210으로 되돌림
|
|
30
|
+
if (isMobile) {
|
|
31
|
+
currentHeightRef.current = 210;
|
|
32
|
+
setContentHeight(210);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
if (browserSize.width < 480) {
|
|
37
|
+
// 브라우저 세로 - 헤더 - 고정 200px - 푸터 - 문의 버튼 크기1
|
|
38
|
+
const nextHeight = browserSize.height - 56 - 200 - 64 - 88 - 48;
|
|
39
|
+
currentHeightRef.current = nextHeight;
|
|
40
|
+
setContentHeight(nextHeight);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
setContentHeight(210);
|
|
45
|
+
const rect = (_a = wrapperRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
46
|
+
const gap = rect.top;
|
|
47
|
+
const wrapperHeight = wrapperRef.current.offsetHeight;
|
|
48
|
+
const currentHeight = currentHeightRef.current;
|
|
49
|
+
// 이전 높이와 비교하여 줄어드는 중인지 판단
|
|
50
|
+
const prevHeight = prevWrapperHeightRef.current;
|
|
51
|
+
const isShrinking = prevHeight !== null && wrapperHeight < prevHeight;
|
|
52
|
+
const isExpanding = prevHeight !== null && wrapperHeight > prevHeight;
|
|
53
|
+
prevWrapperHeightRef.current = wrapperHeight; // 현재 높이를 저장
|
|
54
|
+
// 줄어드는 애니메이션 (2단계)
|
|
55
|
+
if (isShrinking) {
|
|
56
|
+
if (currentHeight > 140) {
|
|
57
|
+
if (wrapperHeight <= 625) {
|
|
58
|
+
// 1단계: 210 → 140
|
|
59
|
+
const next = Math.max(140, currentHeight - 6);
|
|
60
|
+
currentHeightRef.current = next;
|
|
61
|
+
setContentHeight(next);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if (currentHeight > 80) {
|
|
65
|
+
// 여기에 height가 526 경우에만 가능
|
|
66
|
+
// 2단계: 140 → 80
|
|
67
|
+
if (wrapperHeight <= 526) {
|
|
68
|
+
const next = Math.max(80, currentHeight - 4);
|
|
69
|
+
currentHeightRef.current = next;
|
|
70
|
+
setContentHeight(next);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// 다시 늘어나는 애니메이션 (2단계)
|
|
75
|
+
else if (isExpanding) {
|
|
76
|
+
if (currentHeight < 140) {
|
|
77
|
+
// 1단계: 80 → 140
|
|
78
|
+
const next = Math.min(140, currentHeight + 4);
|
|
79
|
+
currentHeightRef.current = next;
|
|
80
|
+
setContentHeight(next);
|
|
81
|
+
}
|
|
82
|
+
else if (currentHeight < 210) {
|
|
83
|
+
if (wrapperHeight >= 526) {
|
|
84
|
+
// 2단계: 140 → 210
|
|
85
|
+
const next = Math.min(210, currentHeight + 6);
|
|
86
|
+
currentHeightRef.current = next;
|
|
87
|
+
setContentHeight(next);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
setContentHeight(210);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
let rafId;
|
|
98
|
+
const loop = () => {
|
|
99
|
+
updateContentHeight();
|
|
100
|
+
rafId = requestAnimationFrame(loop);
|
|
101
|
+
};
|
|
102
|
+
rafId = requestAnimationFrame(loop);
|
|
103
|
+
return () => cancelAnimationFrame(rafId);
|
|
104
|
+
}, [isMobile, inquiryMainData, browserSize.width]);
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
checkScroll();
|
|
107
|
+
}, [inquiryMainData]);
|
|
108
|
+
const tempSasulation = `안녕하세요.\n법무법인(유한)대륜입니다.\n방문해 주셔서 감사합니다. \n궁금한 점이나 도움이 필요하신 부분 \n말씀해 주시면 도와드리겠습니다.\n\n※ 성함과 연락처를 남겨주시면 갑작스럽게 채팅이 중단될 경우 전화나 문자(알림톡)를 통해 중요한 답변을 놓치지 않도록 도와드리고 있으며 이전 내역 확인 후 빠른 안내가 가능합니다. \n\n※ 만 14세 미만의 경우에는 보호자의 동의 없이는 개인정보 수집 및 이용이 불가능합니다. \n만 14세 미만의 미성년자의 경우 법정대리인의 연락처를 알려 주시면 동의서를 보내드리도록 하겠습니다.\n\n채팅방을 나가신 후 문의하실 경우에도 동일한 내용으로 대화를 이어가실 수 있습니다. \n\n수집된 개인 정보는 답변 알림 및 상담예약안내 목적으로만 이용되며 삭제를 요청하시기 전까지 보유됩니다. 개인정보 입력시 개인정보제공에 동의한 것으로 봅니다. 개인정보제공에 동의하지 않으실 경우 답변 알림을 받으실 수 없습니다.\n\n✅ 6:00~24:00 외 시간에는 인력편성에 따라 순차적으로 응대를 도와드리고 있습니다."
|
|
109
|
+
`;
|
|
110
|
+
const backgroundImage = (inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.sleeve_image_url) || DaeryuntalkIntro;
|
|
111
|
+
return (<div ref={wrapperRef} className={`
|
|
112
|
+
no-scrollbar relative w-full rounded-t-[30px]
|
|
113
|
+
${isMobile
|
|
114
|
+
? ` flex h-[calc(100%-64px)] flex-col items-center justify-between `
|
|
115
|
+
: ` flex h-[100vh] flex-col items-center justify-between xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ` +
|
|
116
|
+
` xs:max-h-[626px] xs:min-h-[320px] `}
|
|
117
|
+
`}>
|
|
118
|
+
<header className="z-10 flex h-[56px] w-full justify-between rounded-t-[30px] px-[20px]">
|
|
119
|
+
<div className="dr_talk_subtitle_small flex items-center gap-[2px] pt-[31.5px] text-drTalkGrayscale1">
|
|
120
|
+
<Image src={TimeIcon} alt="시간" width={20} height={20}/>
|
|
121
|
+
{/* <TimeIcon width={20} height={20} /> */}
|
|
122
|
+
<span>24시간 운영</span>
|
|
123
|
+
</div>
|
|
124
|
+
<div className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : 'xs:pointer-events-none xs:!opacity-0'} py-[14px] text-drTalkGrayscale2 hover:cursor-pointer`} onClick={onClose}>
|
|
125
|
+
<Image src={CloseSvgIcon} alt="닫기" width={28} height={28}/>
|
|
126
|
+
{/* <CloseSvgIcon width={28} height={28} /> */}
|
|
127
|
+
</div>
|
|
128
|
+
</header>
|
|
129
|
+
|
|
130
|
+
<div className={`absolute left-0 top-0 z-0 w-full overflow-hidden ${isMobile ? 'aspect-[16/9] max-h-[360px]' : 'h-full max-h-[360px]'}`}>
|
|
131
|
+
{/*<div className={`relative`}>*/}
|
|
132
|
+
<Image src={backgroundImage} alt="대화 배경" fill className={`will-change-transform ${isMobile ? 'object-cover object-top' : ' object-cover object-top xs:object-contain '}`} priority/>
|
|
133
|
+
<div className="pointer-events-none absolute bottom-0 left-0 h-24 w-full bg-gradient-to-t from-white to-transparent"/>
|
|
134
|
+
{/*</div>*/}
|
|
135
|
+
</div>
|
|
136
|
+
{!isMobile && <div className={`block h-[200px] xs:hidden`}></div>}
|
|
137
|
+
|
|
138
|
+
<div className={` relative z-10 px-[20px] ${isMobile ? 'flex w-full justify-center pb-[20px]' : 'flex h-full w-full flex-col justify-center pb-[84px] xs:h-fit xs:pb-[34px]'}`}>
|
|
139
|
+
<section className={` flex h-full flex-col rounded-[12px] bg-white px-[16px] py-[24px] sm:h-fit ${isMobile ? 'w-full' : ' justify-between xs:justify-start '}`} style={{ boxShadow: '0px 4px 10px 0px #00000026' }}>
|
|
140
|
+
{/* 해당 컴포넌트의 최상위 부모와 브라우저 상단과 닿았을 때 우선적으로 해당 부분의 높이가 먼저 줄어들게 하고 싶다*/}
|
|
141
|
+
<div className="relative">
|
|
142
|
+
<div ref={containerRef} className={`flex min-h-[80px] flex-col overscroll-contain ${isMobile ? 'overflow-y-auto overscroll-contain ' : ''} overlay-scrollbar`} style={Object.assign({ maxHeight: `${contentHeight}px` }, (!isMobile ? hoverStyle : {}))}>
|
|
143
|
+
<div className="flex items-center gap-[10px]">
|
|
144
|
+
{(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_logo_image_url) ? (<Image src={inquiryMainData.channel_logo_image_url} alt="로고" width={32} height={32}/>) : (<Image src={DaeryunLogoIcon} alt="대륜 로고" width={24} height={24} className="mr-2"/>)}
|
|
145
|
+
{/* <DaeryunLogoIcon width={24} height={24} className="mr-2" /> */}
|
|
146
|
+
<p className="dr_talk_title_small text-drTalkBlack">
|
|
147
|
+
{(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_name) || '법무법인(유한)대륜'}
|
|
148
|
+
</p>
|
|
149
|
+
</div>
|
|
150
|
+
<div className="dr_talk_body_medium2 relative ml-[42px] mr-[16px] mt-[16px] whitespace-pre-line">
|
|
151
|
+
{(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.salutation) || tempSasulation}
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
{isScroll && !isBottom && <ShadowBox />}
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div className={`mt-[40px] `}>
|
|
158
|
+
<Button3 className={`w-full`} onClick={handleStartChat} isDisabled={isLoading || !(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_number)}>
|
|
159
|
+
<div className="flex items-center justify-center gap-[4px]">
|
|
160
|
+
{!(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_number) ? (<div>{'로딩 중...'}</div>) : (<div>{isLoading ? '로딩 중...' : '문의하기'}</div>)}
|
|
161
|
+
{!isLoading && <Image src={SendIcon} alt="전송" width={24} height={24}/>}
|
|
162
|
+
{/* {!isLoading && <SendIcon width={24} height={24} />} */}
|
|
163
|
+
</div>
|
|
164
|
+
</Button3>
|
|
165
|
+
|
|
166
|
+
<div className="flex items-center justify-center gap-[4px] pt-[20px]">
|
|
167
|
+
<Image src={InfoIcon} alt="정보" width={20} height={20}/>
|
|
168
|
+
{/* <InfoIcon width={20} height={20} /> */}
|
|
169
|
+
<span className="dr_talk_body_small1 text-drTalkGrayscale2">
|
|
170
|
+
{(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.answer_speed_message) || '빠르게 답변 받으실 수 있어요'}
|
|
171
|
+
</span>
|
|
172
|
+
</div>
|
|
173
|
+
</div>
|
|
174
|
+
</section>
|
|
175
|
+
</div>
|
|
176
|
+
</div>);
|
|
177
|
+
};
|
|
178
|
+
export default HomeView;
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import Image from 'next/image';
|
|
5
|
+
import ShadowBox from './_ui/ShadowBox';
|
|
6
|
+
import { IChatInquiryMainDataResponse } from './_api/daeryuntalk/type/response';
|
|
7
|
+
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
8
|
+
import Button3 from './_ui/buttons/Button3';
|
|
9
|
+
import { useHoverScrollbar } from './_hooks/useHoverScrollbar';
|
|
10
|
+
import { useWindowSize } from './_hooks/useWindowSize';
|
|
11
|
+
|
|
12
|
+
// 이미지
|
|
13
|
+
// import DaeryuntalkIntro from '../../asset/images/daeryuntalk/daeryuntalk_home_bg.png';
|
|
14
|
+
// import TimeIcon from '../../asset/images/daeryuntalk/time.svg';
|
|
15
|
+
// import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
16
|
+
// import SendIcon from '../../asset/images/daeryuntalk/send.svg';
|
|
17
|
+
// import InfoIcon from '../../asset/images/daeryuntalk/info.svg';
|
|
18
|
+
// import CloseSvgIcon from '../../asset/images/daeryuntalk/close.svg';
|
|
19
|
+
|
|
20
|
+
interface IHomeViewProps {
|
|
21
|
+
inquiryMainData: IChatInquiryMainDataResponse | null;
|
|
22
|
+
isLoading: boolean;
|
|
23
|
+
handleStartChat: () => void;
|
|
24
|
+
isMobile: boolean;
|
|
25
|
+
onClose: () => void;
|
|
26
|
+
isHash: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClose, isHash }: IHomeViewProps) => {
|
|
30
|
+
const { containerRef, isScroll, isBottom, checkScroll, isScrolling } = useScrollShadow<HTMLDivElement>();
|
|
31
|
+
const s3Url = process.env.NEXT_PUBLIC_S3_URL;
|
|
32
|
+
const DaeryuntalkIntro = `${s3Url}/daeryuntalk/daeryuntalk_home_bg.png`;
|
|
33
|
+
const TimeIcon = `${s3Url}/daeryuntalk/time.svg`;
|
|
34
|
+
const DaeryunLogoIcon = `${s3Url}/daeryuntalk/daeryun-logo.svg`;
|
|
35
|
+
const SendIcon = `${s3Url}/daeryuntalk/send.svg`;
|
|
36
|
+
const InfoIcon = `${s3Url}/daeryuntalk/info.svg`;
|
|
37
|
+
const CloseSvgIcon = `${s3Url}/daeryuntalk/close.svg`;
|
|
38
|
+
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
39
|
+
const [contentHeight, setContentHeight] = useState<number>(210);
|
|
40
|
+
const currentHeightRef = useRef(210);
|
|
41
|
+
const prevWrapperHeightRef = useRef<number | null>(null);
|
|
42
|
+
const { style: hoverStyle } = useHoverScrollbar(containerRef);
|
|
43
|
+
const browserSize = useWindowSize();
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
const updateContentHeight = () => {
|
|
47
|
+
if (!wrapperRef.current) return;
|
|
48
|
+
|
|
49
|
+
// 모바일이거나 width가 480px 미만이면 contentHeight를 210으로 되돌림
|
|
50
|
+
if (isMobile) {
|
|
51
|
+
currentHeightRef.current = 210;
|
|
52
|
+
setContentHeight(210);
|
|
53
|
+
return;
|
|
54
|
+
} else {
|
|
55
|
+
if (browserSize.width < 480) {
|
|
56
|
+
// 브라우저 세로 - 헤더 - 고정 200px - 푸터 - 문의 버튼 크기1
|
|
57
|
+
const nextHeight = browserSize.height - 56 - 200 - 64 - 88 - 48;
|
|
58
|
+
currentHeightRef.current = nextHeight;
|
|
59
|
+
setContentHeight(nextHeight);
|
|
60
|
+
return;
|
|
61
|
+
} else {
|
|
62
|
+
setContentHeight(210);
|
|
63
|
+
|
|
64
|
+
const rect = wrapperRef.current?.getBoundingClientRect();
|
|
65
|
+
const gap = rect.top;
|
|
66
|
+
const wrapperHeight = wrapperRef.current.offsetHeight;
|
|
67
|
+
|
|
68
|
+
const currentHeight = currentHeightRef.current;
|
|
69
|
+
|
|
70
|
+
// 이전 높이와 비교하여 줄어드는 중인지 판단
|
|
71
|
+
const prevHeight = prevWrapperHeightRef.current;
|
|
72
|
+
const isShrinking = prevHeight !== null && wrapperHeight < prevHeight;
|
|
73
|
+
const isExpanding = prevHeight !== null && wrapperHeight > prevHeight;
|
|
74
|
+
|
|
75
|
+
prevWrapperHeightRef.current = wrapperHeight; // 현재 높이를 저장
|
|
76
|
+
|
|
77
|
+
// 줄어드는 애니메이션 (2단계)
|
|
78
|
+
if (isShrinking) {
|
|
79
|
+
if (currentHeight > 140) {
|
|
80
|
+
if (wrapperHeight <= 625) {
|
|
81
|
+
// 1단계: 210 → 140
|
|
82
|
+
const next = Math.max(140, currentHeight - 6);
|
|
83
|
+
currentHeightRef.current = next;
|
|
84
|
+
setContentHeight(next);
|
|
85
|
+
}
|
|
86
|
+
} else if (currentHeight > 80) {
|
|
87
|
+
// 여기에 height가 526 경우에만 가능
|
|
88
|
+
// 2단계: 140 → 80
|
|
89
|
+
if (wrapperHeight <= 526) {
|
|
90
|
+
const next = Math.max(80, currentHeight - 4);
|
|
91
|
+
currentHeightRef.current = next;
|
|
92
|
+
setContentHeight(next);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// 다시 늘어나는 애니메이션 (2단계)
|
|
97
|
+
else if (isExpanding) {
|
|
98
|
+
if (currentHeight < 140) {
|
|
99
|
+
// 1단계: 80 → 140
|
|
100
|
+
const next = Math.min(140, currentHeight + 4);
|
|
101
|
+
currentHeightRef.current = next;
|
|
102
|
+
setContentHeight(next);
|
|
103
|
+
} else if (currentHeight < 210) {
|
|
104
|
+
if (wrapperHeight >= 526) {
|
|
105
|
+
// 2단계: 140 → 210
|
|
106
|
+
const next = Math.min(210, currentHeight + 6);
|
|
107
|
+
currentHeightRef.current = next;
|
|
108
|
+
setContentHeight(next);
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
setContentHeight(210);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
let rafId: number;
|
|
119
|
+
const loop = () => {
|
|
120
|
+
updateContentHeight();
|
|
121
|
+
rafId = requestAnimationFrame(loop);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
rafId = requestAnimationFrame(loop);
|
|
125
|
+
|
|
126
|
+
return () => cancelAnimationFrame(rafId);
|
|
127
|
+
}, [isMobile, inquiryMainData, browserSize.width]);
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
checkScroll();
|
|
130
|
+
}, [inquiryMainData]);
|
|
131
|
+
|
|
132
|
+
const tempSasulation = `안녕하세요.\n법무법인(유한)대륜입니다.\n방문해 주셔서 감사합니다. \n궁금한 점이나 도움이 필요하신 부분 \n말씀해 주시면 도와드리겠습니다.\n\n※ 성함과 연락처를 남겨주시면 갑작스럽게 채팅이 중단될 경우 전화나 문자(알림톡)를 통해 중요한 답변을 놓치지 않도록 도와드리고 있으며 이전 내역 확인 후 빠른 안내가 가능합니다. \n\n※ 만 14세 미만의 경우에는 보호자의 동의 없이는 개인정보 수집 및 이용이 불가능합니다. \n만 14세 미만의 미성년자의 경우 법정대리인의 연락처를 알려 주시면 동의서를 보내드리도록 하겠습니다.\n\n채팅방을 나가신 후 문의하실 경우에도 동일한 내용으로 대화를 이어가실 수 있습니다. \n\n수집된 개인 정보는 답변 알림 및 상담예약안내 목적으로만 이용되며 삭제를 요청하시기 전까지 보유됩니다. 개인정보 입력시 개인정보제공에 동의한 것으로 봅니다. 개인정보제공에 동의하지 않으실 경우 답변 알림을 받으실 수 없습니다.\n\n✅ 6:00~24:00 외 시간에는 인력편성에 따라 순차적으로 응대를 도와드리고 있습니다."
|
|
133
|
+
`;
|
|
134
|
+
|
|
135
|
+
const backgroundImage = inquiryMainData?.sleeve_image_url || DaeryuntalkIntro;
|
|
136
|
+
return (
|
|
137
|
+
<div
|
|
138
|
+
ref={wrapperRef}
|
|
139
|
+
className={`
|
|
140
|
+
no-scrollbar relative w-full rounded-t-[30px]
|
|
141
|
+
${
|
|
142
|
+
isMobile
|
|
143
|
+
? ` flex h-[calc(100%-64px)] flex-col items-center justify-between `
|
|
144
|
+
: ` flex h-[100vh] flex-col items-center justify-between xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ` +
|
|
145
|
+
` xs:max-h-[626px] xs:min-h-[320px] `
|
|
146
|
+
}
|
|
147
|
+
`}
|
|
148
|
+
>
|
|
149
|
+
<header className="z-10 flex h-[56px] w-full justify-between rounded-t-[30px] px-[20px]">
|
|
150
|
+
<div className="dr_talk_subtitle_small flex items-center gap-[2px] pt-[31.5px] text-drTalkGrayscale1">
|
|
151
|
+
<Image src={TimeIcon} alt="시간" width={20} height={20} />
|
|
152
|
+
{/* <TimeIcon width={20} height={20} /> */}
|
|
153
|
+
<span>24시간 운영</span>
|
|
154
|
+
</div>
|
|
155
|
+
<div
|
|
156
|
+
className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : 'xs:pointer-events-none xs:!opacity-0'} py-[14px] text-drTalkGrayscale2 hover:cursor-pointer`}
|
|
157
|
+
onClick={onClose}
|
|
158
|
+
>
|
|
159
|
+
<Image src={CloseSvgIcon} alt="닫기" width={28} height={28} />
|
|
160
|
+
{/* <CloseSvgIcon width={28} height={28} /> */}
|
|
161
|
+
</div>
|
|
162
|
+
</header>
|
|
163
|
+
|
|
164
|
+
<div
|
|
165
|
+
className={`absolute left-0 top-0 z-0 w-full overflow-hidden ${
|
|
166
|
+
isMobile ? 'aspect-[16/9] max-h-[360px]' : 'h-full max-h-[360px]'
|
|
167
|
+
}`}
|
|
168
|
+
>
|
|
169
|
+
{/*<div className={`relative`}>*/}
|
|
170
|
+
<Image
|
|
171
|
+
src={backgroundImage}
|
|
172
|
+
alt="대화 배경"
|
|
173
|
+
fill
|
|
174
|
+
className={`will-change-transform ${
|
|
175
|
+
isMobile ? 'object-cover object-top' : ' object-cover object-top xs:object-contain '
|
|
176
|
+
}`}
|
|
177
|
+
priority
|
|
178
|
+
/>
|
|
179
|
+
<div className="pointer-events-none absolute bottom-0 left-0 h-24 w-full bg-gradient-to-t from-white to-transparent" />
|
|
180
|
+
{/*</div>*/}
|
|
181
|
+
</div>
|
|
182
|
+
{!isMobile && <div className={`block h-[200px] xs:hidden`}></div>}
|
|
183
|
+
|
|
184
|
+
<div
|
|
185
|
+
className={` relative z-10 px-[20px] ${isMobile ? 'flex w-full justify-center pb-[20px]' : 'flex h-full w-full flex-col justify-center pb-[84px] xs:h-fit xs:pb-[34px]'}`}
|
|
186
|
+
>
|
|
187
|
+
<section
|
|
188
|
+
className={` flex h-full flex-col rounded-[12px] bg-white px-[16px] py-[24px] sm:h-fit ${isMobile ? 'w-full' : ' justify-between xs:justify-start '}`}
|
|
189
|
+
style={{ boxShadow: '0px 4px 10px 0px #00000026' }}
|
|
190
|
+
>
|
|
191
|
+
{/* 해당 컴포넌트의 최상위 부모와 브라우저 상단과 닿았을 때 우선적으로 해당 부분의 높이가 먼저 줄어들게 하고 싶다*/}
|
|
192
|
+
<div className="relative">
|
|
193
|
+
<div
|
|
194
|
+
ref={containerRef}
|
|
195
|
+
className={`flex min-h-[80px] flex-col overscroll-contain ${isMobile ? 'overflow-y-auto overscroll-contain ' : ''} overlay-scrollbar`}
|
|
196
|
+
style={{
|
|
197
|
+
maxHeight: `${contentHeight}px`,
|
|
198
|
+
...(!isMobile ? hoverStyle : {})
|
|
199
|
+
}}
|
|
200
|
+
>
|
|
201
|
+
<div className="flex items-center gap-[10px]">
|
|
202
|
+
{inquiryMainData?.channel_logo_image_url ? (
|
|
203
|
+
<Image
|
|
204
|
+
src={inquiryMainData.channel_logo_image_url}
|
|
205
|
+
alt="로고"
|
|
206
|
+
width={32}
|
|
207
|
+
height={32}
|
|
208
|
+
/>
|
|
209
|
+
) : (
|
|
210
|
+
<Image
|
|
211
|
+
src={DaeryunLogoIcon}
|
|
212
|
+
alt="대륜 로고"
|
|
213
|
+
width={24}
|
|
214
|
+
height={24}
|
|
215
|
+
className="mr-2"
|
|
216
|
+
/>
|
|
217
|
+
)}
|
|
218
|
+
{/* <DaeryunLogoIcon width={24} height={24} className="mr-2" /> */}
|
|
219
|
+
<p className="dr_talk_title_small text-drTalkBlack">
|
|
220
|
+
{inquiryMainData?.channel_name || '법무법인(유한)대륜'}
|
|
221
|
+
</p>
|
|
222
|
+
</div>
|
|
223
|
+
<div className="dr_talk_body_medium2 relative ml-[42px] mr-[16px] mt-[16px] whitespace-pre-line">
|
|
224
|
+
{inquiryMainData?.salutation || tempSasulation}
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
{isScroll && !isBottom && <ShadowBox />}
|
|
228
|
+
</div>
|
|
229
|
+
|
|
230
|
+
<div className={`mt-[40px] `}>
|
|
231
|
+
<Button3
|
|
232
|
+
className={`w-full`}
|
|
233
|
+
onClick={handleStartChat}
|
|
234
|
+
isDisabled={isLoading || !inquiryMainData?.channel_number}
|
|
235
|
+
>
|
|
236
|
+
<div className="flex items-center justify-center gap-[4px]">
|
|
237
|
+
{!inquiryMainData?.channel_number ? (
|
|
238
|
+
<div>{'로딩 중...'}</div>
|
|
239
|
+
) : (
|
|
240
|
+
<div>{isLoading ? '로딩 중...' : '문의하기'}</div>
|
|
241
|
+
)}
|
|
242
|
+
{!isLoading && <Image src={SendIcon} alt="전송" width={24} height={24} />}
|
|
243
|
+
{/* {!isLoading && <SendIcon width={24} height={24} />} */}
|
|
244
|
+
</div>
|
|
245
|
+
</Button3>
|
|
246
|
+
|
|
247
|
+
<div className="flex items-center justify-center gap-[4px] pt-[20px]">
|
|
248
|
+
<Image src={InfoIcon} alt="정보" width={20} height={20} />
|
|
249
|
+
{/* <InfoIcon width={20} height={20} /> */}
|
|
250
|
+
<span className="dr_talk_body_small1 text-drTalkGrayscale2">
|
|
251
|
+
{inquiryMainData?.answer_speed_message || '빠르게 답변 받으실 수 있어요'}
|
|
252
|
+
</span>
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
</section>
|
|
256
|
+
</div>
|
|
257
|
+
</div>
|
|
258
|
+
);
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export default HomeView;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { History as HisResType } from './_api/daeryuntalk/type/response';
|
|
3
|
+
type NavigationFooterProps = {
|
|
4
|
+
activeView: 'home' | 'history' | 'conversation';
|
|
5
|
+
onHomeClick: () => void;
|
|
6
|
+
onHistoryClick: () => void;
|
|
7
|
+
historyList: HisResType[];
|
|
8
|
+
isAuthenticated: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const NavigationFooter: React.FC<NavigationFooterProps>;
|
|
11
|
+
export default NavigationFooter;
|