@daeryun/dr_components 0.8.47 → 0.8.49

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.
Files changed (120) hide show
  1. package/dist/asset/images/daeryuntalk/close.svg +2 -2
  2. package/dist/asset/images/daeryuntalk/time.svg +2 -2
  3. package/dist/asset/images/daeryuntalk/viewer/zoom-out.svg +2 -4
  4. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  5. package/dist/components/Daeryuntalk/ChatButton.jsx +5 -2
  6. package/dist/components/Daeryuntalk/ChatButton.tsx +5 -2
  7. package/dist/components/Daeryuntalk/ChatConversation.d.ts +2 -0
  8. package/dist/components/Daeryuntalk/ChatConversation.jsx +22 -63
  9. package/dist/components/Daeryuntalk/ChatConversation.tsx +42 -79
  10. package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.d.ts +11 -0
  11. package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.jsx +27 -0
  12. package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.tsx +57 -0
  13. package/dist/components/Daeryuntalk/ChatHomeView.d.ts +3 -2
  14. package/dist/components/Daeryuntalk/ChatHomeView.jsx +61 -182
  15. package/dist/components/Daeryuntalk/ChatHomeView.tsx +103 -206
  16. package/dist/components/Daeryuntalk/ChatItem/ChatFile.jsx +15 -14
  17. package/dist/components/Daeryuntalk/ChatItem/ChatFile.tsx +15 -14
  18. package/dist/components/Daeryuntalk/ChatItem/ChatLoading.d.ts +3 -0
  19. package/dist/components/Daeryuntalk/ChatItem/ChatLoading.jsx +11 -0
  20. package/dist/components/Daeryuntalk/ChatItem/ChatLoading.tsx +21 -0
  21. package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.jsx +4 -4
  22. package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.tsx +4 -4
  23. package/dist/components/Daeryuntalk/ChatItem/RichText.jsx +2 -1
  24. package/dist/components/Daeryuntalk/ChatItem/RichText.tsx +2 -1
  25. package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.d.ts +9 -0
  26. package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.jsx +9 -0
  27. package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.tsx +20 -0
  28. package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.jsx +3 -3
  29. package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.tsx +3 -3
  30. package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.jsx +2 -2
  31. package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.tsx +2 -2
  32. package/dist/components/Daeryuntalk/ChatMessage.d.ts +1 -0
  33. package/dist/components/Daeryuntalk/ChatMessage.jsx +31 -36
  34. package/dist/components/Daeryuntalk/ChatMessage.tsx +34 -38
  35. package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.jsx +2 -2
  36. package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.tsx +2 -2
  37. package/dist/components/Daeryuntalk/ChatObject/ObjectBack.jsx +1 -1
  38. package/dist/components/Daeryuntalk/ChatObject/ObjectBack.tsx +1 -1
  39. package/dist/components/Daeryuntalk/ChatObject/ObjectButton.jsx +6 -23
  40. package/dist/components/Daeryuntalk/ChatObject/ObjectButton.tsx +6 -23
  41. package/dist/components/Daeryuntalk/ChatWidget.jsx +60 -23
  42. package/dist/components/Daeryuntalk/ChatWidget.tsx +72 -34
  43. package/dist/components/Daeryuntalk/DaeryuntalkContext.d.ts +2 -2
  44. package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +3 -3
  45. package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +5 -5
  46. package/dist/components/Daeryuntalk/DateSeparator.jsx +2 -2
  47. package/dist/components/Daeryuntalk/DateSeparator.tsx +2 -2
  48. package/dist/components/Daeryuntalk/FixedErrorBox.d.ts +7 -0
  49. package/dist/components/Daeryuntalk/FixedErrorBox.jsx +33 -0
  50. package/dist/components/Daeryuntalk/FixedErrorBox.tsx +73 -0
  51. package/dist/components/Daeryuntalk/History/AuthForm.d.ts +3 -1
  52. package/dist/components/Daeryuntalk/History/AuthForm.jsx +15 -45
  53. package/dist/components/Daeryuntalk/History/AuthForm.tsx +21 -53
  54. package/dist/components/Daeryuntalk/HistoryView.d.ts +4 -0
  55. package/dist/components/Daeryuntalk/HistoryView.jsx +17 -40
  56. package/dist/components/Daeryuntalk/HistoryView.tsx +36 -48
  57. package/dist/components/Daeryuntalk/HomeView.d.ts +12 -0
  58. package/dist/components/Daeryuntalk/HomeView.jsx +102 -0
  59. package/dist/components/Daeryuntalk/HomeView.tsx +150 -0
  60. package/dist/components/Daeryuntalk/NavigationFooter.jsx +17 -10
  61. package/dist/components/Daeryuntalk/NavigationFooter.tsx +22 -12
  62. package/dist/components/Daeryuntalk/NoticeMessage.jsx +7 -7
  63. package/dist/components/Daeryuntalk/NoticeMessage.tsx +7 -7
  64. package/dist/components/Daeryuntalk/Toast/ToastRender.jsx +1 -1
  65. package/dist/components/Daeryuntalk/Toast/ToastRender.tsx +2 -2
  66. package/dist/components/Daeryuntalk/Viewer/ImageViewer.d.ts +6 -0
  67. package/dist/components/Daeryuntalk/Viewer/ImageViewer.jsx +18 -90
  68. package/dist/components/Daeryuntalk/Viewer/ImageViewer.tsx +49 -135
  69. package/dist/components/Daeryuntalk/Viewer/MobileViewer.d.ts +16 -0
  70. package/dist/components/Daeryuntalk/Viewer/MobileViewer.jsx +66 -0
  71. package/dist/components/Daeryuntalk/Viewer/MobileViewer.tsx +121 -0
  72. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.d.ts +22 -0
  73. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.jsx +104 -0
  74. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +195 -0
  75. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.d.ts +4 -3
  76. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.js +81 -105
  77. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.ts +105 -121
  78. package/dist/components/Daeryuntalk/_enums/ask-status.d.ts +7 -0
  79. package/dist/components/Daeryuntalk/_enums/ask-status.js +14 -0
  80. package/dist/components/Daeryuntalk/_enums/ask-status.ts +14 -0
  81. package/dist/components/Daeryuntalk/_enums/error.d.ts +3 -0
  82. package/dist/components/Daeryuntalk/_enums/error.js +125 -0
  83. package/dist/components/Daeryuntalk/_enums/error.ts +143 -0
  84. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.d.ts +8 -8
  85. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.js +227 -179
  86. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.ts +261 -185
  87. package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.d.ts +1 -1
  88. package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.js +54 -18
  89. package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.ts +68 -15
  90. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +2 -2
  91. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +8 -7
  92. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +13 -6
  93. package/dist/components/Daeryuntalk/_hooks/view/useChatSocketState.d.ts +2 -0
  94. package/dist/components/Daeryuntalk/_hooks/{talkprovider → view}/useChatSocketState.js +7 -1
  95. package/dist/components/Daeryuntalk/_hooks/{talkprovider → view}/useChatSocketState.ts +13 -1
  96. package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.d.ts +26 -0
  97. package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.js +72 -0
  98. package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.ts +93 -0
  99. package/dist/components/Daeryuntalk/_hooks/view/useHomeView.d.ts +16 -0
  100. package/dist/components/Daeryuntalk/_hooks/view/useHomeView.js +61 -0
  101. package/dist/components/Daeryuntalk/_hooks/view/useHomeView.ts +64 -0
  102. package/dist/components/Daeryuntalk/_lib/utils.d.ts +1 -0
  103. package/dist/components/Daeryuntalk/_lib/utils.js +27 -0
  104. package/dist/components/Daeryuntalk/_lib/utils.ts +33 -0
  105. package/dist/components/Daeryuntalk/_ui/buttons/Button2.jsx +3 -3
  106. package/dist/components/Daeryuntalk/_ui/buttons/Button2.tsx +3 -3
  107. package/dist/components/Daeryuntalk/_ui/buttons/Button3.d.ts +10 -0
  108. package/dist/components/Daeryuntalk/_ui/buttons/Button3.jsx +12 -0
  109. package/dist/components/Daeryuntalk/_ui/buttons/Button3.tsx +29 -0
  110. package/dist/components/Daeryuntalk/_ui/inputs/Input2.jsx +2 -1
  111. package/dist/components/Daeryuntalk/_ui/inputs/Input2.tsx +2 -1
  112. package/dist/components/Daeryuntalk/index.jsx +1 -1
  113. package/dist/components/Daeryuntalk/index.tsx +12 -1
  114. package/dist/styles/globals.css +510 -168
  115. package/dist/tsconfig.tsbuildinfo +1 -1
  116. package/package.json +1 -1
  117. package/dist/components/Daeryuntalk/_enums/error_code.d.ts +0 -21
  118. package/dist/components/Daeryuntalk/_enums/error_code.js +0 -23
  119. package/dist/components/Daeryuntalk/_enums/error_code.ts +0 -22
  120. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatSocketState.d.ts +0 -1
