@daeryun/dr_components 1.1.9 → 1.1.11

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 (104) hide show
  1. package/dist/asset/images/daeryuntalk/history-icon.png +0 -0
  2. package/dist/asset/images/daeryuntalk/history-new-badge.png +0 -0
  3. package/dist/asset/images/map/close.webp +0 -0
  4. package/dist/asset/images/map/expand.webp +0 -0
  5. package/dist/asset/images/map/map.webp +0 -0
  6. package/dist/asset/images/map/officeBtn/arrow.svg +6 -0
  7. package/dist/asset/images/map/officeBtn/home_icon.svg +10 -0
  8. package/dist/asset/images/map/share.webp +0 -0
  9. package/dist/asset/images/map/youtube.webp +0 -0
  10. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  11. package/dist/components/Daeryuntalk/ChatButton.jsx +2 -1
  12. package/dist/components/Daeryuntalk/ChatButton.tsx +2 -1
  13. package/dist/components/Daeryuntalk/ChatConversation.d.ts +7 -1
  14. package/dist/components/Daeryuntalk/ChatConversation.jsx +10 -8
  15. package/dist/components/Daeryuntalk/ChatConversation.tsx +25 -12
  16. package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.d.ts +7 -2
  17. package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.jsx +29 -9
  18. package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.tsx +53 -15
  19. package/dist/components/Daeryuntalk/ChatHomeView.d.ts +1 -1
  20. package/dist/components/Daeryuntalk/ChatHomeView.jsx +68 -46
  21. package/dist/components/Daeryuntalk/ChatHomeView.tsx +68 -66
  22. package/dist/components/Daeryuntalk/ChatInput.jsx +2 -1
  23. package/dist/components/Daeryuntalk/ChatInput.tsx +3 -1
  24. package/dist/components/Daeryuntalk/ChatItem/ChatFile.jsx +2 -1
  25. package/dist/components/Daeryuntalk/ChatItem/ChatFile.tsx +2 -1
  26. package/dist/components/Daeryuntalk/ChatItem/ChatLoading.d.ts +4 -1
  27. package/dist/components/Daeryuntalk/ChatItem/ChatLoading.jsx +2 -2
  28. package/dist/components/Daeryuntalk/ChatItem/ChatLoading.tsx +5 -2
  29. package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.tsx +0 -1
  30. package/dist/components/Daeryuntalk/ChatItem/RichText.tsx +0 -1
  31. package/dist/components/Daeryuntalk/ChatItem/TypingComp.jsx +2 -1
  32. package/dist/components/Daeryuntalk/ChatItem/TypingComp.tsx +2 -1
  33. package/dist/components/Daeryuntalk/ChatItem/WorkFlowAuthForm.tsx +0 -1
  34. package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.tsx +0 -1
  35. package/dist/components/Daeryuntalk/ChatMessage.jsx +3 -2
  36. package/dist/components/Daeryuntalk/ChatMessage.tsx +3 -2
  37. package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.jsx +1 -0
  38. package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.tsx +1 -0
  39. package/dist/components/Daeryuntalk/ChatObject/ObjectBack.jsx +1 -0
  40. package/dist/components/Daeryuntalk/ChatObject/ObjectBack.tsx +1 -1
  41. package/dist/components/Daeryuntalk/ChatWidget.jsx +1 -1
  42. package/dist/components/Daeryuntalk/ChatWidget.tsx +1 -1
  43. package/dist/components/Daeryuntalk/DaeryuntalkContext.d.ts +2 -0
  44. package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +12 -5
  45. package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +41 -31
  46. package/dist/components/Daeryuntalk/HistoryView.jsx +12 -9
  47. package/dist/components/Daeryuntalk/HistoryView.tsx +12 -9
  48. package/dist/components/Daeryuntalk/HomeView.jsx +7 -6
  49. package/dist/components/Daeryuntalk/HomeView.tsx +8 -6
  50. package/dist/components/Daeryuntalk/NavigationFooter.d.ts +1 -1
  51. package/dist/components/Daeryuntalk/NavigationFooter.jsx +1 -0
  52. package/dist/components/Daeryuntalk/NavigationFooter.tsx +3 -1
  53. package/dist/components/Daeryuntalk/NoticeMessage.jsx +1 -0
  54. package/dist/components/Daeryuntalk/NoticeMessage.tsx +1 -0
  55. package/dist/components/Daeryuntalk/Tiptap/Tiptap.tsx +1 -0
  56. package/dist/components/Daeryuntalk/Toast/Toast.jsx +1 -1
  57. package/dist/components/Daeryuntalk/Toast/Toast.tsx +2 -2
  58. package/dist/components/Daeryuntalk/Viewer/MobileViewer.jsx +4 -3
  59. package/dist/components/Daeryuntalk/Viewer/MobileViewer.tsx +4 -5
  60. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.jsx +5 -4
  61. package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +7 -5
  62. package/dist/components/Daeryuntalk/ViewportHandler.d.ts +6 -1
  63. package/dist/components/Daeryuntalk/ViewportHandler.jsx +21 -6
  64. package/dist/components/Daeryuntalk/ViewportHandler.tsx +26 -44
  65. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +4 -2
  66. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +77 -16
  67. package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +100 -17
  68. package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.d.ts +3 -4
  69. package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.js +15 -11
  70. package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.ts +15 -13
  71. package/dist/components/Daeryuntalk/_hooks/view/useHomeView.d.ts +0 -1
  72. package/dist/components/Daeryuntalk/_hooks/view/useHomeView.js +8 -6
  73. package/dist/components/Daeryuntalk/_hooks/view/useHomeView.ts +8 -7
  74. package/dist/components/Daeryuntalk/index.jsx +2 -11
  75. package/dist/components/Daeryuntalk/index.tsx +2 -12
  76. package/dist/components/common/integrate/index.d.ts +1 -1
  77. package/dist/components/common/types/map/index.d.ts +33 -0
  78. package/dist/components/common/types/map/index.js +1 -0
  79. package/dist/components/common/types/map/index.ts +34 -0
  80. package/dist/components/page/Login/LoginShareCheckContainer.jsx +6 -4
  81. package/dist/components/page/Login/LoginShareCheckContainer.tsx +6 -4
  82. package/dist/components/page/Login/_hooks/useAppLoginDetect.js +9 -7
  83. package/dist/components/page/Login/_hooks/useAppLoginDetect.ts +11 -8
  84. package/dist/components/page/MapPage/MapModal.d.ts +10 -0
  85. package/dist/components/page/MapPage/MapModal.jsx +48 -0
  86. package/dist/components/page/MapPage/MapModal.tsx +76 -0
  87. package/dist/components/page/MapPage/MapPage.d.ts +6 -0
  88. package/dist/components/page/MapPage/MapPage.jsx +147 -0
  89. package/dist/components/page/MapPage/MapPage.stories.d.ts +7 -0
  90. package/dist/components/page/MapPage/MapPage.stories.jsx +83 -0
  91. package/dist/components/page/MapPage/MapPage.stories.tsx +98 -0
  92. package/dist/components/page/MapPage/MapPage.tsx +197 -0
  93. package/dist/components/page/MapPage/MobileMapKeyDetail.d.ts +11 -0
  94. package/dist/components/page/MapPage/MobileMapKeyDetail.jsx +99 -0
  95. package/dist/components/page/MapPage/MobileMapKeyDetail.tsx +177 -0
  96. package/dist/components/page/MapPage/PcMapKeyDetail.d.ts +11 -0
  97. package/dist/components/page/MapPage/PcMapKeyDetail.jsx +99 -0
  98. package/dist/components/page/MapPage/PcMapKeyDetail.tsx +178 -0
  99. package/dist/components/page/index.d.ts +1 -0
  100. package/dist/components/page/index.js +1 -0
  101. package/dist/components/page/index.ts +1 -0
  102. package/dist/styles/globals.css +721 -375
  103. package/dist/tsconfig.tsbuildinfo +1 -1
  104. package/package.json +1 -1
