@daeryun/dr_components 1.1.15 → 1.1.17

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 (51) hide show
  1. package/dist/asset/images/daeryuntalk/active_checkbox_blue.png +0 -0
  2. package/dist/asset/images/daeryuntalk/non_active_checkbox.png +0 -0
  3. package/dist/components/Daeryuntalk/ChatConversation.d.ts +2 -0
  4. package/dist/components/Daeryuntalk/ChatConversation.jsx +13 -5
  5. package/dist/components/Daeryuntalk/ChatConversation.tsx +23 -5
  6. package/dist/components/Daeryuntalk/ChatHomeView.jsx +2 -3
  7. package/dist/components/Daeryuntalk/ChatHomeView.tsx +2 -1
  8. package/dist/components/Daeryuntalk/ChatInput.d.ts +2 -0
  9. package/dist/components/Daeryuntalk/ChatInput.jsx +7 -7
  10. package/dist/components/Daeryuntalk/ChatInput.tsx +30 -19
  11. package/dist/components/Daeryuntalk/ChatItem/AgeCheckBox.d.ts +6 -0
  12. package/dist/components/Daeryuntalk/ChatItem/AgeCheckBox.jsx +18 -0
  13. package/dist/components/Daeryuntalk/ChatItem/AgeCheckBox.tsx +26 -0
  14. package/dist/components/Daeryuntalk/ChatItem/ChatPrivacyAuth.jsx +7 -8
  15. package/dist/components/Daeryuntalk/ChatItem/ChatPrivacyAuth.tsx +7 -7
  16. package/dist/components/Daeryuntalk/DaeryuntalkContext.d.ts +4 -0
  17. package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +15 -6
  18. package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +20 -7
  19. package/dist/components/Daeryuntalk/NoticeMessage.jsx +14 -5
  20. package/dist/components/Daeryuntalk/NoticeMessage.tsx +15 -5
  21. package/dist/components/Daeryuntalk/Tiptap/DisabledInput.d.ts +6 -0
  22. package/dist/components/Daeryuntalk/Tiptap/DisabledInput.jsx +17 -0
  23. package/dist/components/Daeryuntalk/Tiptap/DisabledInput.tsx +28 -0
  24. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.d.ts +2 -0
  25. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.js +24 -0
  26. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.ts +32 -0
  27. package/dist/components/Daeryuntalk/_api/daeryuntalk/type/response.d.ts +2 -0
  28. package/dist/components/Daeryuntalk/_api/daeryuntalk/type/response.ts +5 -0
  29. package/dist/components/Daeryuntalk/_enums/ags_check_status.d.ts +5 -0
  30. package/dist/components/Daeryuntalk/_enums/ags_check_status.js +9 -0
  31. package/dist/components/Daeryuntalk/_enums/ags_check_status.ts +9 -0
  32. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.d.ts +4 -1
  33. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.js +49 -23
  34. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.ts +52 -14
  35. package/dist/components/Daeryuntalk/_hooks/talkprovider/useFullURL.jsx +4 -12
  36. package/dist/components/Daeryuntalk/_hooks/talkprovider/useFullURL.tsx +6 -13
  37. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +3 -1
  38. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +9 -5
  39. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +9 -1
  40. package/dist/components/Daeryuntalk/_hooks/talkprovider/useWorkFlow.ts +1 -1
  41. package/dist/components/Daeryuntalk/_ui/buttons/Button4.d.ts +10 -0
  42. package/dist/components/Daeryuntalk/_ui/buttons/Button4.jsx +12 -0
  43. package/dist/components/Daeryuntalk/_ui/buttons/Button4.tsx +29 -0
  44. package/dist/components/Daeryuntalk/_ui/checkboxs/CheckBox2.d.ts +8 -0
  45. package/dist/components/Daeryuntalk/_ui/checkboxs/CheckBox2.jsx +20 -0
  46. package/dist/components/Daeryuntalk/_ui/checkboxs/CheckBox2.tsx +47 -0
  47. package/dist/components/page/SuccessNew/components/SuccessCase.jsx +20 -23
  48. package/dist/components/page/SuccessNew/components/SuccessCase.tsx +1 -1
  49. package/dist/styles/globals.css +45 -0
  50. package/dist/tsconfig.tsbuildinfo +1 -1
  51. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ViewState } from './ChatHomeView';
3
3
  import { History } from './_api/daeryuntalk/type/response';