@@ -8,180 +8,135 @@ import SendIcon from '../../asset/images/daeryuntalk/send.svg';
8
8
  import TimeIcon from '../../asset/images/daeryuntalk/time.svg';
9
9
  import InfoIcon from '../../asset/images/daeryuntalk/info.svg';
10
10
  import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
11
- import DaeryuntalkIntro from '../../asset/images/daeryuntalk/daeryuntalk-intro.png';
12
- import CloseSvgIcon from '../../asset/images/daeryuntalk/close.svg';
11
+
13
12
  import { IChatInquiryMainDataResponse } from './_api/daeryuntalk/type/response';
14
- import { useChatSocketState } from './_hooks/talkprovider/useChatSocketState';
13
+ import { useChatSocketState } from './_hooks/view/useChatSocketState';
15
14
  import { useScrollShadow } from './_hooks/useScrollShadow';
16
15
  import ShadowBox from './_ui/ShadowBox';
17
16
  import { useDaeryunTalkToast } from './Toast/DaeryuntalkToastProvider';
18
17
  import ToastRenderer from './Toast/ToastRender';
19
18
  import { getChatInquiryMain } from './_api';
19
+ import HomeView from './HomeView';
20
+ import { useHistoryView } from './_hooks/view/useHistoryView';
21
+ import { useHomeView } from './_hooks/view/useHomeView';
22
+ import FixedErrorBox from './FixedErrorBox';
20
23
 