@@ -1,25 +1,45 @@
1
1
  import React from 'react';
2
- import PrevIcon from '../../../asset/images/daeryuntalk/prev.svg';
3
2
  import Image from 'next/image';
3
+ // 이미지
4
+ import HistoryNewbadge from '../../../asset/images/daeryuntalk/history-new-badge.png';
4
5
  import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
6
+ import PrevIcon from '../../../asset/images/daeryuntalk/prev.svg';
5
7
  import CloseSvgIcon from '../../../asset/images/daeryuntalk/close.svg';
6
- const ChatConversationHeader = ({ inquiryMainData, isMobile, onClose, isHash, onBackClick }) => {
7
- const channelName = (inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_name) || '법무법인(유한)대륜';
8
+ import HistoryIcon from '../../../asset/images/daeryuntalk/history-icon.png';
9
+ const ChatConversationHeader = ({ inquiryMainData, isMobile, onClose, isHash,
10
+ // onBackClick,
11
+ viewState, onHistoryClick, isAuthenticated, historyList }) => {
12
+ const channelName = (inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_name) || '';
8
13
  const logoImageUrl = (inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_logo_image_url) || '';
14
+ const unreadCount = historyList.length > 0 ? historyList.reduce((sum, item) => sum + (item.unread_message_count || 0), 0) : 0;
15
+ const isNewBadge = isAuthenticated && unreadCount > 0;
9
16
  const handleBackClick = () => {
10
- if (onBackClick) {
11
- onBackClick();
17
+ // if (onBackClick) {
18
+ // onBackClick();
19
+ // }
20
+ };
21
+ const handleHistoryClick = () => {
22
+ if (onHistoryClick) {
23
+ onHistoryClick();
12
24
  }
13
25
  };
14
26
  return (<div className={`${isMobile ? '' : ''} flex h-[56px] w-full items-center justify-between border-b border-gray-200 px-[16px] `}>
15
- <button className="flex h-[28px] w-[28px] items-center justify-center" aria-label="이전" onClick={handleBackClick}>
16
- <PrevIcon width={28} height={28}/>
17
- </button>
27
+ {viewState === 'conversation' ? (<button type="button" className={`relative flex flex-col items-center justify-center`} onClick={handleHistoryClick}>
28
+ <Image src={HistoryIcon} alt="히스토리" width={20} height={20}/>
29
+ <span className="h-[10px] text-[10px] font-[700] leading-[100%] tracking-[-0.04%]">히스토리</span>
30
+ <div className={`${isNewBadge ? 'opacity-100' : 'opacity-0'} absolute -right-[4px] -top-[1px]`}>
31
+ <Image src={HistoryNewbadge} alt="뉴 히스토리 뱃지" width={12} height={12}/>
32
+ </div>
33
+ </button>) : (<button className={`flex h-[28px] w-[28px] items-center justify-center `} aria-label="이전" onClick={handleBackClick}>
34
+ <PrevIcon width={28} height={28}/>
35
+ </button>)}
18
36
  <div className="flex items-center gap-[10px] ">
19
37
  {logoImageUrl ? (<Image src={logoImageUrl} alt="로고" width={28} height={28} className=""/>) : (<DaeryunLogoIcon width={28} height={28}/>)}
20
38
  <h2 className={`dr_talk_title_small text-drTalkBlack`}>{channelName}</h2>
21
39
  </div>
22
- <div className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : ' xs:pointer-events-none xs:!opacity-0 '} py-[14px] text-drTalkGrayscale2 hover:cursor-pointer`} onClick={onClose}>
40
+ <div
41
+ // className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : ' xs:pointer-events-none xs:!opacity-0 '} py-[14px] text-drTalkGrayscale2 hover:cursor-pointer`}
42
+ className={`py-[14px] text-black hover:cursor-pointer`} onClick={onClose}>
23
43
  <CloseSvgIcon width={28} height={28}/>
24
44
  </div>
25
45
  </div>);
@@ -1,16 +1,26 @@
1
1
  import React from 'react';
2
- import PrevIcon from '../../../asset/images/daeryuntalk/prev.svg';
3
2
  import Image from 'next/image';
3
+ import { IChatInquiryMainDataResponse } from '../_api/daeryuntalk/type/response';
4
+ import { ViewState } from '../ChatHomeView';
5
+ import { History } from '../_api/daeryuntalk/type/response';
6
+
7
+ // 이미지
8
+ import HistoryNewbadge from '../../../asset/images/daeryuntalk/history-new-badge.png';
4
9
  import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
10
+ import PrevIcon from '../../../asset/images/daeryuntalk/prev.svg';
5
11
  import CloseSvgIcon from '../../../asset/images/daeryuntalk/close.svg';
6
- import { IChatInquiryMainDataResponse } from '../_api/daeryuntalk/type/response';
12
+ import HistoryIcon from '../../../asset/images/daeryuntalk/history-icon.png';
7
13
 
8
14
  interface IChatConversationHeaderProps {
9
15
  inquiryMainData: IChatInquiryMainDataResponse | null;
10
16
  isMobile: boolean;
11
17
  onClose: () => void;
12
18
  isHash: boolean;
13
- onBackClick?: () => void;
19
+ // onBackClick?: () => void;
20
+ onHistoryClick?: () => void;
21
+ viewState: ViewState;
22
+ isAuthenticated: boolean;
23
+ historyList: History[];
14
24
  }
15
25
 
16
26
  const ChatConversationHeader = ({
@@ -18,27 +28,54 @@ const ChatConversationHeader = ({
18
28
  isMobile,
19
29
  onClose,
20
30
  isHash,
21
- onBackClick
31
+ // onBackClick,
32
+ viewState,
33
+ onHistoryClick,
34
+ isAuthenticated,
35
+ historyList
22
36
  }: IChatConversationHeaderProps) => {
23
- const channelName = inquiryMainData?.channel_name || '법무법인(유한)대륜';
37
+ const channelName = inquiryMainData?.channel_name || '';
24
38
  const logoImageUrl = inquiryMainData?.channel_logo_image_url || '';
39
+ const unreadCount =
40
+ historyList.length > 0 ? historyList.reduce((sum, item) => sum + (item.unread_message_count || 0), 0) : 0;
41
+ const isNewBadge = isAuthenticated && unreadCount > 0;
25
42
 
26
43
  const handleBackClick = () => {
27
- if (onBackClick) {
28
- onBackClick();
44
+ // if (onBackClick) {
45
+ // onBackClick();
46
+ // }
47
+ };
48
+
49
+ const handleHistoryClick = () => {
50
+ if (onHistoryClick) {
51
+ onHistoryClick();
29
52
  }
30
53
  };
31
54
  return (
32
55
  <div
33
56
  className={`${isMobile ? '' : ''} flex h-[56px] w-full items-center justify-between border-b border-gray-200 px-[16px] `}
34
57
  >
35
- <button
36
- className="flex h-[28px] w-[28px] items-center justify-center"
37
- aria-label="이전"
38
- onClick={handleBackClick}
39
- >
40
- <PrevIcon width={28} height={28} />
41
- </button>
58
+ {viewState === 'conversation' ? (
59
+ <button
60
+ type="button"
61
+ className={`relative flex flex-col items-center justify-center`}
62
+ onClick={handleHistoryClick}
63
+ >
64
+ <Image src={HistoryIcon} alt="히스토리" width={20} height={20} />
65
+ <span className="h-[10px] text-[10px] font-[700] leading-[100%] tracking-[-0.04%]">히스토리</span>
66
+ <div className={`${isNewBadge ? 'opacity-100' : 'opacity-0'} absolute -right-[4px] -top-[1px]`}>
67
+ <Image src={HistoryNewbadge} alt="뉴 히스토리 뱃지" width={12} height={12} />
68
+ </div>
69
+ </button>
70
+ ) : (
71
+ <button
72
+ className={`flex h-[28px] w-[28px] items-center justify-center `}
73
+ aria-label="이전"
74
+ onClick={handleBackClick}
75
+ >
76
+ <PrevIcon width={28} height={28} />
77
+ </button>
78
+ )}
42
79
  <div className="flex items-center gap-[10px] ">
43
80
  {logoImageUrl ? (
44
81
  <Image src={logoImageUrl} alt="로고" width={28} height={28} className="" />
@@ -48,7 +85,8 @@ const ChatConversationHeader = ({
48
85
  <h2 className={`dr_talk_title_small text-drTalkBlack`}>{channelName}</h2>
49
86
  </div>
50
87
  <div
51
- className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : ' xs:pointer-events-none xs:!opacity-0 '} py-[14px] text-drTalkGrayscale2 hover:cursor-pointer`}
88
+ // className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : ' xs:pointer-events-none xs:!opacity-0 '} py-[14px] text-drTalkGrayscale2 hover:cursor-pointer`}
89
+ className={`py-[14px] text-black hover:cursor-pointer`}
52
90
  onClick={onClose}
53
91
  >
54
92
  <CloseSvgIcon width={28} height={28} />
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- export type ViewState = 'home' | 'conversation' | 'history';
2
+ export type ViewState = 'conversation' | 'history';
3
3
  type ChatHomeViewProps = {
4
4
  hashValue: string | null;
5
5
  isMobile: boolean;
@@ -2,54 +2,59 @@ import React, { useEffect, useState } from 'react';
2
2
  import { useDaeryuntalk } from './DaeryuntalkContext';
3
3
  import ChatConversation from './ChatConversation';
4
4
  import HistoryView from './HistoryView';
5
- import NavigationFooter from './NavigationFooter';
6
5
  import { useChatSocketState } from './_hooks/view/useChatSocketState';
7
6
  import ToastRenderer from './Toast/ToastRender';
8
- import HomeView from './HomeView';
9
7
  import { useHistoryView } from './_hooks/view/useHistoryView';
10
- import { useHomeView } from './_hooks/view/useHomeView';
11
8
  import FixedErrorBox from './FixedErrorBox';
12
9
  const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
13
- const [viewState, setViewState] = useState(isHash ? 'conversation' : 'home');
14
- const [isLoading, setIsLoading] = useState(false);
15
- const { isUserExpired, isConnected, isAuthenticated, historyList, inquiryMainData, chatInquiryNumber, startChat, retryInitData, setIsTyping, setPreviewState, preViewState } = useDaeryuntalk();
10
+ const [viewState, setViewState] = useState('conversation');
11
+ // const [isLoading, setIsLoading] = useState<boolean>(false);
12
+ const { isUserExpired, isConnected, isAuthenticated, historyList,
13
+ // inquiryMainData,
14
+ chatInquiryNumber,
15
+ // startChat,
16
+ // retryInitData,
17
+ setIsTyping,
18
+ // setPreviewState,
19
+ // preViewState,
20
+ initialLoading } = useDaeryuntalk();
16
21
  // 소켓 이벤트
17
22
  const { sendInquiryJoined, sendHeartbeat, sendInquiryWatching, sendInquiryLeft, sendHistoryEntered } = useDaeryuntalk();
18
23
  // 홈
19
- const { retryInquiryMain } = useDaeryuntalk();
24
+ // const { retryInquiryMain } = useDaeryuntalk();
20
25
  // 히스토리
21
26
  const { startSelectedChat, attendRoomByHistory, createNewChat, goRequestPhone, goGetHistoryList, goHistoryPhoneAuth } = useDaeryuntalk();
22
27
  // 소켓 클라 -> 서버 관리
23
28
  useChatSocketState(chatInquiryNumber, viewState, sendInquiryWatching, sendInquiryJoined, sendHeartbeat, sendInquiryLeft, isConnected, isAuthenticated, sendHistoryEntered, historyList);
24
29
  // 홈 뷰 훅스
25
- const { handleStartChat, handleHashStartChat, handleBackToHome } = useHomeView({
26
- setIsLoading,
27
- setViewState,
28
- retryInquiryMain,
29
- inquiryMainData: inquiryMainData !== null && inquiryMainData !== void 0 ? inquiryMainData : null,
30
- startChat,
31
- preViewState,
32
- viewState,
33
- setPreviewState
34
- });
30
+ // const { handleStartChat, handleHashStartChat } = useHomeView({
31
+ // setIsLoading,
32
+ // setViewState,
33
+ // retryInquiryMain,
34
+ // inquiryMainData: inquiryMainData ?? null,
35
+ // startChat,
36
+ // preViewState,
37
+ // viewState,
38
+ // setPreviewState
39
+ // });
35
40
  // 히스토리 뷰 hooks
36
- const { handleChatHistoryClick, handleNewStartChat, handleHistoryClick, handleGoRequestPhone, handleGoHistoryPhoneAuth, handleHomeClick } = useHistoryView({
41
+ const { handleChatHistoryClick, handleNewStartChat, handleHistoryClick, handleGoRequestPhone, handleGoHistoryPhoneAuth, handleBackClick } = useHistoryView({
37
42
  attendRoomByHistory,
38
43
  startSelectedChat,
39
44
  setViewState,
40
- setIsLoading,
45
+ // setIsLoading,
41
46
  createNewChat,
42
47
  goRequestPhone,
43
48
  goHistoryPhoneAuth,
44
- setPreviewState
49
+ chatInquiryNumber
50
+ // setPreviewState
45
51
  });
46
- useEffect(() => {
47
- if (hashValue && isConnected && inquiryMainData && inquiryMainData.channel_number) {
48
- handleHashStartChat();
49
- }
50
- else {
51
- }
52
- }, [hashValue, isConnected, inquiryMainData]);
52
+ // useEffect(() => {
53
+ // if (hashValue && isConnected && inquiryMainData && inquiryMainData.channel_number) {
54
+ // handleHashStartChat();
55
+ // } else {
56
+ // }
57
+ // }, [hashValue, isConnected, inquiryMainData]);
53
58
  // viewState 진입
54
59
  useEffect(() => {
55
60
  if (isAuthenticated && viewState === 'history') {
@@ -60,13 +65,13 @@ const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
60
65
  goGetHistoryList({});
61
66
  }
62
67
  }, [viewState, isAuthenticated]);
63
- useEffect(() => {
64
- if (inquiryMainData !== null) {
65
- if (!(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_number)) {
66
- retryInitData();
67
- }
68
- }
69
- }, [inquiryMainData, inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_number]);
68
+ // useEffect(() => {
69
+ // if (inquiryMainData !== null) {
70
+ // if (!inquiryMainData?.channel_number) {
71
+ // retryInitData();
72
+ // }
73
+ // }
74
+ // }, [inquiryMainData, inquiryMainData?.channel_number]);
70
75
  const renderWithNavigation = (content, activeView) => {
71
76
  return (
72
77
  //
@@ -91,7 +96,6 @@ const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
91
96
  w-screen rounded-[0px]
92
97
  xs:w-[390px] xs:rounded-[30px]
93
98
  `}
94
-
95
99
  `}
96
100
 
97
101
  `}>
@@ -101,10 +105,16 @@ const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
101
105
  `}>
102
106
  {content}
103
107
  </div>
104
- <div className={`!z-[50]`}>
105
- {/* 얘는 아래 64px로 고정 */}
106
- <NavigationFooter activeView={activeView} onHomeClick={handleHomeClick} onHistoryClick={handleHistoryClick} historyList={historyList} isAuthenticated={isAuthenticated}/>
107
- </div>
108
+ {/* 얘는 아래 64px로 고정 */}
109
+ {/* <div className={`!z-[50]`}>
110
+ <NavigationFooter
111
+ activeView={activeView}
112
+ onHomeClick={handleHomeClick}
113
+ onHistoryClick={handleHistoryClick}
114
+ historyList={historyList}
115
+ isAuthenticated={isAuthenticated}
116
+ />
117
+ </div> */}
108
118
  </div>
109
119
  </div>
110
120
  {/*얘는 abolute라서 고려 X*/}
@@ -114,14 +124,26 @@ const ChatHomeView = ({ hashValue, onClose, isMobile, isHash }) => {
114
124
  : undefined}/>
115
125
  </main>);
116
126
  };
117
- // 채팅 문의 창
118
- if (viewState === 'conversation') {
119
- return renderWithNavigation(<ChatConversation onBackClick={handleBackToHome} isActive={viewState === 'conversation'} onChatNew={handleNewStartChat} isMobile={isMobile} onClose={onClose} isHash={isHash}/>, 'conversation');
120
- }
121
127
  if (viewState === 'history') {
122
- return renderWithNavigation(<HistoryView onBackClick={handleBackToHome} onChatHistoryClick={handleChatHistoryClick} onNewChatClick={handleNewStartChat} isAuthenticated={isAuthenticated !== null && isAuthenticated !== void 0 ? isAuthenticated : false} historyLit={historyList !== null && historyList !== void 0 ? historyList : []} goGetHistoryList={goGetHistoryList} isMobile={isMobile} onClose={onClose} isHash={isHash} handleGoRequestPhone={handleGoRequestPhone} handleGoHistoryPhoneAuth={handleGoHistoryPhoneAuth}/>, 'history');
128
+ return renderWithNavigation(<HistoryView onBackClick={handleBackClick} onChatHistoryClick={handleChatHistoryClick} onNewChatClick={handleNewStartChat} isAuthenticated={isAuthenticated !== null && isAuthenticated !== void 0 ? isAuthenticated : false} historyLit={historyList !== null && historyList !== void 0 ? historyList : []} goGetHistoryList={goGetHistoryList} isMobile={isMobile} onClose={onClose} isHash={isHash} handleGoRequestPhone={handleGoRequestPhone} handleGoHistoryPhoneAuth={handleGoHistoryPhoneAuth}/>, 'history');
123
129
  }
124
- // 홈
125
- return renderWithNavigation(<HomeView inquiryMainData={inquiryMainData !== null && inquiryMainData !== void 0 ? inquiryMainData : null} isLoading={isLoading} handleStartChat={handleStartChat} isMobile={isMobile} onClose={onClose} isHash={isHash}/>, 'home');
130
+ // 채팅 문의 창
131
+ // if (viewState === 'conversation') {
132
+ return renderWithNavigation(<ChatConversation
133
+ // 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');
135
+ // }
136
+ // // 홈
137
+ // return renderWithNavigation(
138
+ // <HomeView
139
+ // inquiryMainData={inquiryMainData ?? null}
140
+ // isLoading={isLoading}
141
+ // handleStartChat={handleStartChat}
142
+ // isMobile={isMobile}
143
+ // onClose={onClose}
144
+ // isHash={isHash}
145
+ // />,
146
+ // 'home'
147
+ // );
126
148
  };
127
149
  export default ChatHomeView;
@@ -2,15 +2,12 @@ import React, { useEffect, useState } from 'react';
2
2
  import { useDaeryuntalk } from './DaeryuntalkContext';
3
3
  import ChatConversation from './ChatConversation';
4
4
  import HistoryView from './HistoryView';
5
- import NavigationFooter from './NavigationFooter';
6
5
  import { useChatSocketState } from './_hooks/view/useChatSocketState';
7
6
  import ToastRenderer from './Toast/ToastRender';
8
- import HomeView from './HomeView';
9
7
  import { useHistoryView } from './_hooks/view/useHistoryView';
10
- import { useHomeView } from './_hooks/view/useHomeView';
11
8
  import FixedErrorBox from './FixedErrorBox';
12
9
 
13
- export type ViewState = 'home' | 'conversation' | 'history';
10
+ export type ViewState = 'conversation' | 'history';
14
11
 
15
12
  type ChatHomeViewProps = {
16
13
  hashValue: string | null;
@@ -19,28 +16,29 @@ type ChatHomeViewProps = {
19
16
  onClose: () => void;
20
17
  };
21
18
  const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobile, isHash }) => {
22
- const [viewState, setViewState] = useState<ViewState>(isHash ? 'conversation' : 'home');
23
- const [isLoading, setIsLoading] = useState<boolean>(false);
19
+ const [viewState, setViewState] = useState<ViewState>('conversation');
20
+ // const [isLoading, setIsLoading] = useState<boolean>(false);
24
21
 
25
22
  const {
26
23
  isUserExpired,
27
24
  isConnected,
28
25
  isAuthenticated,
29
26
  historyList,
30
- inquiryMainData,
27
+ // inquiryMainData,
31
28
  chatInquiryNumber,
32
- startChat,
33
- retryInitData,
29
+ // startChat,
30
+ // retryInitData,
34
31
  setIsTyping,
35
- setPreviewState,
36
- preViewState
32
+ // setPreviewState,
33
+ // preViewState,
34
+ initialLoading
37
35
  } = useDaeryuntalk();
38
36
 
39
37
  // 소켓 이벤트
40
38
  const { sendInquiryJoined, sendHeartbeat, sendInquiryWatching, sendInquiryLeft, sendHistoryEntered } =
41
39
  useDaeryuntalk();
42
40
  // 홈
43
- const { retryInquiryMain } = useDaeryuntalk();
41
+ // const { retryInquiryMain } = useDaeryuntalk();
44
42
  // 히스토리
45
43
  const {
46
44
  startSelectedChat,
@@ -66,16 +64,16 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
66
64
  );
67
65
 
68
66
  // 홈 뷰 훅스
69
- const { handleStartChat, handleHashStartChat, handleBackToHome } = useHomeView({
70
- setIsLoading,
71
- setViewState,
72
- retryInquiryMain,
73
- inquiryMainData: inquiryMainData ?? null,
74
- startChat,
75
- preViewState,
76
- viewState,
77
- setPreviewState
78
- });
67
+ // const { handleStartChat, handleHashStartChat } = useHomeView({
68
+ // setIsLoading,
69
+ // setViewState,
70
+ // retryInquiryMain,
71
+ // inquiryMainData: inquiryMainData ?? null,
72
+ // startChat,
73
+ // preViewState,
74
+ // viewState,
75
+ // setPreviewState
76
+ // });
79
77
 
80
78
  // 히스토리 뷰 hooks
81
79
  const {
@@ -84,24 +82,25 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
84
82
  handleHistoryClick,
85
83
  handleGoRequestPhone,
86
84
  handleGoHistoryPhoneAuth,
87
- handleHomeClick
85
+ handleBackClick
88
86
  } = useHistoryView({
89
87
  attendRoomByHistory,
90
88
  startSelectedChat,
91
89
  setViewState,
92
- setIsLoading,
90
+ // setIsLoading,
93
91
  createNewChat,
94
92
  goRequestPhone,
95
93
  goHistoryPhoneAuth,
96
- setPreviewState
94
+ chatInquiryNumber
95
+ // setPreviewState
97
96
  });
98
97
 
99
- useEffect(() => {
100
- if (hashValue && isConnected && inquiryMainData && inquiryMainData.channel_number) {
101
- handleHashStartChat();
102
- } else {
103
- }
104
- }, [hashValue, isConnected, inquiryMainData]);
98
+ // useEffect(() => {
99
+ // if (hashValue && isConnected && inquiryMainData && inquiryMainData.channel_number) {
100
+ // handleHashStartChat();
101
+ // } else {
102
+ // }
103
+ // }, [hashValue, isConnected, inquiryMainData]);
105
104
 
106
105
  // viewState 진입
107
106
  useEffect(() => {
@@ -114,15 +113,15 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
114
113
  }
115
114
  }, [viewState, isAuthenticated]);
116
115
 
117
- useEffect(() => {
118
- if (inquiryMainData !== null) {
119
- if (!inquiryMainData?.channel_number) {
120
- retryInitData();
121
- }
122
- }
123
- }, [inquiryMainData, inquiryMainData?.channel_number]);
116
+ // useEffect(() => {
117
+ // if (inquiryMainData !== null) {
118
+ // if (!inquiryMainData?.channel_number) {
119
+ // retryInitData();
120
+ // }
121
+ // }
122
+ // }, [inquiryMainData, inquiryMainData?.channel_number]);
124
123
 
125
- const renderWithNavigation = (content: React.ReactNode, activeView: 'home' | 'history' | 'conversation') => {
124
+ const renderWithNavigation = (content: React.ReactNode, activeView: 'history' | 'conversation') => {
126
125
  return (
127
126
  //
128
127
  <main
@@ -153,7 +152,6 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
153
152
  xs:w-[390px] xs:rounded-[30px]
154
153
  `
155
154
  }
156
-
157
155
  `
158
156
  }
159
157
 
@@ -167,8 +165,8 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
167
165
  >
168
166
  {content}
169
167
  </div>
170
- <div className={`!z-[50]`}>
171
- {/* 얘는 아래 64px로 고정 */}
168
+ {/* 얘는 아래 64px로 고정 */}
169
+ {/* <div className={`!z-[50]`}>
172
170
  <NavigationFooter
173
171
  activeView={activeView}
174
172
  onHomeClick={handleHomeClick}
@@ -176,7 +174,7 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
176
174
  historyList={historyList}
177
175
  isAuthenticated={isAuthenticated}
178
176
  />
179
- </div>
177
+ </div> */}
180
178
  </div>
181
179
  </div>
182
180
  {/*얘는 abolute라서 고려 X*/}
@@ -193,25 +191,10 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
193
191
  );
194
192
  };
195
193
 
196
- // 채팅 문의 창
197
- if (viewState === 'conversation') {
198
- return renderWithNavigation(
199
- <ChatConversation
200
- onBackClick={handleBackToHome}
201
- isActive={viewState === 'conversation'}
202
- onChatNew={handleNewStartChat}
203
- isMobile={isMobile}
204
- onClose={onClose}
205
- isHash={isHash}
206
- />,
207
- 'conversation'
208
- );
209
- }
210
-
211
194
  if (viewState === 'history') {
212
195
  return renderWithNavigation(
213
196
  <HistoryView
214
- onBackClick={handleBackToHome}
197
+ onBackClick={handleBackClick}
215
198
  onChatHistoryClick={handleChatHistoryClick}
216
199
  onNewChatClick={handleNewStartChat}
217
200
  isAuthenticated={isAuthenticated ?? false}
@@ -226,19 +209,38 @@ const ChatHomeView: React.FC<ChatHomeViewProps> = ({ hashValue, onClose, isMobil
226
209
  'history'
227
210
  );
228
211
  }
229
-
230
- // 홈
212
+ // 채팅 문의 창
213
+ // if (viewState === 'conversation') {
231
214
  return renderWithNavigation(
232
- <HomeView
233
- inquiryMainData={inquiryMainData ?? null}
234
- isLoading={isLoading}
235
- handleStartChat={handleStartChat}
215
+ <ChatConversation
216
+ // onBackClick={handleBackToHome}
217
+ isActive={viewState === 'conversation'}
218
+ initialLoading={initialLoading}
219
+ onChatNew={handleNewStartChat}
236
220
  isMobile={isMobile}
237
221
  onClose={onClose}
238
222
  isHash={isHash}
223
+ viewState={viewState}
224
+ handleHistoryClick={handleHistoryClick}
225
+ isAuthenticated={isAuthenticated ?? false}
226
+ historyList={historyList ?? []}
239
227
  />,
240
- 'home'
228
+ 'conversation'
241
229
  );
230
+ // }
231
+
232
+ // // 홈
233
+ // return renderWithNavigation(
234
+ // <HomeView
235
+ // inquiryMainData={inquiryMainData ?? null}
236
+ // isLoading={isLoading}
237
+ // handleStartChat={handleStartChat}
238
+ // isMobile={isMobile}
239
+ // onClose={onClose}
240
+ // isHash={isHash}
241
+ // />,
242
+ // 'home'
243
+ // );
242
244
  };
243
245
 
244
246
  export default ChatHomeView;
@@ -1,8 +1,9 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
2
  import { useDaeryuntalk } from './DaeryuntalkContext';
3
- import SendIcon from '../../asset/images/daeryuntalk/send.svg';
4
3
  import Tiptap from './Tiptap/Tiptap';
5
4
  import { stripHtmlTags } from './_lib/utils';
5
+ // 이미지
6
+ import SendIcon from '../../asset/images/daeryuntalk/send.svg';
6
7
  const ChatInput = ({ isMobile }) => {
7
8
  const [message, setMessage] = useState('');
8
9
  const { sendMessage, isLoading } = useDaeryuntalk();
@@ -1,9 +1,11 @@
1
1
  import React, { useEffect, useRef, useState } from 'react';
2
2
  import { useDaeryuntalk } from './DaeryuntalkContext';
3
- import SendIcon from '../../asset/images/daeryuntalk/send.svg';
4
3
  import Tiptap, { TiptapEditorRef } from './Tiptap/Tiptap';
5
4
  import { stripHtmlTags } from './_lib/utils';
6
5
 
6
+ // 이미지
7
+ import SendIcon from '../../asset/images/daeryuntalk/send.svg';
8
+
7
9
  interface props {
8
10
  isMobile: boolean;
9
11
  }
@@ -10,10 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import React from 'react';
11
11
  import Image from 'next/image';
12
12
  import { formatFileSize } from '../_lib/utils';
13
- import FileDownLoadIcon from '../../../asset/images/daeryuntalk/viewer/gray-download.svg';
14
13
  import { useDaeryuntalk } from '../DaeryuntalkContext';
15
14
  import { getMessageFileDownloadUrl } from '../_api';
16
15
  import TimeWrapper from './TimeWrapper';
16
+ //이미지
17
+ import FileDownLoadIcon from '../../../asset/images/daeryuntalk/viewer/gray-download.svg';
17
18
  const ChatFile = ({ message, isOperator, isHovered, time }) => {
18
19
  const { openImageViewer } = useDaeryuntalk();
19
20
  const handleDownload = (file) => __awaiter(void 0, void 0, void 0, function* () {
@@ -2,10 +2,11 @@ import React from 'react';
2
2
  import { FileInfo, Message } from '../_types/message';
3
3
  import Image from 'next/image';
4
4
  import { formatFileSize } from '../_lib/utils';
5
- import FileDownLoadIcon from '../../../asset/images/daeryuntalk/viewer/gray-download.svg';
6
5
  import { useDaeryuntalk } from '../DaeryuntalkContext';
7
6
  import { getMessageFileDownloadUrl } from '../_api';
8
7
  import TimeWrapper from './TimeWrapper';
8
+ //이미지
9
+ import FileDownLoadIcon from '../../../asset/images/daeryuntalk/viewer/gray-download.svg';
9
10
 
10
11
  interface props {
11
12
  message: Message;
@@ -1,3 +1,6 @@
1
1
  import React from 'react';
2
- declare const ChatLoading: () => React.JSX.Element;
2
+ interface ChatLoadingProsp {
3
+ outerClass?: string;
4
+ }
5
+ declare const ChatLoading: ({ outerClass }: ChatLoadingProsp) => React.JSX.Element;
3
6
  export default ChatLoading;