@daeryun/dr_components 1.1.16 → 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 (50) 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/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  4. package/dist/components/Daeryuntalk/ChatConversation.d.ts +2 -0
  5. package/dist/components/Daeryuntalk/ChatConversation.jsx +13 -5
  6. package/dist/components/Daeryuntalk/ChatConversation.tsx +23 -5
  7. package/dist/components/Daeryuntalk/ChatHomeView.jsx +2 -3
  8. package/dist/components/Daeryuntalk/ChatHomeView.tsx +2 -1
  9. package/dist/components/Daeryuntalk/ChatInput.d.ts +2 -0
  10. package/dist/components/Daeryuntalk/ChatInput.jsx +7 -7
  11. package/dist/components/Daeryuntalk/ChatInput.tsx +30 -19
  12. package/dist/components/Daeryuntalk/ChatItem/AgeCheckBox.d.ts +6 -0
  13. package/dist/components/Daeryuntalk/ChatItem/AgeCheckBox.jsx +18 -0
  14. package/dist/components/Daeryuntalk/ChatItem/AgeCheckBox.tsx +26 -0
  15. package/dist/components/Daeryuntalk/ChatItem/ChatPrivacyAuth.jsx +7 -8
  16. package/dist/components/Daeryuntalk/ChatItem/ChatPrivacyAuth.tsx +7 -7
  17. package/dist/components/Daeryuntalk/DaeryuntalkContext.d.ts +4 -0
  18. package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +15 -6
  19. package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +20 -7
  20. package/dist/components/Daeryuntalk/NoticeMessage.jsx +14 -5
  21. package/dist/components/Daeryuntalk/NoticeMessage.tsx +15 -5
  22. package/dist/components/Daeryuntalk/Tiptap/DisabledInput.d.ts +6 -0
  23. package/dist/components/Daeryuntalk/Tiptap/DisabledInput.jsx +17 -0
  24. package/dist/components/Daeryuntalk/Tiptap/DisabledInput.tsx +28 -0
  25. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.d.ts +2 -0
  26. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.js +24 -0
  27. package/dist/components/Daeryuntalk/_api/daeryuntalk/index.ts +32 -0
  28. package/dist/components/Daeryuntalk/_api/daeryuntalk/type/response.d.ts +2 -0
  29. package/dist/components/Daeryuntalk/_api/daeryuntalk/type/response.ts +5 -0
  30. package/dist/components/Daeryuntalk/_enums/ags_check_status.d.ts +5 -0
  31. package/dist/components/Daeryuntalk/_enums/ags_check_status.js +9 -0
  32. package/dist/components/Daeryuntalk/_enums/ags_check_status.ts +9 -0
  33. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.d.ts +4 -1
  34. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.js +49 -23
  35. package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.ts +52 -14
  36. package/dist/components/Daeryuntalk/_hooks/talkprovider/useFullURL.jsx +4 -12
  37. package/dist/components/Daeryuntalk/_hooks/talkprovider/useFullURL.tsx +6 -13
  38. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +3 -1
  39. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +9 -5
  40. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +9 -1
  41. package/dist/components/Daeryuntalk/_hooks/talkprovider/useWorkFlow.ts +1 -1
  42. package/dist/components/Daeryuntalk/_ui/buttons/Button4.d.ts +10 -0
  43. package/dist/components/Daeryuntalk/_ui/buttons/Button4.jsx +12 -0
  44. package/dist/components/Daeryuntalk/_ui/buttons/Button4.tsx +29 -0
  45. package/dist/components/Daeryuntalk/_ui/checkboxs/CheckBox2.d.ts +8 -0
  46. package/dist/components/Daeryuntalk/_ui/checkboxs/CheckBox2.jsx +20 -0
  47. package/dist/components/Daeryuntalk/_ui/checkboxs/CheckBox2.tsx +47 -0
  48. package/dist/styles/globals.css +45 -0
  49. package/dist/tsconfig.tsbuildinfo +1 -1
  50. package/package.json +1 -1
@@ -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>);
@@ -7,6 +7,7 @@ import { useChatHandler } from './_hooks/talkprovider/useChatHandler';
7
7
  import { useViewerHook } from './_hooks/talkprovider/useViewerHook';
8
8
  import { useHistoryHandler } from './_hooks/talkprovider/useHistoryHandler';
9
9
  import { ViewState } from './ChatHomeView';
10
+ import { AgeCheckStatusEnums } from './_enums/ags_check_status';
10
11
 