21
- type ViewState = 'home' | 'conversation' | 'history';
24
+ export type ViewState = 'home' | 'conversation' | 'history';
22
25
 
23
26
  type ChatHomeViewProps = {
24
27
  hashValue: string | null;
25
- setHashValue: Dispatch<SetStateAction<string | null>>;
26
28
  isMobile: boolean;
27
29
  isHash: boolean;
30
+ onClose: () => void;
28
31
  };
29
- const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, setHashValue, isMobile, isHash }) => {
32
+ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobile, isHash }) => {
33
+ const [viewState, setViewState] = useState<ViewState>(hashValue ? 'conversation' : 'home');
34
+ const [isLoading, setIsLoading] = useState<boolean>(false);
35
+ const { isConnected, isAuthenticated, historyList, inquiryMainData, chatInquiryNumber, startChat } =
36
+ useDaeryuntalk();
37
+ // 소켓 이벤트
38
+ const { sendInquiryJoined, sendHeartbeat, sendInquiryWatching, sendInquiryLeft, sendHistoryEntered } =
39
+ useDaeryuntalk();
40
+ // 홈
41
+ const { retryInquiryMain } = useDaeryuntalk();
42
+ // 히스토리
30
43
  const {
31
- isConnected,
32
- isAuthenticated,
33
- historyList,
34
- inquiryMainData,
35
- startChat,
44
+ startSelectedChat,
45
+ attendRoomByHistory,
36
46
  createNewChat,
47
+ goRequestPhone,
48
+ goGetHistoryList,
49
+ goHistoryPhoneAuth
50
+ } = useDaeryuntalk();
51
+
52
+ // 소켓 클라 -> 서버 관리
53
+ useChatSocketState(
37
54
  chatInquiryNumber,
55
+ viewState,
56
+ sendInquiryWatching,
38
57
  sendInquiryJoined,
39
58
  sendHeartbeat,
40
- sendInquiryWatching,
41
59
  sendInquiryLeft,
42
- goGetHistoryList,
60
+ isConnected,
61
+ isAuthenticated,
43
62
  sendHistoryEntered,
44
- startSelectedChat,
45
- attendRoomByHistory,
46
- retryInquiryMain
47
- } = useDaeryuntalk();
63
+ historyList
64
+ );
48
65
 
49
- const [viewState, setViewState] = useState<ViewState>('home');
50
- const [mainData, setMainData] = useState<IChatInquiryMainDataResponse | null>(null);
51
- const [isLoading, setIsLoading] = useState(false);
52
- const { containerRef, isScroll, isBottom, checkScroll } = useScrollShadow<HTMLDivElement>();
53
- const toast = useDaeryunTalkToast();
54
- // 아직 커버이미지 url이 안나옴
55
- const backgroundImage = mainData?.sleeve_image_url ? mainData.sleeve_image_url : DaeryuntalkIntro;
56
- const handleStartChat = async () => {
57
- try {
58
- setIsLoading(true);
59
- const res = await retryInquiryMain(mainData?.channel_number || '');
60
- if (res?.result_info?.result_cd === 'OK' || res?.result_info?.result_type_cd === 'OK') {
61
- // 여기서 짚어넣고 main
62
- // 채팅 시작 - 새 문의 생성 또는 기존 문의 조회 처리
63
- //
64
- const startRes = await startChat(res?.data?.progress_inquiry_number);
65
- if (startRes) {
66
- // 대화 화면으로 전환
67
- setViewState('conversation');
68
- } else {
69
- toast.error('문의 시작에 실패했습니다.');
70
- }
71
- } else {
72
- toast.error('채팅문의 시작에 실패했습니다.');
73
- }
74
- } catch (error) {
75
- console.error('채팅 시작 실패:', error);
76
- } finally {
77
- setIsLoading(false);
78
- }
79
- };
66
+ // 홈 뷰 훅스
67
+ const { handleStartChat, handleHashStartChat, handleBackToHome } = useHomeView({
68
+ setIsLoading,
69
+ setViewState,
70
+ retryInquiryMain,
71
+ inquiryMainData: inquiryMainData ?? null,
72
+ startChat
73
+ });
80
74
 