4
+ import { AgeCheckStatusEnums } from './_enums/ags_check_status';
4
5
  type ChatConversationProps = {
5
6
  onChatNew?: () => void;
6
7
  isActive: boolean;
@@ -12,6 +13,7 @@ type ChatConversationProps = {
12
13
  handleHistoryClick?: () => void;
13
14
  isAuthenticated: boolean;
14
15
  historyList: History[];
16
+ ageCheckStatus: AgeCheckStatusEnums | null;
15
17
  };
16
18
  declare const ChatConversation: React.FC<ChatConversationProps>;
17
19
  export default ChatConversation;
@@ -20,11 +20,14 @@ import ChatLoading from './ChatItem/ChatLoading';
20
20
  import { useWindowSize } from './_hooks/useWindowSize';
21
21
  import TypingComp from './ChatItem/TypingComp';
22
22
  import { useHoverScrollbar } from './_hooks/useHoverScrollbar';
23
+ import AgeCheckBox from './ChatItem/AgeCheckBox';
24
+ import { AgeCheckStatusEnums } from './_enums/ags_check_status';
23
25
  const ChatConversation = ({
24
26
  // onBackClick,
25
- onChatNew, isActive, isMobile, onClose, isHash, initialLoading, viewState, handleHistoryClick, isAuthenticated, historyList }) => {
27
+ onChatNew, isActive, isMobile, onClose, isHash, initialLoading, viewState, handleHistoryClick, isAuthenticated, historyList, ageCheckStatus }) => {
26
28
  var _a, _b;
27
- const { getNextMessageList, isNextPage, inquiryStatus, messages, isLoading, inquiryMainData, messageObject, workFlowBack, workFlowStack, chatInquiryNumber, isTyping } = useDaeryuntalk();
29
+ const { getNextMessageList, isNextPage, inquiryStatus, messages, isLoading, inquiryMainData, messageObject, workFlowBack, workFlowStack, chatInquiryNumber, isTyping, ageConfirm } = useDaeryuntalk();
30
+ const isNotAgeCheck = ageCheckStatus === AgeCheckStatusEnums.DISAGREED;
28
31
  const [isFetchingPrev, setIsFetchingPrev] = useState(false);
29
32
  const sortedMessages = useMemo(() => {
30
33
  return (messages === null || messages === void 0 ? void 0 : messages.length) ? messages.slice().sort((a, b) => a.timestamp - b.timestamp) : [];
@@ -34,6 +37,7 @@ onChatNew, isActive, isMobile, onClose, isHash, initialLoading, viewState, handl
34
37
  const pcBottomRef = useRef(null);
35
38
  const mobileBottomRef = useRef(null);
36
39
  const [bottomHeight, setBottomHeight] = useState(0);
40
+ const isClosed = inquiryStatus === InquiryStatusEnum.CLOSED;
37
41
  const windowSize = useWindowSize();
38
42
  // 최초 렌더 여부 플래그
39
43
  const isInitialMount = useRef(true);
@@ -203,6 +207,9 @@ onChatNew, isActive, isMobile, onClose, isHash, initialLoading, viewState, handl
203
207
  isHovered,
204
208
  scrollEnd
205
209
  ]);
210
+ const onAgree = () => {
211
+ ageConfirm(chatInquiryNumber || '', AgeCheckStatusEnums.AGREED);
212
+ };
206
213
  return (<>
207
214
  {/*isMoblie true일때 헤더 주의 내용이 상단에 있고 ,나머지 높이영역은 메시지 리스트로 붙게*/}
208
215
  <div className={` flex ${isMobile ? 'h-full' : 'h-[100vh]'} flex-col items-center justify-between xs:h-[calc(100vh-165px)] xs:max-h-[690px] lg:h-[calc(100vh-110px)] `}>
@@ -234,17 +241,18 @@ onChatNew, isActive, isMobile, onClose, isHash, initialLoading, viewState, handl
234
241
  {renderedMessages}
235
242
  {/* 타이핑 UI */}
236
243
  {isTyping && <TypingComp />}
237
- {inquiryStatus === InquiryStatusEnum.CLOSED && (<div className={` dr_talk_body_medium2 pb-[16px] text-center text-drTalkGrayscale1`}>
244
+ {isClosed && (<div className={` dr_talk_body_medium2 pb-[16px] text-center text-drTalkGrayscale1`}>
238
245
  문의가 종료되었습니다.
239
246
  </div>)}
240
247
  {isLoading && <ChatLoading />}
241
248
  <div ref={messagesEndRef}/>
242
249
  </div>)}
243
250
  </div>
251
+ {!isClosed && isNotAgeCheck && <AgeCheckBox onAgree={onAgree}/>}
244
252
 
245
253
  <div ref={pcBottomRef} className={`!z-[50] w-full`}>
246
254
  {/* 높이가 부모에 스크롤이 줄어도 해당 부분은 바텀에 고정 필요 */}
247
- {inquiryStatus === InquiryStatusEnum.CLOSED ? (<div className="w-full border-t border-drTalkGrayscale4 px-[20px] py-[16px]">
255
+ {isClosed ? (<div className="w-full border-t border-drTalkGrayscale4 px-[20px] py-[16px]">
248
256
  <div className="">
249
257
  <Button3 onClick={() => {
250
258
  onChatNew && onChatNew();
@@ -253,7 +261,7 @@ onChatNew, isActive, isMobile, onClose, isHash, initialLoading, viewState, handl
253
261
  </Button3>
254
262
  </div>
255
263
  </div>) : (<div className=" w-full border-t border-drTalkGrayscale4 px-[20px] py-[8px]">
256
- <ChatInput isMobile={isMobile}/>
264
+ <ChatInput isMobile={isMobile} isNotAgeCheck={isNotAgeCheck} chatInquiryNumber={chatInquiryNumber || ''}/>
257
265
  </div>)}
258
266
  </div>
259
267
  </div>
@@ -13,6 +13,8 @@ import TypingComp from './ChatItem/TypingComp';
13
13
  import { useHoverScrollbar } from './_hooks/useHoverScrollbar';
14
14
  import { ViewState } from './ChatHomeView';
15
15
  import { History } from './_api/daeryuntalk/type/response';
16
+ import AgeCheckBox from './ChatItem/AgeCheckBox';
17
+ import { AgeCheckStatusEnums } from './_enums/ags_check_status';
16
18
 
17
19
  type ChatConversationProps = {
18
20
  // onBackClick?: () => void;
@@ -26,6 +28,7 @@ type ChatConversationProps = {
26
28
  handleHistoryClick?: () => void;
27
29
  isAuthenticated: boolean;
28
30
  historyList: History[];
31
+ ageCheckStatus: AgeCheckStatusEnums | null;
29
32
  };
30
33
 
31
34
  const ChatConversation: React.FC<ChatConversationProps> = ({
@@ -39,7 +42,8 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
39
42
  viewState,
40
43
  handleHistoryClick,
41
44
  isAuthenticated,
42
- historyList
45
+ historyList,
46
+ ageCheckStatus
43
47
  }) => {
44
48
  const {
45
49
  getNextMessageList,
@@ -52,9 +56,12 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
52
56
  workFlowBack,
53
57
  workFlowStack,
54
58
  chatInquiryNumber,
55
- isTyping
59
+ isTyping,
60
+ ageConfirm
56
61
  } = useDaeryuntalk();
57
62
 
63
+ const isNotAgeCheck = ageCheckStatus === AgeCheckStatusEnums.DISAGREED;
64
+
58
65
  const [isFetchingPrev, setIsFetchingPrev] = useState(false);
59
66
 
60
67
  const sortedMessages = useMemo(() => {
@@ -68,6 +75,8 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
68
75
  const mobileBottomRef = useRef<HTMLDivElement | null>(null);
69
76
  const [bottomHeight, setBottomHeight] = useState(0);
70
77
 
78
+ const isClosed = inquiryStatus === InquiryStatusEnum.CLOSED;
79
+
71
80
  const windowSize = useWindowSize();
72
81
 
73
82
  // 최초 렌더 여부 플래그
@@ -279,6 +288,10 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
279
288
  scrollEnd
280
289
  ]);
281
290
 
291
+ const onAgree = () => {
292
+ ageConfirm(chatInquiryNumber || '', AgeCheckStatusEnums.AGREED);
293
+ };
294
+
282
295
  return (
283
296
  <>
284
297
  {/*isMoblie true일때 헤더 주의 내용이 상단에 있고 ,나머지 높이영역은 메시지 리스트로 붙게*/}
@@ -337,7 +350,7 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
337
350
  {renderedMessages}
338
351
  {/* 타이핑 UI */}
339
352
  {isTyping && <TypingComp />}
340
- {inquiryStatus === InquiryStatusEnum.CLOSED && (
353
+ {isClosed && (
341
354
  <div
342
355
  className={` dr_talk_body_medium2 pb-[16px] text-center text-drTalkGrayscale1`}
343
356
  >
@@ -349,10 +362,11 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
349
362
  </div>
350
363
  )}
351
364
  </div>
365
+ {!isClosed && isNotAgeCheck && <AgeCheckBox onAgree={onAgree} />}
352
366
 
353
367
  <div ref={pcBottomRef} className={`!z-[50] w-full`}>
354
368
  {/* 높이가 부모에 스크롤이 줄어도 해당 부분은 바텀에 고정 필요 */}
355
- {inquiryStatus === InquiryStatusEnum.CLOSED ? (
369
+ {isClosed ? (
356
370
  <div className="w-full border-t border-drTalkGrayscale4 px-[20px] py-[16px]">
357
371
  <div className="">
358
372
  <Button3
@@ -367,7 +381,11 @@ const ChatConversation: React.FC<ChatConversationProps> = ({
367
381
  </div>
368
382
  ) : (
369
383
  <div className=" w-full border-t border-drTalkGrayscale4 px-[20px] py-[8px]">
370
- <ChatInput isMobile={isMobile} />
384
+ <ChatInput
385
+ isMobile={isMobile}
386
+ isNotAgeCheck={isNotAgeCheck}
387
+ chatInquiryNumber={chatInquiryNumber || ''}
388
+ />
371
389
  </div>
372
390
  )}
373
391
  </div>
@@ -9,7 +9,7 @@ import FixedErrorBox from './FixedErrorBox';
9
9
  const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
10
10
  const [viewState, setViewState] = useState('conversation');
11
11
  // const [isLoading, setIsLoading] = useState<boolean>(false);
12
- const { isUserExpired, isConnected, isAuthenticated, historyList,
12
+ const { isUserExpired, isConnected, isAuthenticated, historyList, ageCheckStatus,
13
13
  // inquiryMainData,
14
14
  chatInquiryNumber,
15
15
  // startChat,
@@ -62,7 +62,6 @@ const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
62
62
  }
63
63
  if (isAuthenticated && viewState === 'conversation') {
64
64
  setIsTyping(false);
65
- goGetHistoryList({});
66
65
  }
67
66
  }, [viewState, isAuthenticated]);
68
67
  // useEffect(() => {
@@ -131,7 +130,7 @@ const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
131
130
  // if (viewState === 'conversation') {
132
131
  return renderWithNavigation(<ChatConversation
133
132
  // onBackClick={handleBackToHome}
134
- isActive={viewState === 'conversation'} initialLoading={initialLoading} onChatNew={handleNewStartChat} isMobile={isMobile} onClose={onClose} isHash={isHash} viewState={viewState} handleHistoryClick={handleHistoryClick} isAuthenticated={isAuthenticated !== null && isAuthenticated !== void 0 ? isAuthenticated : false} historyList={historyList !== null && historyList !== void 0 ? historyList : []}/>, 'conversation');
133
+ isActive={viewState === 'conversation'} initialLoading={initialLoading} onChatNew={handleNewStartChat} isMobile={isMobile} onClose={onClose} isHash={isHash} viewState={viewState} handleHistoryClick={handleHistoryClick} isAuthenticated={isAuthenticated !== null && isAuthenticated !== void 0 ? isAuthenticated : false} historyList={historyList !== null && historyList !== void 0 ? historyList : []} ageCheckStatus={ageCheckStatus}/>, 'conversation');
135
134
  // }
136
135
  // // 홈
137
136
  // return renderWithNavigation(
@@ -24,6 +24,7 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
24
24
  isConnected,
25
25
  isAuthenticated,
26
26
  historyList,
27
+ ageCheckStatus,
27
28
  // inquiryMainData,
28
29
  chatInquiryNumber,
29
30
  // startChat,
@@ -109,7 +110,6 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
109
110
  }
110
111
  if (isAuthenticated && viewState === 'conversation') {
111
112
  setIsTyping(false);
112
- goGetHistoryList({});
113
113
  }
114
114
  }, [viewState, isAuthenticated]);
115
115
 
@@ -224,6 +224,7 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
224
224
  handleHistoryClick={handleHistoryClick}
225
225
  isAuthenticated={isAuthenticated ?? false}
226
226
  historyList={historyList ?? []}
227
+ ageCheckStatus={ageCheckStatus}
227
228
  />,
228
229
  'conversation'
229
230
  );
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  interface props {
3
3
  isMobile: boolean;
4
+ isNotAgeCheck: boolean;
5
+ chatInquiryNumber: string;
4
6
  }
5
7
  declare const ChatInput: React.FC<props>;
6
8
  export default ChatInput;
@@ -2,9 +2,10 @@ import React, { useEffect, useRef, useState } from 'react';
2
2
  import { useDaeryuntalk } from './DaeryuntalkContext';
3
3
  import Tiptap from './Tiptap/Tiptap';
4
4
  import { stripHtmlTags } from './_lib/utils';
5
+ import DisabledInput from './Tiptap/DisabledInput';
5
6
  // 이미지
6
7
  import SendIcon from '../../asset/images/daeryuntalk/send.svg';
7
- const ChatInput = ({ isMobile }) => {
8
+ const ChatInput = ({ isMobile, isNotAgeCheck, chatInquiryNumber }) => {
8
9
  const [message, setMessage] = useState('');
9
10
  const { sendMessage, isLoading } = useDaeryuntalk();
10
11
  const tiptapRef = useRef(null);
@@ -34,20 +35,19 @@ const ChatInput = ({ isMobile }) => {
34
35
  }
35
36
  };
36
37
  return (<form onSubmit={handleSubmit} className="flex w-full items-center gap-2">
37
- <div className="flex flex-1 justify-center gap-[10px] rounded-[10px] border-[1px] border-solid border-drTalkGrayscale5 bg-drTalkGrayscale5 p-[4px]">
38
+ <div className={`${isNotAgeCheck ? 'bg-drTalkGrayscale4' : 'bg-drTalkGrayscale5'} flex flex-1 justify-center gap-[10px] rounded-[10px] border-[1px] border-solid border-drTalkGrayscale5 p-[4px]`}>
38
39
  {/* 최초 높이 44 */}
39
40
  {/*내용이 2줄 이상되면 입력창 높이도 키워져야합니다. 최대한 4줄까지만 보이도록 해주시고, 그 이상은 스크롤 될 수 있도록 해주시는 게 좋을 것 같습니다. max height 값을 72로 지정 부탁드립니다*/}
40
41
 
41
- <Tiptap ref={tiptapRef}
42
- // value={message}
43
- onChange={setMessage} onEnterKeyPress={handleEnter} placeholder="메시지를 입력해 주세요." contentClassName={`!outline-none !border-[0px] !pt-[4px] !pl-[4px]`} isMobile={isMobile}/>
42
+ {isNotAgeCheck ? (<DisabledInput placeholder="만 14세 이상 확인 후 이용 가능합니다."/>) : (<Tiptap key={`${chatInquiryNumber}-${isNotAgeCheck}`} ref={tiptapRef} onChange={setMessage} onEnterKeyPress={handleEnter} placeholder={'메시지를 입력해 주세요.'} contentClassName="!outline-none !border-[0px] !pt-[4px] !pl-[4px]" isMobile={isMobile}/>)}
44
43
 
45
44
  <div className={`flex flex-col justify-end`}>
46
- <button type="submit" className={`flex h-10 w-10 items-center justify-center rounded-[8px] bg-drTalkBtnActive2 text-white ${isLoading
45
+ <button type="submit" className={`flex h-10 w-10 items-center justify-center rounded-[8px] bg-drTalkBtnActive2 text-white
46
+ ${isLoading || isNotAgeCheck
47
47
  ? 'cursor-not-allowed opacity-50'
48
48
  : isEmpty
49
49
  ? ' bg-drTalkBtnActive2 '
50
- : ' bg-drTalkCrimson '}`} disabled={isLoading}>
50
+ : ' bg-drTalkCrimson '}`} disabled={isLoading || isNotAgeCheck}>
51
51
  <div className="flex h-9 w-9 items-center justify-center">
52
52
  <SendIcon width={24} height={24}/>
53
53
  </div>
@@ -2,15 +2,18 @@ import React, { useEffect, useRef, useState } from 'react';
2
2
  import { useDaeryuntalk } from './DaeryuntalkContext';
3
3
  import Tiptap, { TiptapEditorRef } from './Tiptap/Tiptap';
4
4
  import { stripHtmlTags } from './_lib/utils';
5
+ import DisabledInput from './Tiptap/DisabledInput';
5
6
 
6
7
  // 이미지
7
8
  import SendIcon from '../../asset/images/daeryuntalk/send.svg';
8
9
 
9
10
  interface props {
10
11
  isMobile: boolean;
12
+ isNotAgeCheck: boolean;
13
+ chatInquiryNumber: string;
11
14
  }
12
15
 
13
- const ChatInput: React.FC<props> = ({ isMobile }) => {
16
+ const ChatInput: React.FC<props> = ({ isMobile, isNotAgeCheck, chatInquiryNumber }) => {
14
17
  const [message, setMessage] = useState('');
15
18
  const { sendMessage, isLoading } = useDaeryuntalk();
16
19
  const tiptapRef = useRef<TiptapEditorRef | null>(null);
@@ -39,33 +42,41 @@ const ChatInput: React.FC<props> = ({ isMobile }) => {
39
42
  tiptapRef.current?.clearContent(); // 입력창 초기화
40
43
  }
41
44
  };
45
+
42
46
  return (
43
47
  <form onSubmit={handleSubmit} className="flex w-full items-center gap-2">
44
- <div className="flex flex-1 justify-center gap-[10px] rounded-[10px] border-[1px] border-solid border-drTalkGrayscale5 bg-drTalkGrayscale5 p-[4px]">
48
+ <div
49
+ className={`${isNotAgeCheck ? 'bg-drTalkGrayscale4' : 'bg-drTalkGrayscale5'} flex flex-1 justify-center gap-[10px] rounded-[10px] border-[1px] border-solid border-drTalkGrayscale5 p-[4px]`}
50
+ >
45
51
  {/* 최초 높이 44 */}
46
52
  {/*내용이 2줄 이상되면 입력창 높이도 키워져야합니다. 최대한 4줄까지만 보이도록 해주시고, 그 이상은 스크롤 될 수 있도록 해주시는 게 좋을 것 같습니다. max height 값을 72로 지정 부탁드립니다*/}
47
53
 
48
- <Tiptap
49
- ref={tiptapRef}
50
- // value={message}
51
- onChange={setMessage}
52
- onEnterKeyPress={handleEnter}
53
- placeholder="메시지를 입력해 주세요."
54
- contentClassName={`!outline-none !border-[0px] !pt-[4px] !pl-[4px]`}
55
- isMobile={isMobile}
56
- />
54
+ {isNotAgeCheck ? (
55
+ <DisabledInput placeholder="만 14세 이상 확인 후 이용 가능합니다." />
56
+ ) : (
57
+ <Tiptap
58
+ key={`${chatInquiryNumber}-${isNotAgeCheck}`}
59
+ ref={tiptapRef}
60
+ onChange={setMessage}
61
+ onEnterKeyPress={handleEnter}
62
+ placeholder={'메시지를 입력해 주세요.'}
63
+ contentClassName="!outline-none !border-[0px] !pt-[4px] !pl-[4px]"
64
+ isMobile={isMobile}
65
+ />
66
+ )}
57
67
 
58
68
  <div className={`flex flex-col justify-end`}>
59
69
  <button
60
70
  type="submit"
61
- className={`flex h-10 w-10 items-center justify-center rounded-[8px] bg-drTalkBtnActive2 text-white ${
62
- isLoading
63
- ? 'cursor-not-allowed opacity-50'
64
- : isEmpty
65
- ? ' bg-drTalkBtnActive2 '
66
- : ' bg-drTalkCrimson '
67
- }`}
68
- disabled={isLoading}
71
+ className={`flex h-10 w-10 items-center justify-center rounded-[8px] bg-drTalkBtnActive2 text-white
72
+ ${
73
+ isLoading || isNotAgeCheck
74
+ ? 'cursor-not-allowed opacity-50'
75
+ : isEmpty
76
+ ? ' bg-drTalkBtnActive2 '
77
+ : ' bg-drTalkCrimson '
78
+ }`}
79
+ disabled={isLoading || isNotAgeCheck}
69
80
  >
70
81
  <div className="flex h-9 w-9 items-center justify-center">
71
82
  <SendIcon width={24} height={24} />
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface AgeCheckBoxProps {
3
+ onAgree: () => void;
4
+ }
5
+ declare const AgeCheckBox: ({ onAgree }: AgeCheckBoxProps) => React.JSX.Element;
6
+ export default AgeCheckBox;
@@ -0,0 +1,18 @@
1
+ import React, { useState } from 'react';
2
+ import CheckBox2 from '../_ui/checkboxs/CheckBox2';
3
+ import Button4 from '../_ui/buttons/Button4';
4
+ const AgeCheckBox = ({ onAgree }) => {
5
+ const [checked, setChecked] = useState(false);
6
+ const onChange = (e) => {
7
+ setChecked(e.target.checked);
8
+ };
9
+ return (<div className={`z-10 h-[42px] w-full px-[20px] py-[8px]`}>
10
+ <div className={`flex items-center justify-between`}>
11
+ <CheckBox2 title={'(필수)만 14세 이상입니다.'} checked={checked} onChange={onChange}/>
12
+ <Button4 onClick={onAgree} isDisabled={!checked} className={`min-w-[18px]`}>
13
+ 동의
14
+ </Button4>
15
+ </div>
16
+ </div>);
17
+ };
18
+ export default AgeCheckBox;
@@ -0,0 +1,26 @@
1
+ import React, { useState } from 'react';
2
+ import CheckBox2 from '../_ui/checkboxs/CheckBox2';
3
+ import Button4 from '../_ui/buttons/Button4';
4
+
5
+ interface AgeCheckBoxProps {
6
+ onAgree: () => void;
7
+ }
8
+
9
+ const AgeCheckBox = ({ onAgree }: AgeCheckBoxProps) => {
10
+ const [checked, setChecked] = useState(false);
11
+ const onChange = (e: React.ChangeEvent<HTMLInputElement>) => {
12
+ setChecked(e.target.checked);
13
+ };
14
+ return (
15
+ <div className={`z-10 h-[42px] w-full px-[20px] py-[8px]`}>
16
+ <div className={`flex items-center justify-between`}>
17
+ <CheckBox2 title={'(필수)만 14세 이상입니다.'} checked={checked} onChange={onChange} />
18
+ <Button4 onClick={onAgree} isDisabled={!checked} className={`min-w-[18px]`}>
19
+ 동의
20
+ </Button4>
21
+ </div>
22
+ </div>
23
+ );
24
+ };
25
+
26
+ export default AgeCheckBox;
@@ -12,7 +12,6 @@ import ChatWrapper from './ChatWrapper';
12
12
  import Input1 from '../_ui/inputs/Input1';
13
13
  import { useDaeryuntalk } from '../DaeryuntalkContext';
14
14
  import Button1 from '../_ui/buttons/Button1';
15
- import CheckBox1 from '../_ui/checkboxs/CheckBox1';
16
15
  // 채팅문의 번호 인증
17
16
  const ChatPrivacyAuth = ({ message, isOperator }) => {
18
17
  var _a;
@@ -22,7 +21,7 @@ const ChatPrivacyAuth = ({ message, isOperator }) => {
22
21
  name: '',
23
22
  cell_phone_number: ''
24
23
  });
25
- const [isAgeCheck, setIsAgeCheck] = useState(false);
24
+ // const [isAgeCheck, setIsAgeCheck] = useState<boolean>(false);
26
25
  const [isModify, setIsModify] = useState(false);
27
26
  useEffect(() => {
28
27
  var _a, _b, _c, _d;
@@ -48,11 +47,11 @@ const ChatPrivacyAuth = ({ message, isOperator }) => {
48
47
  });
49
48
  setIsModify(false);
50
49
  });
51
- const ageCheck = (e) => {
52
- setIsAgeCheck(e.target.checked);
53
- };
50
+ // const ageCheck = (e: React.ChangeEvent<HTMLInputElement>) => {
51
+ // setIsAgeCheck(e.target.checked);
52
+ // };
54
53
  const goModify = () => {
55
- setIsAgeCheck(false);
54
+ // setIsAgeCheck(false);
56
55
  setIsModify(true);
57
56
  };
58
57
  if (!formData) {
@@ -66,8 +65,8 @@ const ChatPrivacyAuth = ({ message, isOperator }) => {
66
65
  <Input1 onChange={handleInput} value={(_b = authObject[(_a = item.bindingKey) !== null && _a !== void 0 ? _a : '']) !== null && _b !== void 0 ? _b : ''} type={item.type} name={item.bindingKey || ''} readOnly={isModify ? false : ((_c = item.readOnly) !== null && _c !== void 0 ? _c : false)}/>
67
66
  </div>);
68
67
  })}
69
- <CheckBox1 title={'(필수)만 14세 이상입니다.'} checked={isAgeCheck} onChange={ageCheck}/>
70
- <Button1 type="button" onClick={update} isDisabled={!isAgeCheck}>
68
+ {/* <CheckBox1 title={'(필수)만 14세 이상입니다.'} checked={isAgeCheck} onChange={ageCheck} /> */}
69
+ <Button1 type="button" onClick={update}>
71
70
  저장
72
71
  </Button1>
73
72
  </div>);
@@ -24,7 +24,7 @@ const ChatPrivacyAuth = ({ message, isOperator }: props) => {
24
24
  cell_phone_number: ''
25
25
  });
26
26
 
27
- const [isAgeCheck, setIsAgeCheck] = useState<boolean>(false);
27
+ // const [isAgeCheck, setIsAgeCheck] = useState<boolean>(false);
28
28
 
29
29
  const [isModify, setIsModify] = useState<boolean>(false);
30
30
 
@@ -57,12 +57,12 @@ const ChatPrivacyAuth = ({ message, isOperator }: props) => {
57
57
  setIsModify(false);
58
58
  };
59
59
 
60
- const ageCheck = (e: React.ChangeEvent<HTMLInputElement>) => {
61
- setIsAgeCheck(e.target.checked);
62
- };
60
+ // const ageCheck = (e: React.ChangeEvent<HTMLInputElement>) => {
61
+ // setIsAgeCheck(e.target.checked);
62
+ // };
63
63
 
64
64
  const goModify = () => {
65
- setIsAgeCheck(false);
65
+ // setIsAgeCheck(false);
66
66
  setIsModify(true);
67
67
  };
68
68
 
@@ -84,8 +84,8 @@ const ChatPrivacyAuth = ({ message, isOperator }: props) => {
84
84
  />
85
85
  </div>
86
86
  ))}
87
- <CheckBox1 title={'(필수)만 14세 이상입니다.'} checked={isAgeCheck} onChange={ageCheck} />
88
- <Button1 type="button" onClick={update} isDisabled={!isAgeCheck}>
87
+ {/* <CheckBox1 title={'(필수)만 14세 이상입니다.'} checked={isAgeCheck} onChange={ageCheck} /> */}
88
+ <Button1 type="button" onClick={update}>
89
89
  저장
90
90
  </Button1>
91
91
  </div>
@@ -3,6 +3,7 @@ import { FileInfo, Message } from './_types/message';
3
3
  import { ChatInquiryDetailDataResponse, History, IChatInquiryMainDataResponse } from './_api/daeryuntalk/type/response';
4
4
  import { MessageObject } from './_types/message_object';
5
5
  import { ViewState } from './ChatHomeView';
6
+ import { AgeCheckStatusEnums } from './_enums/ags_check_status';
6
7
  type DaeryuntalkContextType = {
7
8
  messages: Message[];
8
9
  inquiryStatus: string;
@@ -84,6 +85,9 @@ type DaeryuntalkContextType = {
84
85
  setIsUserExpried: (isUserExpired: boolean) => void;
85
86
  initialLoading: boolean | null;
86
87
  setInitialLoading: (initialLoading: boolean | null) => void;
88
+ ageCheckStatus: AgeCheckStatusEnums | null;
89
+ setAgeCheckStatus: (ageCheckStatus: AgeCheckStatusEnums | null) => void;
90
+ ageConfirm: (chatInquiryNumber: string, ageConsentStateCode: AgeCheckStatusEnums) => void;
87
91
  };
88
92
  declare const DaeryuntalkContext: React.Context<DaeryuntalkContextType>;
89
93
  type DaeryuntalkProviderProps = {
@@ -65,14 +65,18 @@ const DaeryuntalkContext = createContext({
65
65
  isUserExpired: false,
66
66
  setIsUserExpried: () => { },
67
67
  initialLoading: null,
68
- setInitialLoading: () => { }
68
+ setInitialLoading: () => { },
69
+ ageCheckStatus: null,
70
+ setAgeCheckStatus: () => { },
71
+ ageConfirm: () => { }
69
72
  });
70
73
  export const DaeryuntalkProvider = ({ children, propsTel, isMobile, onClose, centerCode }) => {
71
- const [inquiryStatus, setInquiryStatus] = useState('');
72
74
  // 인증 여부
73
75
  const [isAuthenticated, setIsAuthenticated] = useState(false);
74
76
  const [initialLoading, setInitialLoading] = useState(null);
75
77
  // 채팅 진행중에 필요한 state들
78
+ const [ageCheckStatus, setAgeCheckStatus] = useState(null);
79
+ const [inquiryStatus, setInquiryStatus] = useState('');
76
80
  const [messages, setMessages] = useState([]);
77
81
  const [messageObject, setMessageObject] = useState(null);
78
82
  const [workFlowStack, setWorkFlowStack] = useState([]);
@@ -114,11 +118,12 @@ export const DaeryuntalkProvider = ({ children, propsTel, isMobile, onClose, cen
114
118
  chatInquiryNumber,
115
119
  setIsNextPage,
116
120
  setInitialLoading,
117
- setChatInquiryNumber
121
+ setChatInquiryNumber,
122
+ setAgeCheckStatus
118
123
  });
119
124
  // MSG15591497825895676
120
125
  // 채팅 관련
121
- const { startChat, sendMessage, createNewChat, startWorkFlow, workFlowBack, chatUserUpdate, getNextMessageList, startSelectedChat, attendRoomByHistory } = useChatHandler({
126
+ const { startChat, sendMessage, createNewChat, startWorkFlow, workFlowBack, chatUserUpdate, getNextMessageList, startSelectedChat, attendRoomByHistory, ageConfirm } = useChatHandler({
122
127
  setIsLoading,
123
128
  inquiryMainData,
124
129
  setChatInquiryNumber,
@@ -129,7 +134,8 @@ export const DaeryuntalkProvider = ({ children, propsTel, isMobile, onClose, cen
129
134
  setIsNextPage,
130
135
  setWorkFlowStack,
131
136
  setInquiryMainData,
132
- centerCode
137
+ centerCode,
138
+ setAgeCheckStatus
133
139
  });
134
140
  // 이미지 뷰어용
135
141
  const { isImageViewerOpen, selectedImageFile, imageViewerMessage, openImageViewer, closeImageViewer } = useViewerHook();
@@ -187,7 +193,10 @@ export const DaeryuntalkProvider = ({ children, propsTel, isMobile, onClose, cen
187
193
  isUserExpired,
188
194
  setIsUserExpried,
189
195
  initialLoading,
190
- setInitialLoading
196
+ setInitialLoading,
197
+ ageCheckStatus,
198
+ setAgeCheckStatus,
199
+ ageConfirm
191
200
  }}>
192
201
  {children}
193
202
  </DaeryuntalkContext.Provider>);