@daeryun/dr_components 0.8.46 → 0.8.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asset/images/daeryuntalk/close.svg +2 -2
- package/dist/asset/images/daeryuntalk/time.svg +2 -2
- package/dist/asset/images/daeryuntalk/viewer/zoom-out.svg +2 -4
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/Daeryuntalk/ChatButton.jsx +5 -2
- package/dist/components/Daeryuntalk/ChatButton.tsx +5 -2
- package/dist/components/Daeryuntalk/ChatConversation.d.ts +2 -0
- package/dist/components/Daeryuntalk/ChatConversation.jsx +22 -63
- package/dist/components/Daeryuntalk/ChatConversation.tsx +42 -79
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.d.ts +11 -0
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.jsx +27 -0
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.tsx +57 -0
- package/dist/components/Daeryuntalk/ChatHomeView.d.ts +3 -2
- package/dist/components/Daeryuntalk/ChatHomeView.jsx +59 -181
- package/dist/components/Daeryuntalk/ChatHomeView.tsx +102 -206
- package/dist/components/Daeryuntalk/ChatItem/ChatFile.jsx +15 -14
- package/dist/components/Daeryuntalk/ChatItem/ChatFile.tsx +15 -14
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.d.ts +3 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.jsx +11 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatLoading.tsx +21 -0
- package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.jsx +4 -4
- package/dist/components/Daeryuntalk/ChatItem/ChatWrapper.tsx +4 -4
- package/dist/components/Daeryuntalk/ChatItem/RichText.jsx +2 -1
- package/dist/components/Daeryuntalk/ChatItem/RichText.tsx +2 -1
- package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.d.ts +9 -0
- package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.jsx +9 -0
- package/dist/components/Daeryuntalk/ChatItem/TimeWrapper.tsx +20 -0
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.jsx +3 -3
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowClickData.tsx +3 -3
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.jsx +2 -2
- package/dist/components/Daeryuntalk/ChatItem/WorkFlowImg.tsx +2 -2
- package/dist/components/Daeryuntalk/ChatMessage.d.ts +1 -0
- package/dist/components/Daeryuntalk/ChatMessage.jsx +31 -36
- package/dist/components/Daeryuntalk/ChatMessage.tsx +34 -38
- package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.jsx +2 -2
- package/dist/components/Daeryuntalk/ChatObject/FieldWorkObject.tsx +2 -2
- package/dist/components/Daeryuntalk/ChatObject/ObjectBack.jsx +1 -1
- package/dist/components/Daeryuntalk/ChatObject/ObjectBack.tsx +1 -1
- package/dist/components/Daeryuntalk/ChatObject/ObjectButton.jsx +6 -23
- package/dist/components/Daeryuntalk/ChatObject/ObjectButton.tsx +6 -23
- package/dist/components/Daeryuntalk/ChatWidget.jsx +60 -23
- package/dist/components/Daeryuntalk/ChatWidget.tsx +72 -34
- package/dist/components/Daeryuntalk/DaeryuntalkContext.d.ts +2 -2
- package/dist/components/Daeryuntalk/DaeryuntalkContext.jsx +2 -2
- package/dist/components/Daeryuntalk/DaeryuntalkContext.tsx +5 -5
- package/dist/components/Daeryuntalk/DateSeparator.jsx +2 -2
- package/dist/components/Daeryuntalk/DateSeparator.tsx +2 -2
- package/dist/components/Daeryuntalk/FixedErrorBox.d.ts +7 -0
- package/dist/components/Daeryuntalk/FixedErrorBox.jsx +33 -0
- package/dist/components/Daeryuntalk/FixedErrorBox.tsx +73 -0
- package/dist/components/Daeryuntalk/History/AuthForm.d.ts +3 -1
- package/dist/components/Daeryuntalk/History/AuthForm.jsx +15 -45
- package/dist/components/Daeryuntalk/History/AuthForm.tsx +21 -53
- package/dist/components/Daeryuntalk/HistoryView.d.ts +4 -0
- package/dist/components/Daeryuntalk/HistoryView.jsx +17 -40
- package/dist/components/Daeryuntalk/HistoryView.tsx +36 -48
- package/dist/components/Daeryuntalk/HomeView.d.ts +12 -0
- package/dist/components/Daeryuntalk/HomeView.jsx +102 -0
- package/dist/components/Daeryuntalk/HomeView.tsx +150 -0
- package/dist/components/Daeryuntalk/NavigationFooter.jsx +17 -10
- package/dist/components/Daeryuntalk/NavigationFooter.tsx +22 -12
- package/dist/components/Daeryuntalk/NoticeMessage.jsx +7 -7
- package/dist/components/Daeryuntalk/NoticeMessage.tsx +7 -7
- package/dist/components/Daeryuntalk/Toast/ToastRender.jsx +1 -1
- package/dist/components/Daeryuntalk/Toast/ToastRender.tsx +2 -2
- package/dist/components/Daeryuntalk/Viewer/ImageViewer.d.ts +6 -0
- package/dist/components/Daeryuntalk/Viewer/ImageViewer.jsx +18 -90
- package/dist/components/Daeryuntalk/Viewer/ImageViewer.tsx +49 -135
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.d.ts +16 -0
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.jsx +66 -0
- package/dist/components/Daeryuntalk/Viewer/MobileViewer.tsx +121 -0
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.d.ts +22 -0
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.jsx +104 -0
- package/dist/components/Daeryuntalk/Viewer/TbPcViewer.tsx +195 -0
- package/dist/components/Daeryuntalk/_api/daeryuntalk/index.d.ts +4 -3
- package/dist/components/Daeryuntalk/_api/daeryuntalk/index.js +81 -105
- package/dist/components/Daeryuntalk/_api/daeryuntalk/index.ts +105 -121
- package/dist/components/Daeryuntalk/_enums/ask-status.d.ts +7 -0
- package/dist/components/Daeryuntalk/_enums/ask-status.js +14 -0
- package/dist/components/Daeryuntalk/_enums/ask-status.ts +14 -0
- package/dist/components/Daeryuntalk/_enums/error.d.ts +3 -0
- package/dist/components/Daeryuntalk/_enums/error.js +125 -0
- package/dist/components/Daeryuntalk/_enums/error.ts +143 -0
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.d.ts +8 -8
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.js +227 -179
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatHandler.ts +261 -185
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.d.ts +1 -1
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.js +54 -18
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useHistoryHandler.ts +68 -15
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.d.ts +2 -2
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.js +8 -7
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useSocketEventHandler.ts +13 -6
- package/dist/components/Daeryuntalk/_hooks/view/useChatSocketState.d.ts +2 -0
- package/dist/components/Daeryuntalk/_hooks/{talkprovider → view}/useChatSocketState.js +7 -1
- package/dist/components/Daeryuntalk/_hooks/{talkprovider → view}/useChatSocketState.ts +13 -1
- package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.d.ts +26 -0
- package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.js +72 -0
- package/dist/components/Daeryuntalk/_hooks/view/useHistoryView.ts +93 -0
- package/dist/components/Daeryuntalk/_hooks/view/useHomeView.d.ts +16 -0
- package/dist/components/Daeryuntalk/_hooks/view/useHomeView.js +61 -0
- package/dist/components/Daeryuntalk/_hooks/view/useHomeView.ts +64 -0
- package/dist/components/Daeryuntalk/_lib/utils.d.ts +1 -0
- package/dist/components/Daeryuntalk/_lib/utils.js +27 -0
- package/dist/components/Daeryuntalk/_lib/utils.ts +33 -0
- package/dist/components/Daeryuntalk/_ui/buttons/Button2.jsx +3 -3
- package/dist/components/Daeryuntalk/_ui/buttons/Button2.tsx +3 -3
- package/dist/components/Daeryuntalk/_ui/buttons/Button3.d.ts +10 -0
- package/dist/components/Daeryuntalk/_ui/buttons/Button3.jsx +12 -0
- package/dist/components/Daeryuntalk/_ui/buttons/Button3.tsx +29 -0
- package/dist/components/Daeryuntalk/_ui/inputs/Input2.jsx +2 -1
- package/dist/components/Daeryuntalk/_ui/inputs/Input2.tsx +2 -1
- package/dist/components/Daeryuntalk/index.jsx +1 -1
- package/dist/components/Daeryuntalk/index.tsx +12 -1
- package/dist/components/Seo/SeoStrength.jsx +5 -2
- package/dist/components/Seo/SeoStrength.tsx +5 -2
- package/dist/styles/globals.css +518 -172
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/components/Daeryuntalk/_enums/error_code.d.ts +0 -21
- package/dist/components/Daeryuntalk/_enums/error_code.js +0 -23
- package/dist/components/Daeryuntalk/_enums/error_code.ts +0 -22
- package/dist/components/Daeryuntalk/_hooks/talkprovider/useChatSocketState.d.ts +0 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import TimeIcon from '../../asset/images/daeryuntalk/time.svg';
|
|
4
|
+
import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
5
|
+
import ShadowBox from './_ui/ShadowBox';
|
|
6
|
+
import SendIcon from '../../asset/images/daeryuntalk/send.svg';
|
|
7
|
+
import InfoIcon from '../../asset/images/daeryuntalk/info.svg';
|
|
8
|
+
import { IChatInquiryMainDataResponse } from './_api/daeryuntalk/type/response';
|
|
9
|
+
import DaeryuntalkIntro from '../../asset/images/daeryuntalk/daeryuntalk-intro.png';
|
|
10
|
+
import CloseSvgIcon from '../../asset/images/daeryuntalk/close.svg';
|
|
11
|
+
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
12
|
+
import Button3 from './_ui/buttons/Button3';
|
|
13
|
+
|
|
14
|
+
interface IHomeViewProps {
|
|
15
|
+
inquiryMainData: IChatInquiryMainDataResponse | null;
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
handleStartChat: () => void;
|
|
18
|
+
isMobile: boolean;
|
|
19
|
+
onClose: () => void;
|
|
20
|
+
isHash: boolean;
|
|
21
|
+
}
|
|
22
|
+
const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClose, isHash }: IHomeViewProps) => {
|
|
23
|
+
const { containerRef, isScroll, isBottom, checkScroll } = useScrollShadow<HTMLDivElement>();
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
checkScroll();
|
|
26
|
+
}, [inquiryMainData]);
|
|
27
|
+
// 아직 커버이미지 url이 안나옴
|
|
28
|
+
const backgroundImage = inquiryMainData?.sleeve_image_url ? inquiryMainData.sleeve_image_url : DaeryuntalkIntro;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
className={`
|
|
33
|
+
relative h-full w-full
|
|
34
|
+
${isMobile ? `flex flex-col items-center justify-between` : `flex flex-col items-center `}
|
|
35
|
+
`}
|
|
36
|
+
>
|
|
37
|
+
<header
|
|
38
|
+
className={`
|
|
39
|
+
z-10
|
|
40
|
+
flex h-[56px] w-full justify-between px-[20px]
|
|
41
|
+
`}
|
|
42
|
+
>
|
|
43
|
+
<div
|
|
44
|
+
className={`
|
|
45
|
+
dr_talk_subtitle_small flex items-center gap-[2px] pt-[31.5px] text-drTalkGrayscale1
|
|
46
|
+
`}
|
|
47
|
+
>
|
|
48
|
+
<TimeIcon width={20} height={20} />
|
|
49
|
+
<span>24시간 운영</span>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div
|
|
53
|
+
className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : ' xs:pointer-events-none xs:!opacity-0 '} py-[14px] text-drTalkGrayscale2 hover:cursor-pointer`}
|
|
54
|
+
onClick={onClose}
|
|
55
|
+
>
|
|
56
|
+
<CloseSvgIcon width={28} height={28} />
|
|
57
|
+
</div>
|
|
58
|
+
</header>
|
|
59
|
+
<div className={'absolute left-0 top-0 z-0 h-full w-full overflow-hidden'}>
|
|
60
|
+
<Image
|
|
61
|
+
src={backgroundImage}
|
|
62
|
+
alt="대화 배경"
|
|
63
|
+
fill
|
|
64
|
+
className={`
|
|
65
|
+
${isMobile ? `h-full max-h-[360px] w-full object-center will-change-transform ` : `w-full object-contain object-top will-change-transform`}`}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<div
|
|
70
|
+
className={`
|
|
71
|
+
relative z-10 px-[20px]
|
|
72
|
+
${
|
|
73
|
+
isMobile
|
|
74
|
+
? `flex w-full justify-center `
|
|
75
|
+
: `
|
|
76
|
+
flex h-full w-full flex-col justify-center
|
|
77
|
+
`
|
|
78
|
+
}
|
|
79
|
+
`}
|
|
80
|
+
>
|
|
81
|
+
<section
|
|
82
|
+
className={`
|
|
83
|
+
flex h-[408px] flex-col rounded-[12px] bg-white px-[16px] py-[24px]
|
|
84
|
+
${isMobile ? `w-full` : ``}
|
|
85
|
+
`}
|
|
86
|
+
style={{
|
|
87
|
+
boxShadow: '0px 4px 10px 0px #00000026'
|
|
88
|
+
}}
|
|
89
|
+
>
|
|
90
|
+
{/*mx-auto mt-[150px] flex w-[320px] flex-col gap-5 rounded-[12px] bg-white px-4 py-6*/}
|
|
91
|
+
<div className={`flex items-center gap-[10px]`}>
|
|
92
|
+
{inquiryMainData?.channel_logo_image_url ? (
|
|
93
|
+
<Image
|
|
94
|
+
src={inquiryMainData.channel_logo_image_url}
|
|
95
|
+
alt="로고"
|
|
96
|
+
width={32}
|
|
97
|
+
height={32}
|
|
98
|
+
className={''}
|
|
99
|
+
/>
|
|
100
|
+
) : (
|
|
101
|
+
<DaeryunLogoIcon width={24} height={24} className="mr-2" />
|
|
102
|
+
)}
|
|
103
|
+
<h1 className={`dr_talk_title_small text-drTalkBlack`}>
|
|
104
|
+
{inquiryMainData?.channel_name || '법무법인(유한)대륜'}
|
|
105
|
+
</h1>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<div className={`dr_talk_body_medium2 relative ml-[42px] mr-[16px] mt-[16px]`}>
|
|
109
|
+
<div
|
|
110
|
+
ref={containerRef}
|
|
111
|
+
className={`
|
|
112
|
+
|
|
113
|
+
no-scrollbar
|
|
114
|
+
relative max-h-[144px] overflow-auto
|
|
115
|
+
whitespace-pre-line
|
|
116
|
+
`}
|
|
117
|
+
>
|
|
118
|
+
{inquiryMainData?.salutation ||
|
|
119
|
+
`안녕하세요.
|
|
120
|
+
법무법인(유한)대륜입니다.
|
|
121
|
+
방문해 주셔서 감사합니다.
|
|
122
|
+
궁금한 점이나 도움이 필요하신 부분
|
|
123
|
+
말씀해 주시면 도와드리겠습니다.
|
|
124
|
+
|
|
125
|
+
6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다.`}
|
|
126
|
+
</div>
|
|
127
|
+
{isScroll && !isBottom && <ShadowBox />}
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<Button3 onClick={handleStartChat} isDisabled={isLoading} className={`mt-auto`}>
|
|
131
|
+
<div className={`flex items-center justify-center gap-[4px]`}>
|
|
132
|
+
<div>{isLoading ? '로딩 중...' : '문의하기'}</div>
|
|
133
|
+
{!isLoading && <SendIcon width={24} height={24} />}
|
|
134
|
+
</div>
|
|
135
|
+
</Button3>
|
|
136
|
+
|
|
137
|
+
<div className={`flex items-center justify-center gap-[4px] pt-[20px]`}>
|
|
138
|
+
<InfoIcon width={20} height={20} />
|
|
139
|
+
<span className={`dr_talk_body_small1 text-drTalkGrayscale2 `}>
|
|
140
|
+
{inquiryMainData?.answer_speed_message || '빠르게 답변 받으실 수 있어요'}
|
|
141
|
+
</span>
|
|
142
|
+
</div>
|
|
143
|
+
</section>
|
|
144
|
+
</div>
|
|
145
|
+
{isMobile && <div></div>}
|
|
146
|
+
</div>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export default HomeView;
|
|
@@ -6,24 +6,31 @@ const NavigationFooter = ({ activeView, onHomeClick, onHistoryClick, historyList
|
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
8
|
return (<footer>
|
|
9
|
-
<div className="h-px w-full bg-
|
|
10
|
-
<nav className=
|
|
11
|
-
<div className={`group flex cursor-pointer flex-col items-center ${activeView === 'home' ? 'text-
|
|
12
|
-
<Home width={32} height={32} className="
|
|
13
|
-
<span className={`
|
|
9
|
+
<div className="h-px w-full bg-drTalkGrayscale4" role="separator"></div>
|
|
10
|
+
<nav className={' flex h-[64px] justify-around px-8 pb-[12px] pt-[8px]'}>
|
|
11
|
+
<div className={`group flex cursor-pointer flex-col items-center ${activeView === 'home' ? 'text-drTalkCrimson' : 'text-gray-400 hover:text-drTalkCrimson'}`} role="button" tabIndex={0} onClick={onHomeClick}>
|
|
12
|
+
<Home width={32} height={32} className=""/>
|
|
13
|
+
<span className={`dr_talk_subtitle_small2 ${activeView === 'home'
|
|
14
|
+
? 'text-drTalkCrimson'
|
|
15
|
+
: 'text-drTalkGrayscale3 group-hover:text-drTalkCrimson'}`}>
|
|
14
16
|
홈
|
|
15
17
|
</span>
|
|
16
18
|
</div>
|
|
17
|
-
<div className={`group relative flex cursor-pointer flex-col items-center ${activeView === 'history'
|
|
19
|
+
<div className={`group relative flex cursor-pointer flex-col items-center ${activeView === 'history'
|
|
20
|
+
? 'text-drTalkCrimson'
|
|
21
|
+
: 'text-drTalkGrayscale3 hover:text-drTalkCrimson'}`} role="button" tabIndex={0} onClick={onHistoryClick}>
|
|
18
22
|
{isAuthenticated &&
|
|
19
23
|
(() => {
|
|
20
24
|
const unreadCount = historyList.reduce((sum, item) => sum + (item.unread_message_count || 0), 0);
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
const isHundredOver = unreadCount > 99;
|
|
26
|
+
return unreadCount > 0 ? (<span className={`${isHundredOver ? ' -right-[20px] -top-[5px] h-[18px] w-[31px] rounded-[15.5px] ' : '-right-[8px] -top-[5px] h-[18px] w-[18px] rounded-full pr-[1px]'}dr_talk_subtitle_small2 absolute flex items-center justify-center bg-drTalkCrimson text-drTalkWhite`}>
|
|
27
|
+
{isHundredOver ? '99+' : unreadCount}
|
|
23
28
|
</span>) : null;
|
|
24
29
|
})()}
|
|
25
|
-
<History width={32} height={32}
|
|
26
|
-
<span className={`
|
|
30
|
+
<History width={32} height={32}/>
|
|
31
|
+
<span className={`dr_talk_subtitle_small2 ${activeView === 'history'
|
|
32
|
+
? 'text-drTalkCrimson'
|
|
33
|
+
: 'text-drTalkGrayscale3 group-hover:text-drTalkCrimson'}`}>
|
|
27
34
|
히스토리
|
|
28
35
|
</span>
|
|
29
36
|
</div>
|
|
@@ -23,20 +23,22 @@ const NavigationFooter: React.FC<NavigationFooterProps> = ({
|
|
|
23
23
|
}
|
|
24
24
|
return (
|
|
25
25
|
<footer>
|
|
26
|
-
<div className="h-px w-full bg-
|
|
27
|
-
<nav className=
|
|
26
|
+
<div className="h-px w-full bg-drTalkGrayscale4" role="separator"></div>
|
|
27
|
+
<nav className={' flex h-[64px] justify-around px-8 pb-[12px] pt-[8px]'}>
|
|
28
28
|
<div
|
|
29
29
|
className={`group flex cursor-pointer flex-col items-center ${
|
|
30
|
-
activeView === 'home' ? 'text-
|
|
30
|
+
activeView === 'home' ? 'text-drTalkCrimson' : 'text-gray-400 hover:text-drTalkCrimson'
|
|
31
31
|
}`}
|
|
32
32
|
role="button"
|
|
33
33
|
tabIndex={0}
|
|
34
34
|
onClick={onHomeClick}
|
|
35
35
|
>
|
|
36
|
-
<Home width={32} height={32} className="
|
|
36
|
+
<Home width={32} height={32} className="" />
|
|
37
37
|
<span
|
|
38
|
-
className={`
|
|
39
|
-
activeView === 'home'
|
|
38
|
+
className={`dr_talk_subtitle_small2 ${
|
|
39
|
+
activeView === 'home'
|
|
40
|
+
? 'text-drTalkCrimson'
|
|
41
|
+
: 'text-drTalkGrayscale3 group-hover:text-drTalkCrimson'
|
|
40
42
|
}`}
|
|
41
43
|
>
|
|
42
44
|
홈
|
|
@@ -44,7 +46,9 @@ const NavigationFooter: React.FC<NavigationFooterProps> = ({
|
|
|
44
46
|
</div>
|
|
45
47
|
<div
|
|
46
48
|
className={`group relative flex cursor-pointer flex-col items-center ${
|
|
47
|
-
activeView === 'history'
|
|
49
|
+
activeView === 'history'
|
|
50
|
+
? 'text-drTalkCrimson'
|
|
51
|
+
: 'text-drTalkGrayscale3 hover:text-drTalkCrimson'
|
|
48
52
|
}`}
|
|
49
53
|
role="button"
|
|
50
54
|
tabIndex={0}
|
|
@@ -57,16 +61,22 @@ const NavigationFooter: React.FC<NavigationFooterProps> = ({
|
|
|
57
61
|
0
|
|
58
62
|
);
|
|
59
63
|
|
|
64
|
+
const isHundredOver = unreadCount > 99;
|
|
65
|
+
|
|
60
66
|
return unreadCount > 0 ? (
|
|
61
|
-
<span
|
|
62
|
-
{
|
|
67
|
+
<span
|
|
68
|
+
className={`${isHundredOver ? ' -right-[20px] -top-[5px] h-[18px] w-[31px] rounded-[15.5px] ' : '-right-[8px] -top-[5px] h-[18px] w-[18px] rounded-full pr-[1px]'}dr_talk_subtitle_small2 absolute flex items-center justify-center bg-drTalkCrimson text-drTalkWhite`}
|
|
69
|
+
>
|
|
70
|
+
{isHundredOver ? '99+' : unreadCount}
|
|
63
71
|
</span>
|
|
64
72
|
) : null;
|
|
65
73
|
})()}
|
|
66
|
-
<History width={32} height={32}
|
|
74
|
+
<History width={32} height={32} />
|
|
67
75
|
<span
|
|
68
|
-
className={`
|
|
69
|
-
activeView === 'history'
|
|
76
|
+
className={`dr_talk_subtitle_small2 ${
|
|
77
|
+
activeView === 'history'
|
|
78
|
+
? 'text-drTalkCrimson'
|
|
79
|
+
: 'text-drTalkGrayscale3 group-hover:text-drTalkCrimson'
|
|
70
80
|
}`}
|
|
71
81
|
>
|
|
72
82
|
히스토리
|
|
@@ -3,19 +3,19 @@ import NoticeIcon from '../../asset/images/daeryuntalk/notice.svg';
|
|
|
3
3
|
import PrevIcon from '../../asset/images/daeryuntalk/prev.svg';
|
|
4
4
|
const NoticeMessage = ({ content }) => {
|
|
5
5
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
6
|
-
return (<div className="bg-[#F7F7F7]/90
|
|
7
|
-
<div className="flex items-start">
|
|
8
|
-
<div className="
|
|
9
|
-
<NoticeIcon width={
|
|
6
|
+
return (<div className="bg-[#F7F7F7]/90 px-[20px] pb-[12px] pt-[8px] backdrop-blur-[4px]">
|
|
7
|
+
<div className="flex items-start gap-[8px]">
|
|
8
|
+
<div className="flex-shrink-0">
|
|
9
|
+
<NoticeIcon width={24} height={24}/>
|
|
10
10
|
</div>
|
|
11
|
-
<div className="
|
|
12
|
-
<div className={`overflow-hidden
|
|
11
|
+
<div className="">
|
|
12
|
+
<div className={`dr_talk_body_medium2 overflow-hidden pt-[0.5px] ${isExpanded ? '' : 'line-clamp-2'}`}>
|
|
13
13
|
{content}
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
16
16
|
<button onClick={() => setIsExpanded(!isExpanded)} className="ml-1 flex-shrink-0 transform transition-transform duration-200" aria-label={isExpanded ? '접기' : '펼치기'}>
|
|
17
17
|
<div className={`transform transition-transform duration-200 ${isExpanded ? 'rotate-90' : '-rotate-90'}`}>
|
|
18
|
-
<PrevIcon width={
|
|
18
|
+
<PrevIcon width={24} height={24}/>
|
|
19
19
|
</div>
|
|
20
20
|
</button>
|
|
21
21
|
</div>
|
|
@@ -11,14 +11,14 @@ const NoticeMessage: React.FC<NoticeMessageProps> = ({ content }) => {
|
|
|
11
11
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<div className="bg-[#F7F7F7]/90
|
|
15
|
-
<div className="flex items-start">
|
|
16
|
-
<div className="
|
|
17
|
-
<NoticeIcon width={
|
|
14
|
+
<div className="bg-[#F7F7F7]/90 px-[20px] pb-[12px] pt-[8px] backdrop-blur-[4px]">
|
|
15
|
+
<div className="flex items-start gap-[8px]">
|
|
16
|
+
<div className="flex-shrink-0">
|
|
17
|
+
<NoticeIcon width={24} height={24} />
|
|
18
18
|
</div>
|
|
19
|
-
<div className="
|
|
19
|
+
<div className="">
|
|
20
20
|
<div
|
|
21
|
-
className={`overflow-hidden
|
|
21
|
+
className={`dr_talk_body_medium2 overflow-hidden pt-[0.5px] ${isExpanded ? '' : 'line-clamp-2'}`}
|
|
22
22
|
>
|
|
23
23
|
{content}
|
|
24
24
|
</div>
|
|
@@ -31,7 +31,7 @@ const NoticeMessage: React.FC<NoticeMessageProps> = ({ content }) => {
|
|
|
31
31
|
<div
|
|
32
32
|
className={`transform transition-transform duration-200 ${isExpanded ? 'rotate-90' : '-rotate-90'}`}
|
|
33
33
|
>
|
|
34
|
-
<PrevIcon width={
|
|
34
|
+
<PrevIcon width={24} height={24} />
|
|
35
35
|
</div>
|
|
36
36
|
</button>
|
|
37
37
|
</div>
|
|
@@ -9,7 +9,7 @@ export default function ToastRenderer() {
|
|
|
9
9
|
return null;
|
|
10
10
|
const { toast, isVisible, hideToast } = context;
|
|
11
11
|
return (<div className="absolute bottom-0 left-1/2 z-[50] w-[90%] -translate-x-1/2">
|
|
12
|
-
<div className={`transition-all duration-300 ${isVisible ? '-translate-y-[96px] opacity-100' : 'pointer-events-none translate-y-0 opacity-0'}`}>
|
|
12
|
+
<div className={`transition-all duration-300 ${isVisible ? '-translate-y-[96px] opacity-100' : 'pointer-events-none translate-y-0 opacity-0 '}`}>
|
|
13
13
|
{toast && <DaeryunTalkToast {...toast} onClose={hideToast}/>}
|
|
14
14
|
</div>
|
|
15
15
|
</div>);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ./Toast/ToastRenderer.tsx
|
|
2
2
|
'use client';
|
|
3
3
|
|
|
4
|
-
import { useContext } from 'react';
|
|
4
|
+
import { useContext, useEffect } from 'react';
|
|
5
5
|
import { ToastContext } from './DaeryuntalkToastProvider';
|
|
6
6
|
import DaeryunTalkToast from './Toast';
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ export default function ToastRenderer() {
|
|
|
16
16
|
<div className="absolute bottom-0 left-1/2 z-[50] w-[90%] -translate-x-1/2">
|
|
17
17
|
<div
|
|
18
18
|
className={`transition-all duration-300 ${
|
|
19
|
-
isVisible ? '-translate-y-[96px] opacity-100' : 'pointer-events-none translate-y-0 opacity-0'
|
|
19
|
+
isVisible ? '-translate-y-[96px] opacity-100' : 'pointer-events-none translate-y-0 opacity-0 '
|
|
20
20
|
}`}
|
|
21
21
|
>
|
|
22
22
|
{toast && <DaeryunTalkToast {...toast} onClose={hideToast} />}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { FileInfo } from '../_types/message';
|
|
3
|
+
export declare const ZOOM_LEVELS: number[];
|
|
4
|
+
export type PreviewImage = {
|
|
5
|
+
file: FileInfo;
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
2
8
|
declare const ImageViewer: () => React.JSX.Element | null;
|
|
3
9
|
export default ImageViewer;
|
|
@@ -8,18 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import React, { useState, useEffect } from 'react';
|
|
11
|
-
import Image from 'next/image';
|
|
12
11
|
import { getMessageFileDownloadUrl } from '../_api';
|
|
13
12
|
import { useDaeryuntalk } from '../DaeryuntalkContext';
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
import DownloadIcon from '../../../asset/images/daeryuntalk/download.svg';
|
|
18
|
-
import CloseIcon from '../../../asset/images/daeryuntalk/viewer/close.svg';
|
|
19
|
-
import MoveSwipingIcon from '../../../asset/images/daeryuntalk/viewer/move-button.svg';
|
|
20
|
-
import DaeryunLogoIcon from '../../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
21
|
-
import { formatDateToKorean } from '../_lib/utils';
|
|
22
|
-
const ZOOM_LEVELS = [25, 50, 75, 100, 125, 150, 200];
|
|
13
|
+
import MobileViewer from './MobileViewer';
|
|
14
|
+
import TbPcViewer from './TbPcViewer';
|
|
15
|
+
export const ZOOM_LEVELS = [25, 50, 75, 100, 125, 150, 200];
|
|
23
16
|
const ImageViewer = () => {
|
|
24
17
|
var _a;
|
|
25
18
|
const { isImageViewerOpen, selectedImageFile, imageViewerMessage, closeImageViewer } = useDaeryuntalk();
|
|
@@ -31,6 +24,17 @@ const ImageViewer = () => {
|
|
|
31
24
|
const [previewImages, setPreviewImages] = useState([]);
|
|
32
25
|
const currentImage = previewImages[currentIndex];
|
|
33
26
|
const currentZoom = ZOOM_LEVELS[zoomLevel];
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
const handleKeyDown = (e) => {
|
|
29
|
+
if (e.key === 'Escape' && closeImageViewer) {
|
|
30
|
+
closeImageViewer();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
34
|
+
return () => {
|
|
35
|
+
window.removeEventListener('keydown', handleKeyDown);
|
|
36
|
+
};
|
|
37
|
+
}, [closeImageViewer]);
|
|
34
38
|
// 모든 이미지 URL 미리 생성
|
|
35
39
|
useEffect(() => {
|
|
36
40
|
if (!imageViewerMessage || images.length === 0)
|
|
@@ -87,86 +91,10 @@ const ImageViewer = () => {
|
|
|
87
91
|
};
|
|
88
92
|
if (!isImageViewerOpen || !currentImage)
|
|
89
93
|
return null;
|
|
90
|
-
return (<div className=
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{currentIndex > 0 && (<button onClick={() => setCurrentIndex(prev => prev - 1)} className="absolute left-[-68px] rotate-180 text-3xl text-white">
|
|
95
|
-
<MoveSwipingIcon />
|
|
96
|
-
</button>)}
|
|
97
|
-
|
|
98
|
-
<div className="relative h-[500px] w-[800px]" // width 고정
|
|
99
|
-
style={{
|
|
100
|
-
transform: `rotate(${rotation}deg) scale(${currentZoom / 100})`,
|
|
101
|
-
transformOrigin: 'center center',
|
|
102
|
-
transition: 'transform 0.2s ease'
|
|
103
|
-
// maxWidth: '800px',
|
|
104
|
-
// maxHeight: '500px'
|
|
105
|
-
}}>
|
|
106
|
-
<Image src={currentImage.url} alt={currentImage.file.name} width={800} height={500} className="h-full w-full object-contain" unoptimized style={{
|
|
107
|
-
// maxWidth: '800px',
|
|
108
|
-
// maxHeight: '500px'
|
|
109
|
-
}}/>
|
|
110
|
-
{/* Close Button - Top Right */}
|
|
111
|
-
<button onClick={closeImageViewer} className="absolute right-[20px] top-[20px] z-10">
|
|
112
|
-
<CloseIcon className="h-6 w-6"/>
|
|
113
|
-
</button>
|
|
114
|
-
|
|
115
|
-
{/* Hover Toolbar */}
|
|
116
|
-
<div className="absolute bottom-0 left-1/2 w-full -translate-x-1/2 opacity-0 transition-opacity duration-300 group-hover:opacity-100">
|
|
117
|
-
<div className="mx-auto flex h-[68px] max-w-[800px] items-center justify-between bg-black/70 p-[20px] text-white">
|
|
118
|
-
<div className="flex items-center gap-[20px]">
|
|
119
|
-
<div className={`flex items-center gap-[10px]`}>
|
|
120
|
-
<div className="flex-shrink-0 rounded-full">
|
|
121
|
-
<div className="relative h-full w-full">
|
|
122
|
-
<DaeryunLogoIcon width={28} height={28}/>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
<div>법무법인(유한)대륜</div>
|
|
126
|
-
</div>
|
|
127
|
-
<div>|</div>
|
|
128
|
-
<span className="font-[700] leading-[100%] tracking-[-4%]">
|
|
129
|
-
{formatDateToKorean((imageViewerMessage === null || imageViewerMessage === void 0 ? void 0 : imageViewerMessage.createdAt.toString()) || '')}
|
|
130
|
-
</span>
|
|
131
|
-
</div>
|
|
132
|
-
<div className={`flex flex-row gap-[20px]`}>
|
|
133
|
-
<button onClick={rotateImage}>
|
|
134
|
-
<RotateCCWIcon />
|
|
135
|
-
</button>
|
|
136
|
-
<button onClick={zoomOut} disabled={zoomLevel === 0} className={`${zoomLevel === 0 ? 'cursor-not-allowed opacity-50' : 'hover:opacity-80'} transition`}>
|
|
137
|
-
<ZoomOutIcon />
|
|
138
|
-
</button>
|
|
139
|
-
<button onClick={zoomIn} disabled={zoomLevel === ZOOM_LEVELS.length - 1} className={`${zoomLevel === ZOOM_LEVELS.length - 1
|
|
140
|
-
? 'cursor-not-allowed opacity-50'
|
|
141
|
-
: 'hover:opacity-80'} transition`}>
|
|
142
|
-
<ZoomInIcon />
|
|
143
|
-
</button>
|
|
144
|
-
<button onClick={handleDownload}>
|
|
145
|
-
<DownloadIcon className="bg-transparent text-white"/>
|
|
146
|
-
</button>
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
|
|
152
|
-
{currentIndex < previewImages.length - 1 && (<button onClick={() => setCurrentIndex(prev => prev + 1)} className="absolute right-[-68px] text-3xl text-white">
|
|
153
|
-
<MoveSwipingIcon />
|
|
154
|
-
</button>)}
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
{/* Thumbnail Preview */}
|
|
158
|
-
{previewImages.length > 1 && (<div className="flex flex-row gap-[10px]">
|
|
159
|
-
{previewImages.map((img, idx) => (<div key={img.file.fileNumber} onClick={() => {
|
|
160
|
-
setCurrentIndex(idx);
|
|
161
|
-
setRotation(0);
|
|
162
|
-
setZoomLevel(3);
|
|
163
|
-
}} className={`h-[60px] w-[96px] shrink-0 cursor-pointer overflow-hidden rounded-[10px] border-[1px]
|
|
164
|
-
|
|
165
|
-
${idx === currentIndex ? 'border-white' : 'border-transparent opacity-50 hover:opacity-100'}`}>
|
|
166
|
-
<Image src={img.file.thumbnailUrl} alt={img.file.name} width={96} height={60} className="h-full w-full object-cover" unoptimized/>
|
|
167
|
-
</div>))}
|
|
168
|
-
</div>)}
|
|
169
|
-
</div>
|
|
94
|
+
return (<div className={`fixed inset-0 z-[999999] bg-black/90`} onClick={handleBackdropClick}>
|
|
95
|
+
{/* 900px 이하 */}
|
|
96
|
+
<MobileViewer imageViewerMessage={imageViewerMessage} handleDownload={handleDownload} currentIndex={currentIndex} setCurrentIndex={setCurrentIndex} currentImage={currentImage} closeImageViewer={closeImageViewer} previewImages={previewImages} setRotation={setRotation} setZoomLevel={setZoomLevel}/>
|
|
97
|
+
<TbPcViewer imageViewerMessage={imageViewerMessage} handleDownload={handleDownload} currentIndex={currentIndex} setCurrentIndex={setCurrentIndex} rotation={rotation} currentZoom={currentZoom} currentImage={currentImage} closeImageViewer={closeImageViewer} previewImages={previewImages} setRotation={setRotation} setZoomLevel={setZoomLevel} rotateImage={rotateImage} zoomIn={zoomIn} zoomOut={zoomOut} zoomLevel={zoomLevel}/>
|
|
170
98
|
</div>);
|
|
171
99
|
};
|
|
172
100
|
export default ImageViewer;
|