81
- const handleHashStartChat = async () => {
82
- try {
83
- setIsLoading(true);
84
- await startChat();
85
- // 대화 화면으로 전환
86
- setViewState('conversation');
87
- } catch (error) {
88
- console.error('채팅 시작 실패:', error);
89
- } finally {
90
- setIsLoading(false);
91
- }
92
- };
75
+ // 히스토리 뷰 hooks
76
+ const {
77
+ handleChatHistoryClick,
78
+ handleNewStartChat,
79
+ handleHistoryClick,
80
+ handleGoRequestPhone,
81
+ handleGoHistoryPhoneAuth
82
+ } = useHistoryView({
83
+ attendRoomByHistory,
84
+ startSelectedChat,
85
+ setViewState,
86
+ setIsLoading,
87
+ createNewChat,
88
+ goRequestPhone,
89
+ goHistoryPhoneAuth
90
+ });
93
91
 
94
92
  useEffect(() => {
95
93
  if (hashValue && isConnected && inquiryMainData && inquiryMainData.channel_number) {
96
- console.log('해쉬 실행');
97
94
  handleHashStartChat();
98
95
  } else {
99
- console.log('해쉬 실행안함');
100
96
  }
101
97
  }, [hashValue, isConnected, inquiryMainData]);
102
98
 
103
- //
104
- useEffect(() => {
105
- checkScroll();
106
- }, [mainData]);
107
-
108
- //
109
- useEffect(() => {
110
- if (inquiryMainData) {
111
- setMainData(inquiryMainData);
112
- }
113
- }, [inquiryMainData]);
114
-
115
99
  // 히스토리 진입 시
116
100
  useEffect(() => {
117
101
  if (isAuthenticated && viewState === 'history') {
118
102
  goGetHistoryList({});
119
103
  }
120
104
  }, [viewState, isAuthenticated]);
121
- // 소켓
122
- useEffect(() => {
123
- if (isConnected && isAuthenticated && viewState === 'history') {
124
- sendHistoryEntered(historyList ? historyList.map(item => item.chat_inquiry_number) : []);
125
- }
126
- }, [isConnected, isAuthenticated, historyList, viewState]);
127
-
128
- // 채팅창관리
129
- useChatSocketState(
130
- chatInquiryNumber,
131
- viewState,
132
- sendInquiryWatching,
133
- sendInquiryJoined,
134
- sendHeartbeat,
135
- sendInquiryLeft
136
- );
137
-
138
- // 히스토리에서 사용
139
- const handleNewStartChat = async () => {
140
- try {
141
- setIsLoading(true);
142
- // 채팅 시작 - 새 문의 생성 또는 기존 문의 조회 처리
143
- await createNewChat();
144
- // 대화 화면으로 전환
145
- setViewState('conversation');
146
- } catch (error) {
147
- console.error('신규 채팅 실패:', error);
148
- } finally {
149
- setIsLoading(false);
150
- }
151
- };
152
-
153
- const handleHistoryClick = async () => {
154
- setViewState('history');
155
- };
156
-
157
- const handleBackToHome = () => {
158
- setViewState('home');
159
- };
160
-
161
- const handleChatHistoryClick = async (chatNumber: string) => {
162
- try {
163
- setIsLoading(true);
164
- const response = await attendRoomByHistory(chatNumber);
165
- if (response?.result_info?.result_cd === 'OK' || response?.result_info?.result_type_cd === 'OK') {
166
- await startSelectedChat(chatNumber);
167
- setViewState('conversation');
168
- } else {
169
- toast.error('문의 참여에 실패했습니다.');
170
- }
171
- } catch (e) {
172
- console.error('e', e);
173
- } finally {
174
- setIsLoading(false);
175
- }
176
- };
105
+ console.log('isConnected', isConnected);
177
106
 
178
107
  const renderWithNavigation = (content: React.ReactNode, activeView: 'home' | 'history' | 'conversation') => {
179
108
  return (
180
109
  <main
181
- className={`${isMobile ? 'h-[100dvh] w-screen' : ''} relative flex items-center justify-center rounded-[30px]`}
110
+ className={`
111
+ relative flex justify-end
112
+ ${isMobile ? 'h-[100dvh]' : 'h-[100dvh] xs:h-auto xs:rounded-[30px] '}
113
+ `}
114
+ // ${isMobile ? 'h-[100dvh] w-screen' : ''} relative flex items-center justify-center rounded-[30px]
182
115
  >
183
116
  <div
184
- className={`${isMobile ? 'h-[100dvh] w-full' : ' h-[690px] w-[390px]'} relative overflow-hidden rounded-[30px] bg-white shadow-[0px_12px_60px_5px_rgba(0,0,0,0.3)]`}
117
+ className={`
118
+ relative overflow-hidden bg-white
119
+ ${
120
+ isMobile
121
+ ? `h-[100dvh] w-full rounded-[0px]`
122
+ : `
123
+ ${
124
+ isHash
125
+ ? `
126
+ h-[100dvh] w-full rounded-[0px]
127
+ xs:max-h-[690px] xs:w-[390px] xs:rounded-[30px]
128
+ xs:shadow-[0px_12px_60px_5px_rgba(0,0,0,0.3)]
129
+ `
130
+ : `
131
+ h-[100dvh] w-full rounded-[0px]
132
+ xs:max-h-[690px] xs:w-[390px] xs:rounded-[30px]
133
+ `
134
+ }
135
+
136
+ `
137
+ }
138
+
139
+ `}
185
140
  >
186
141
  <div className="flex h-full flex-col">
187
142
  <div className="flex-1 overflow-hidden">{content}</div>
@@ -195,7 +150,8 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, setHashValue, is
195
150
  />
196
151
  </div>
197
152
  </div>
198
- {(isMobile || isHash) && <ToastRenderer />}
153
+ <ToastRenderer />
154
+ <FixedErrorBox isError={isConnected === null ? false : !isConnected} />
199
155
  </main>
200
156
  );
201
157
  };