11
12
  type DaeryuntalkContextType = {
12
13
  messages: Message[];
@@ -89,6 +90,9 @@ type DaeryuntalkContextType = {
89
90
  setIsUserExpried: (isUserExpired: boolean) => void;
90
91
  initialLoading: boolean | null;
91
92
  setInitialLoading: (initialLoading: boolean | null) => void;
93
+ ageCheckStatus: AgeCheckStatusEnums | null;
94
+ setAgeCheckStatus: (ageCheckStatus: AgeCheckStatusEnums | null) => void;
95
+ ageConfirm: (chatInquiryNumber: string, ageConsentStateCode: AgeCheckStatusEnums) => void;
92
96
  };
93
97
 
94
98
  // 기본값으로 컨텍스트 생성
@@ -144,7 +148,10 @@ const DaeryuntalkContext = createContext<DaeryuntalkContextType>({
144
148
  isUserExpired: false,
145
149
  setIsUserExpried: () => {},
146
150
  initialLoading: null,
147
- setInitialLoading: () => {}
151
+ setInitialLoading: () => {},
152
+ ageCheckStatus: null,
153
+ setAgeCheckStatus: () => {},
154
+ ageConfirm: () => {}
148
155
  });
149
156
 
150
157
  // 프로바이더 컴포넌트 생성
@@ -163,14 +170,14 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({
163
170
  onClose,
164
171
  centerCode
165
172
  }) => {
166
- const [inquiryStatus, setInquiryStatus] = useState<string>('');
167
-
168
173
  // 인증 여부
169
174
  const [isAuthenticated, setIsAuthenticated] = useState<boolean>(false);
170
175
 
171
176
  const [initialLoading, setInitialLoading] = useState<boolean | null>(null);
172
177
 
173
178
  // 채팅 진행중에 필요한 state들
179
+ const [ageCheckStatus, setAgeCheckStatus] = useState<AgeCheckStatusEnums | null>(null);
180
+ const [inquiryStatus, setInquiryStatus] = useState<string>('');
174
181
  const [messages, setMessages] = useState<Message[]>([]);
175
182
  const [messageObject, setMessageObject] = useState<MessageObject | null>(null);
176
183
  const [workFlowStack, setWorkFlowStack] = useState<string[]>([]);
@@ -229,7 +236,8 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({
229
236
  chatInquiryNumber,
230
237
  setIsNextPage,
231
238
  setInitialLoading,
232
- setChatInquiryNumber
239
+ setChatInquiryNumber,
240
+ setAgeCheckStatus
233
241
  });
234
242
 
235
243
  // MSG15591497825895676
@@ -244,7 +252,8 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({
244
252
  chatUserUpdate,
245
253
  getNextMessageList,
246
254
  startSelectedChat,
247
- attendRoomByHistory
255
+ attendRoomByHistory,
256
+ ageConfirm
248
257
  } = useChatHandler({
249
258
  setIsLoading,
250
259
  inquiryMainData,
@@ -256,7 +265,8 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({
256
265
  setIsNextPage,
257
266
  setWorkFlowStack,
258
267
  setInquiryMainData,
259
- centerCode
268
+ centerCode,
269
+ setAgeCheckStatus
260
270
  });
261
271
 
262
272
  // 이미지 뷰어용
@@ -320,7 +330,10 @@ export const DaeryuntalkProvider: React.FC<DaeryuntalkProviderProps> = ({
320
330
  isUserExpired,
321
331
  setIsUserExpried,
322
332
  initialLoading,
323
- setInitialLoading
333
+ setInitialLoading,
334
+ ageCheckStatus,
335
+ setAgeCheckStatus,
336
+ ageConfirm
324
337
  }}
325
338
  >
326
339
  {children}
@@ -1,18 +1,27 @@
1
- import React, { useState } from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
  // 이미지
3
3
  import NoticeIcon from '../../asset/images/daeryuntalk/notice.svg';
4
4
  import PrevIcon from '../../asset/images/daeryuntalk/prev.svg';
5
+ import { useScrollShadow } from './_hooks/useScrollShadow';
5
6
  const NoticeMessage = ({ content, isMobile }) => {
6
7
  const [isExpanded, setIsExpanded] = useState(false);
7
- return (<button type={'button'} onClick={() => setIsExpanded(!isExpanded)} className={`bg-[#F7F7F7]/90 px-[20px] pb-[12px] pt-[8px] backdrop-blur-[4px]`} aria-label={isExpanded ? '접기' : '펼치기'}>
8
- <div className="flex items-start gap-[8px]">
8
+ const { containerRef, isScroll, isBottom, checkScroll } = useScrollShadow();
9
+ // const { style: hoverStyle } = useHoverScrollbar(containerRef);
10
+ useEffect(() => {
11
+ checkScroll();
12
+ }, [isExpanded]);
13
+ return (<button type={'button'} onClick={() => setIsExpanded(!isExpanded)} className={`w-full bg-[#F7F7F7]/90 px-[20px] pb-[12px] pt-[8px] backdrop-blur-[4px]`} aria-label={isExpanded ? '접기' : '펼치기'}>
14
+ <div className="flex items-start justify-between gap-[8px]">
9
15
  <div className="flex-shrink-0">
10
16
  <NoticeIcon width={24} height={24}/>
11
17
  </div>
12
- <div className="">
13
- <div className={`dr_talk_body_medium2 overflow-hidden whitespace-pre-line break-words pt-[0.5px] text-left ${isExpanded ? '' : 'line-clamp-2'}`}>
18
+ <div className="relative">
19
+ <div ref={containerRef} className={`dr_talk_body_medium2 max-h-[108px] pt-[0.5px] text-left ${isExpanded ? 'overflow-y-auto whitespace-pre-line break-words' : 'line-clamp-2 overflow-hidden break-all'}`}>
14
20
  {content}
15
21
  </div>
22
+ {/* {isExpanded && isScroll && !isBottom && (
23
+ <ShadowBox className={`!h-[50px] !bg-gradient-to-t from-[#F7F7F7]/90 !to-[#F7F7F7]/0 `} />
24
+ )} */}
16
25
  </div>
17
26
  <div className="ml-1 flex-shrink-0 transform transition-transform duration-200">
18
27
  <div className={`transform transition-transform duration-200 ${isExpanded ? 'rotate-90' : '-rotate-90'}`}>
@@ -1,7 +1,8 @@
1
- import React, { useState } from 'react';
1
+ import React, { useEffect, useState } from 'react';
2
2
  // 이미지
3
3
  import NoticeIcon from '../../asset/images/daeryuntalk/notice.svg';
4
4
  import PrevIcon from '../../asset/images/daeryuntalk/prev.svg';
5
+ import { useScrollShadow } from './_hooks/useScrollShadow';
5
6
 
6
7
  type NoticeMessageProps = {
7
8
  content: string;
@@ -10,24 +11,33 @@ type NoticeMessageProps = {
10
11
 
11
12
  const NoticeMessage: React.FC<NoticeMessageProps> = ({ content, isMobile }) => {
12
13
  const [isExpanded, setIsExpanded] = useState(false);
14
+ const { containerRef, isScroll, isBottom, checkScroll } = useScrollShadow<HTMLDivElement>();
15
+ // const { style: hoverStyle } = useHoverScrollbar(containerRef);
16
+ useEffect(() => {
17
+ checkScroll();
18
+ }, [isExpanded]);
13
19
 
14
20
  return (
15
21
  <button
16
22
  type={'button'}
17
23
  onClick={() => setIsExpanded(!isExpanded)}
18
- className={`bg-[#F7F7F7]/90 px-[20px] pb-[12px] pt-[8px] backdrop-blur-[4px]`}
24
+ className={`w-full bg-[#F7F7F7]/90 px-[20px] pb-[12px] pt-[8px] backdrop-blur-[4px]`}
19
25
  aria-label={isExpanded ? '접기' : '펼치기'}
20
26
  >
21
- <div className="flex items-start gap-[8px]">
27
+ <div className="flex items-start justify-between gap-[8px]">
22
28
  <div className="flex-shrink-0">
23
29
  <NoticeIcon width={24} height={24} />
24
30
  </div>
25
- <div className="">
31
+ <div className="relative">
26
32
  <div
27
- className={`dr_talk_body_medium2 overflow-hidden whitespace-pre-line break-words pt-[0.5px] text-left ${isExpanded ? '' : 'line-clamp-2'}`}
33
+ ref={containerRef}
34
+ className={`dr_talk_body_medium2 max-h-[108px] pt-[0.5px] text-left ${isExpanded ? 'overflow-y-auto whitespace-pre-line break-words' : 'line-clamp-2 overflow-hidden break-all'}`}
28
35
  >
29
36
  {content}
30
37
  </div>
38
+ {/* {isExpanded && isScroll && !isBottom && (
39
+ <ShadowBox className={`!h-[50px] !bg-gradient-to-t from-[#F7F7F7]/90 !to-[#F7F7F7]/0 `} />
40
+ )} */}
31
41
  </div>
32
42
  <div className="ml-1 flex-shrink-0 transform transition-transform duration-200">
33
43
  <div
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface DisabledInputProps {
3
+ placeholder?: string;
4
+ }
5
+ declare const DisabledInput: React.FC<DisabledInputProps>;
6
+ export default DisabledInput;
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+ import React from 'react';
3
+ const DisabledInput = ({ placeholder = '만 14세 이상 확인 후 이용 가능합니다.' }) => {
4
+ return (<div className={`
5
+ dr_talk_body_medium2
6
+
7
+ mt-[1px]
8
+ h-[36px]
9
+
10
+ w-full
11
+ cursor-not-allowed rounded-[10px]
12
+ bg-drTalkGrayscale4 px-[6px] pb-[8px] pt-[10px] text-drTalkGrayscale2
13
+ `}>
14
+ {placeholder}
15
+ </div>);
16
+ };
17
+ export default DisabledInput;
@@ -0,0 +1,28 @@
1
+ 'use client';
2
+
3
+ import React from 'react';
4
+
5
+ interface DisabledInputProps {
6
+ placeholder?: string;
7
+ }
8
+
9
+ const DisabledInput: React.FC<DisabledInputProps> = ({ placeholder = '만 14세 이상 확인 후 이용 가능합니다.' }) => {
10
+ return (
11
+ <div
12
+ className={`
13
+ dr_talk_body_medium2
14
+
15
+ mt-[1px]
16
+ h-[36px]
17
+
18
+ w-full
19
+ cursor-not-allowed rounded-[10px]
20
+ bg-drTalkGrayscale4 px-[6px] pb-[8px] pt-[10px] text-drTalkGrayscale2
21
+ `}
22
+ >
23
+ {placeholder}
24
+ </div>
25
+ );
26
+ };
27
+
28
+ export default DisabledInput;
@@ -9,6 +9,7 @@
9
9
  */
10
10
  import { IDaeryunTalkResponseWrapper, WebSocketInitDataResponse, IChatInquiryMainDataResponse, ChatInquiryCreateDataResponse, ChatInquiryDetailDataResponse, SendMessageResponse, ChatInquiryMessageListDataResponse, HistoryListResponse, RequestConfirmNumberResponse } from './type/response';
11
11
  import { Dispatch, SetStateAction } from 'react';
12
+ import { AgeCheckStatusEnums } from '../../_enums/ags_check_status';
12
13
  export declare const DEFAULT_API_VERSION = "1.0.0";
13
14
  export declare const MESSAGE_TYPES: {
14
15
  SYSTEM: string;
@@ -125,6 +126,7 @@ export declare function sendChatMessage(chatInquiryNumber: string, htmlContent:
125
126
  * @returns 전송된 메시지 데이터
126
127
  */
127
128
  export declare function chatUserUpdate(chatInquiryNumber: string, messageNumber: string, name: string, cellPhoneNumber: string, version?: string): Promise<IDaeryunTalkResponseWrapper<any>>;
129
+ export declare function ageCheckUpdate(chatInquiryNumber: string, ageConsentStateCode: AgeCheckStatusEnums, version?: string): Promise<IDaeryunTalkResponseWrapper<any>>;
128
130
  /**
129
131
  * 채팅문의 메시지 파일 다운로드 URL 생성
130
132
  * @param chatInquiryNumber 채팅문의번호
@@ -33,6 +33,7 @@ const ENDPOINTS = {
33
33
  CHAT_MESSAGE_WORKFLOW_BACK: '/chatctm/chi/chatinquiryworkflowrollback', // 채팅 문의 워크플로우 되돌리기
34
34
  /* 유저 */
35
35
  USER_INFO_UPDATE: '/chatctm/chi/individualinformationupdate', //개인 정보 업데이트
36
+ AGE_CHECK_UPDATE: '/chatctm/chi/ageconsentupdate', // 연령 동의 업데이트
36
37
  /* 히스토리 */
37
38
  HISTORY_PHONE_REQUEST: '/chatctm/his/occupancycertificationnumbersend', // 점유 인증 번호 요청
38
39
  HISTORY_PHONE_AUTHENTICATION: '/chatctm/his/occupancycertificationnumberverification', // 점유 인증 번호 검증
@@ -627,6 +628,29 @@ export function chatUserUpdate(chatInquiryNumber, messageNumber, name, cellPhone
627
628
  }
628
629
  });
629
630
  }
631
+ export function ageCheckUpdate(chatInquiryNumber, ageConsentStateCode, version) {
632
+ return __awaiter(this, void 0, void 0, function* () {
633
+ const body = {
634
+ d: {
635
+ chat_inquiry_number: chatInquiryNumber,
636
+ age_consent_state_code: ageConsentStateCode // AGE00100001(미동의), AGE00100002(동의)
637
+ }
638
+ };
639
+ consoleFn('[채팅 연령 동의 업데이트] 시작');
640
+ try {
641
+ const response = yield fetchWithCookies(`${API_BASE_URL}${ENDPOINTS.AGE_CHECK_UPDATE}`, {
642
+ method: 'POST',
643
+ body: JSON.stringify(body)
644
+ }, version);
645
+ consoleFn('[채팅 연령 동의 업데이트 성공]', response);
646
+ return response;
647
+ }
648
+ catch (error) {
649
+ console.error('[채팅 연령 동의 업데이트 실패]', error);
650
+ throw error;
651
+ }
652
+ });
653
+ }
630
654
  /**
631
655
  * 채팅문의 메시지 파일 다운로드 URL 생성
632
656
  * @param chatInquiryNumber 채팅문의번호