@@ -208,6 +164,8 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, setHashValue, is
208
164
  isActive={viewState === 'conversation'}
209
165
  onChatNew={handleNewStartChat}
210
166
  isMobile={isMobile}
167
+ onClose={onClose}
168
+ isHash={isHash}
211
169
  />,
212
170
  'conversation'
213
171
  );
@@ -223,6 +181,10 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, setHashValue, is
223
181
  historyLit={historyList ?? []}
224
182
  goGetHistoryList={goGetHistoryList}
225
183
  isMobile={isMobile}
184
+ onClose={onClose}
185
+ isHash={isHash}
186
+ handleGoRequestPhone={handleGoRequestPhone}
187
+ handleGoHistoryPhoneAuth={handleGoHistoryPhoneAuth}
226
188
  />,
227
189
  'history'
228
190
  );
@@ -230,79 +192,14 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, setHashValue, is
230
192
 
231
193
  // 홈
232
194
  return renderWithNavigation(
233
- <div className={`relative h-full w-full`}>
234
- <div className="absolute left-0 top-0 z-0 h-full w-full overflow-hidden">
235
- <Image
236
- src={backgroundImage}
237
- alt="대화 배경"
238
- fill
239
- className="object-contain object-top will-change-transform"
240
- />
241
- </div>
242
-
243
- <div className="relative z-10 flex h-full flex-col">
244
- <header className="mt-2 flex items-center p-4 text-xs text-black">
245
- <TimeIcon width={16} height={16} />
246
- <span>24시간 운영</span>
247
- </header>
248
-
249
- <section
250
- className=" mx-auto mt-[150px] flex w-[320px] flex-col gap-5 rounded-[12px] bg-white px-4 py-6 "
251
- style={{
252
- boxShadow: '0px 4px 10px 0px #00000026'
253
- }}
254
- >
255
- <div className="flex items-center">
256
- {mainData?.channel_logo_image_url ? (
257
- <Image
258
- src={mainData.channel_logo_image_url}
259
- alt="로고"
260
- width={24}
261
- height={24}
262
- className="mr-2"
263
- />
264
- ) : (
265
- <DaeryunLogoIcon width={24} height={24} className="mr-2" />
266
- )}
267
- <h1 className="font-medium">{mainData?.channel_name || '법무법인(유한)대륜'}</h1>
268
- </div>
269
-
270
- <div className={`relative`}>
271
- <div
272
- ref={containerRef}
273
- className="no-scrollbar relative mx-8 max-h-[162px] overflow-auto whitespace-pre-line text-sm font-normal leading-[130%]"
274
- >
275
- {mainData?.salutation ||
276
- `안녕하세요.
277
- 법무법인(유한)대륜입니다.
278
- 방문해 주셔서 감사합니다.
279
- 궁금한 점이나 도움이 필요하신 부분
280
- 말씀해 주시면 도와드리겠습니다.
281
-
282
- 6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다.`}
283
- </div>
284
- {!isScroll && !isBottom && <ShadowBox />}
285
- </div>
286
-
287
- <button
288
- className="mt-4 flex h-[48px] w-full items-center justify-center gap-2.5 rounded-[25px] bg-[#2E385B] px-6 py-3 text-white"
289
- aria-label={`문의하기`}
290
- onClick={handleStartChat}
291
- disabled={isLoading}
292
- >
293
- {isLoading ? '로딩 중...' : '문의하기'}
294
- {!isLoading && <SendIcon width={24} height={24} />}
295
- </button>
296
-
297
- <div className="flex items-center justify-center gap-1">
298
- <InfoIcon width={20} height={20} />
299
- <span className="text-xs font-normal text-gray-500">
300
- {mainData?.answer_speed_message || '빠르게 답변 받으실 수 있어요'}
301
- </span>
302
- </div>
303
- </section>
304
- </div>
305
- </div>,
195
+ <HomeView
196
+ inquiryMainData={inquiryMainData ?? null}
197
+ isLoading={isLoading}
198
+ handleStartChat={handleStartChat}
199
+ isMobile={isMobile}
200
+ onClose={onClose}
201
+ isHash={isHash}
202
+ />,
306
203
  'home'
307
204
  );
308
205
  };
@@ -13,6 +13,7 @@ import { formatFileSize } from '../_lib/utils';
13
13
  import FileDownLoadIcon from '../../../asset/images/daeryuntalk/viewer/gray-download.svg';
14
14
  import { useDaeryuntalk } from '../DaeryuntalkContext';
15
15
  import { getMessageFileDownloadUrl } from '../_api';
16
+ import TimeWrapper from './TimeWrapper';
16
17
  const ChatFile = ({ message, isOperator, isHovered, time }) => {
17
18
  const { openImageViewer } = useDaeryuntalk();
18
19
  const handleDownload = (file) => __awaiter(void 0, void 0, void 0, function* () {
@@ -45,24 +46,24 @@ const ChatFile = ({ message, isOperator, isHovered, time }) => {
45
46
  const files = message.files
46
47
  ? message.files.filter(file => file.type !== 'image').sort((a, b) => a.sequence - b.sequence)
47
48
  : [];
48
- return (<div className={`flex flex-col gap-3`}>
49
+ return (<div className={`flex flex-col gap-[10px]`}>
49
50
  {images.length > 0 && renderMedia({ type: 'image', images })}
50
51
  {files.length > 0 && renderMedia({ type: 'file', files })}
51
52
  </div>);
52
53
  };
53
54
  const renderMedia = (media) => {
54
55
  if (media.type === 'image') {
55
- return (<div className={`flex w-full items-end justify-start gap-[4px]`}>
56
+ return (<TimeWrapper time={time}>
56
57
  {media.images.length > 1 ? (<div className={`flex flex-col`}>
57
58
  {/* grid로 감싸진 짝수 개수 또는 홀수에서 마지막 전까지 */}
58
- <div className="group grid grid-cols-2 gap-2 rounded-[10px] border-[1px] border-[#EDEDED] p-[8px]">
59
+ <div className="group grid grid-cols-2 gap-[8px] rounded-[10px] border-[1px] border-drTalkGrayscale4 p-[8px]">
59
60
  {media.images.map((file, index) => {
60
61
  const isLastOdd = media.images.length % 2 === 1 && index === media.images.length - 1;
61
62
  if (isLastOdd)
62
63
  return null;
63
64
  return (<div key={index} className="group/image relative aspect-square h-[100px] w-[113px] overflow-hidden rounded-[5px]" onClick={() => {
64
65
  if (media.type === 'image') {
65
- openImageViewer === null || openImageViewer === void 0 ? void 0 : openImageViewer(media.images[media.images.length - 1], message);
66
+ openImageViewer === null || openImageViewer === void 0 ? void 0 : openImageViewer(media.images[index], message);
66
67
  }
67
68
  }}>
68
69
  <Image src={file.thumbnailUrl} alt={file.name} width={113} height={100} className="h-full w-full cursor-pointer rounded-md object-cover" onClick={() => { }}/>
@@ -70,7 +71,7 @@ const ChatFile = ({ message, isOperator, isHovered, time }) => {
70
71
  e.stopPropagation();
71
72
  yield handleDownload(file);
72
73
  })} className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center rounded-full opacity-0 transition-opacity group-hover/image:opacity-100">
73
- <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full bg-white"/>
74
+ <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full bg-drTalkWhite"/>
74
75
  </button>
75
76
  </div>);
76
77
  })}
@@ -90,7 +91,7 @@ const ChatFile = ({ message, isOperator, isHovered, time }) => {
90
91
  yield handleDownload(media.images[media.images.length - 1]);
91
92
  }
92
93
  })} className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center rounded-full opacity-0 transition-opacity group-hover/image:opacity-100">
93
- <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full text-[#777777] "/>
94
+ <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full text-drTalkGrayscale2 "/>
94
95
  </button>
95
96
  </div>
96
97
  </div>)}
@@ -113,24 +114,25 @@ const ChatFile = ({ message, isOperator, isHovered, time }) => {
113
114
  </button>
114
115
  </div>
115
116
  </div>)}
116
- <div className={`text-[12px] font-[400] text-[#C2C2C2]`}>{time}</div>
117
- </div>);
117
+ </TimeWrapper>);
118
118
  }
119
119
  else if (media.type === 'file') {
120
- return (<div className={` flex w-fit items-end gap-[4px]`}>
120
+ return (<TimeWrapper time={time} className={`w-fit`}>
121
121
  <div className="flex w-full flex-col gap-[10px] ">
122
122
  {media.files.map((file, index) => {
123
123
  const fileExtension = file.name.split('.').pop() || '';
124
124
  const baseName = file.name.replace(`.${fileExtension}`, '');
125
125
  const truncatedName = baseName.length > 12 ? `${baseName.slice(0, 12)}…` : baseName;
126
126
  const fileName = `${truncatedName}.${fileExtension}`;
127
- return (<div key={index} className={` group flex w-full items-end justify-start gap-[4px]`}>
127
+ return (<div key={index} className={` group flex w-full items-end justify-start gap-[4px]`}>
128
128
  <div key={index} className={`
129
129
  relative flex items-center justify-between
130
130
  gap-[16px] rounded-[10px] border-[1px] border-[#EDEDED] p-[12px]
131
131
  `}>
132
132
  <div className="flex flex-col gap-[4px] ">
133
- <span className={`text-[14px] font-[400] `}>{fileName}</span>
133
+ <span className={`dr_talk_body_medium2 line-clamp-1 text-drTalkBlack`}>
134
+ {fileName}
135
+ </span>
134
136
  <span className="flex items-center gap-[10px] text-[12px] text-[#777777]">
135
137
  {formatFileSize(file.size)} | {file.name.split('.').pop()}
136
138
  </span>
@@ -138,15 +140,14 @@ const ChatFile = ({ message, isOperator, isHovered, time }) => {
138
140
  <button onClick={(e) => __awaiter(void 0, void 0, void 0, function* () {
139
141
  e.stopPropagation();
140
142
  yield handleDownload(file);
141
- })} className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center rounded-full opacity-0 transition-opacity group-hover:opacity-100">
143
+ })} className="flex h-[24px] w-[24px] items-center justify-center rounded-full">
142
144
  <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full bg-white"/>
143
145
  </button>
144
146
  </div>
145
147
  </div>);
146
148
  })}
147
149
  </div>
148
- <div className={`text-[12px] font-[400] text-[#C2C2C2]`}>{time}</div>
149
- </div>);
150
+ </TimeWrapper>);
150
151
  }
151
152
  return null;
152
153
  };
@@ -5,6 +5,7 @@ import { formatFileSize } from '../_lib/utils';
5
5
  import FileDownLoadIcon from '../../../asset/images/daeryuntalk/viewer/gray-download.svg';
6
6
  import { useDaeryuntalk } from '../DaeryuntalkContext';
7
7
  import { getMessageFileDownloadUrl } from '../_api';
8
+ import TimeWrapper from './TimeWrapper';
8
9
  interface props {
9
10
  message: Message;
10
11
  isOperator: boolean;
@@ -48,7 +49,7 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
48
49
  : [];
49
50
 
50
51
  return (
51
- <div className={`flex flex-col gap-3`}>
52
+ <div className={`flex flex-col gap-[10px]`}>
52
53
  {images.length > 0 && renderMedia({ type: 'image', images })}
53
54
  {files.length > 0 && renderMedia({ type: 'file', files })}
54
55
  </div>
@@ -58,11 +59,11 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
58
59
  const renderMedia = (media: { type: 'image'; images: FileInfo[] } | { type: 'file'; files: FileInfo[] }) => {
59
60
  if (media.type === 'image') {
60
61
  return (
61
- <div className={`flex w-full items-end justify-start gap-[4px]`}>
62
+ <TimeWrapper time={time}>
62
63
  {media.images.length > 1 ? (
63
64
  <div className={`flex flex-col`}>
64
65
  {/* grid로 감싸진 짝수 개수 또는 홀수에서 마지막 전까지 */}
65
- <div className="group grid grid-cols-2 gap-2 rounded-[10px] border-[1px] border-[#EDEDED] p-[8px]">
66
+ <div className="group grid grid-cols-2 gap-[8px] rounded-[10px] border-[1px] border-drTalkGrayscale4 p-[8px]">
66
67
  {media.images.map((file, index) => {
67
68
  const isLastOdd =
68
69
  media.images.length % 2 === 1 && index === media.images.length - 1;
@@ -74,7 +75,7 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
74
75
  className="group/image relative aspect-square h-[100px] w-[113px] overflow-hidden rounded-[5px]"
75
76
  onClick={() => {
76
77
  if (media.type === 'image') {
77
- openImageViewer?.(media.images[media.images.length - 1], message);
78
+ openImageViewer?.(media.images[index], message);
78
79
  }
79
80
  }}
80
81
  >
@@ -93,7 +94,7 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
93
94
  }}
94
95
  className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center rounded-full opacity-0 transition-opacity group-hover/image:opacity-100"
95
96
  >
96
- <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full bg-white" />
97
+ <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full bg-drTalkWhite" />
97
98
  </button>
98
99
  </div>
99
100
  );
@@ -128,7 +129,7 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
128
129
  }}
129
130
  className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center rounded-full opacity-0 transition-opacity group-hover/image:opacity-100"
130
131
  >
131
- <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full text-[#777777] " />
132
+ <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full text-drTalkGrayscale2 " />
132
133
  </button>
133
134
  </div>
134
135
  </div>
@@ -167,12 +168,11 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
167
168
  </div>
168
169
  </div>
169
170
  )}
170
- <div className={`text-[12px] font-[400] text-[#C2C2C2]`}>{time}</div>
171
- </div>
171
+ </TimeWrapper>
172
172
  );
173
173
  } else if (media.type === 'file') {
174
174
  return (
175
- <div className={` flex w-fit items-end gap-[4px]`}>
175
+ <TimeWrapper time={time} className={`w-fit`}>
176
176
  <div className="flex w-full flex-col gap-[10px] ">
177
177
  {media.files.map((file, index) => {
178
178
  const fileExtension = file.name.split('.').pop() || '';
@@ -183,7 +183,7 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
183
183
  const fileName = `${truncatedName}.${fileExtension}`;
184
184
 
185
185
  return (
186
- <div key={index} className={` group flex w-full items-end justify-start gap-[4px]`}>
186
+ <div key={index} className={` group flex w-full items-end justify-start gap-[4px]`}>
187
187
  <div
188
188
  key={index}
189
189
  className={`
@@ -192,7 +192,9 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
192
192
  `}
193
193
  >
194
194
  <div className="flex flex-col gap-[4px] ">
195
- <span className={`text-[14px] font-[400] `}>{fileName}</span>
195
+ <span className={`dr_talk_body_medium2 line-clamp-1 text-drTalkBlack`}>
196
+ {fileName}
197
+ </span>
196
198
  <span className="flex items-center gap-[10px] text-[12px] text-[#777777]">
197
199
  {formatFileSize(file.size)} | {file.name.split('.').pop()}
198
200
  </span>
@@ -202,7 +204,7 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
202
204
  e.stopPropagation();
203
205
  await handleDownload(file);
204
206
  }}
205
- className="absolute bottom-[10px] right-[10px] z-10 flex h-[24px] w-[24px] items-center justify-center rounded-full opacity-0 transition-opacity group-hover:opacity-100"
207
+ className="flex h-[24px] w-[24px] items-center justify-center rounded-full"
206
208
  >
207
209
  <FileDownLoadIcon className="h-[24px] w-[24px] rounded-full bg-white" />
208
210
  </button>
@@ -211,8 +213,7 @@ const ChatFile = ({ message, isOperator, isHovered, time }: props) => {
211
213
  );
212
214
  })}
213
215
  </div>
214
- <div className={`text-[12px] font-[400] text-[#C2C2C2]`}>{time}</div>
215
- </div>
216
+ </TimeWrapper>
216
217
  );
217
218
  }
218
219
  return null;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const ChatLoading: () => React.JSX.Element;
3
+ export default ChatLoading;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ const ChatLoading = () => {
3
+ return (<div className="flex justify-start pl-8">
4
+ <div className="flex h-8 animate-pulse space-x-2 rounded-full ">
5
+ <div className="h-[8px] w-[8px] animate-bounce rounded-full bg-[#777777] "></div>
6
+ <div className="h-[8px] w-[8px] animate-bounce rounded-full bg-[#C2C2C2]" style={{ animationDelay: '0.2s' }}></div>
7
+ <div className="h-[8px] w-[8px] animate-bounce rounded-full bg-[#C2C2C2]" style={{ animationDelay: '0.4s' }}></div>
8
+ </div>
9
+ </div>);
10
+ };
11
+ export default ChatLoading;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+
3
+ const ChatLoading = () => {
4
+ return (
5
+ <div className="flex justify-start pl-8">
6
+ <div className="flex h-8 animate-pulse space-x-2 rounded-full ">
7
+ <div className="h-[8px] w-[8px] animate-bounce rounded-full bg-[#777777] "></div>
8
+ <div
9
+ className="h-[8px] w-[8px] animate-bounce rounded-full bg-[#C2C2C2]"
10
+ style={{ animationDelay: '0.2s' }}
11
+ ></div>
12
+ <div
13
+ className="h-[8px] w-[8px] animate-bounce rounded-full bg-[#C2C2C2]"
14
+ style={{ animationDelay: '0.4s' }}
15
+ ></div>
16
+ </div>
17
+ </div>
18
+ );
19
+ };
20
+
21
+ export default ChatLoading;
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  const ChatWrapper = ({ isOperator, children, className = '' }) => {
3
- const operatorClassName = 'border-[#EDEDED] text-black';
4
- const customerClassName = 'border-[#2E385B] text-[#2E385B] bg-[#F7F7F7]';
3
+ const operatorClassName = 'border-drTalkGrayscale4 text-drTalkBlack';
4
+ const customerClassName = 'border-drTalkBtnActive2 text-drTalkHover bg-drTalkGrayscale5';
5
5
  return (<div className={`
6
6
  ${isOperator ? operatorClassName : customerClassName} ${className}
7
- whitespace-pre-line rounded-[10px] border px-[12px]
8
- py-[16px] text-[14px] leading-[130%] tracking-[-4%]
7
+ dr_talk_body_medium2 whitespace-pre-line break-words rounded-[10px]
8
+ border px-[12px] py-[8px]
9
9
  `}>
10
10
  {children}
11
11
  </div>);