@daeryun/dr_components 0.8.69 → 0.8.71
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/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/Daeryuntalk/ChatConversation.jsx +146 -25
- package/dist/components/Daeryuntalk/ChatConversation.tsx +193 -50
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.jsx +1 -1
- package/dist/components/Daeryuntalk/ChatConversationItem/ChatConversationHeader.tsx +3 -1
- package/dist/components/Daeryuntalk/ChatHomeView.jsx +7 -5
- package/dist/components/Daeryuntalk/ChatHomeView.tsx +11 -6
- package/dist/components/Daeryuntalk/ChatInput.jsx +9 -7
- package/dist/components/Daeryuntalk/ChatInput.tsx +15 -12
- package/dist/components/Daeryuntalk/ChatWidget.jsx +15 -16
- package/dist/components/Daeryuntalk/ChatWidget.tsx +19 -20
- package/dist/components/Daeryuntalk/HistoryView.jsx +9 -3
- package/dist/components/Daeryuntalk/HistoryView.tsx +15 -3
- package/dist/components/Daeryuntalk/HomeView.jsx +84 -92
- package/dist/components/Daeryuntalk/HomeView.tsx +95 -104
- package/dist/components/Daeryuntalk/NavigationFooter.jsx +1 -1
- package/dist/components/Daeryuntalk/NavigationFooter.tsx +1 -1
- package/dist/components/Daeryuntalk/NoticeMessage.d.ts +1 -0
- package/dist/components/Daeryuntalk/NoticeMessage.jsx +2 -2
- package/dist/components/Daeryuntalk/NoticeMessage.tsx +3 -2
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.d.ts +1 -0
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.jsx +3 -3
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.tsx +4 -3
- package/dist/components/Daeryuntalk/ViewportHandler.d.ts +1 -1
- package/dist/components/Daeryuntalk/ViewportHandler.jsx +5 -23
- package/dist/components/Daeryuntalk/ViewportHandler.tsx +44 -30
- package/dist/components/Daeryuntalk/_hooks/useWindowSize.d.ts +6 -0
- package/dist/components/Daeryuntalk/_hooks/useWindowSize.js +20 -0
- package/dist/components/Daeryuntalk/_hooks/useWindowSize.ts +30 -0
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/styles/globals.css +385 -331
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
1
2
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
3
|
import Image from 'next/image';
|
|
3
4
|
import TimeIcon from '../../asset/images/daeryuntalk/time.svg';
|
|
@@ -5,144 +6,135 @@ import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
|
5
6
|
import ShadowBox from './_ui/ShadowBox';
|
|
6
7
|
import SendIcon from '../../asset/images/daeryuntalk/send.svg';
|
|
7
8
|
import InfoIcon from '../../asset/images/daeryuntalk/info.svg';
|
|
8
|
-
|
|
9
|
-
import DaeryuntalkIntro from '../../asset/images/daeryuntalk/daeryuntalk-intro.png';
|
|
10
|
-
import DaeryuntalkHomeLogo from '../../asset/images/daeryuntalk/home_bg_logo.png';
|
|
9
|
+
import DaeryuntalkIntro from '../../asset/images/daeryuntalk/daeryuntalk_home_bg.png';
|
|
11
10
|
import CloseSvgIcon from '../../asset/images/daeryuntalk/close.svg';
|
|
12
11
|
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
13
12
|
import Button3 from './_ui/buttons/Button3';
|
|
14
13
|
const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClose, isHash }) => {
|
|
15
14
|
const { containerRef, isScroll, isBottom, checkScroll } = useScrollShadow();
|
|
16
|
-
const wrapperRef = useRef(null);
|
|
17
|
-
const [
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
const wrapperRef = useRef(null);
|
|
16
|
+
const [contentHeight, setContentHeight] = useState(210);
|
|
17
|
+
const currentHeightRef = useRef(210);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const updateContentHeight = () => {
|
|
20
|
+
if (!wrapperRef.current)
|
|
21
|
+
return;
|
|
22
|
+
// 모바일이거나 width가 480px 미만이면 contentHeight를 210으로 되돌림
|
|
23
|
+
if (isMobile || window.innerWidth < 480) {
|
|
24
|
+
currentHeightRef.current = 210;
|
|
25
|
+
setContentHeight(210);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
21
28
|
const rect = wrapperRef.current.getBoundingClientRect();
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
const gap = rect.top;
|
|
30
|
+
const currentHeight = currentHeightRef.current;
|
|
31
|
+
// 줄어드는 애니메이션 (2단계)
|
|
32
|
+
if (gap <= 1) {
|
|
33
|
+
if (currentHeight > 140) {
|
|
34
|
+
// 1단계: 210 → 140
|
|
35
|
+
const next = Math.max(140, currentHeight - 6);
|
|
36
|
+
currentHeightRef.current = next;
|
|
37
|
+
setContentHeight(next);
|
|
38
|
+
}
|
|
39
|
+
else if (currentHeight > 80) {
|
|
40
|
+
// 2단계: 140 → 80
|
|
41
|
+
const next = Math.max(80, currentHeight - 4);
|
|
42
|
+
currentHeightRef.current = next;
|
|
43
|
+
setContentHeight(next);
|
|
44
|
+
}
|
|
27
45
|
}
|
|
28
|
-
//
|
|
29
|
-
else {
|
|
30
|
-
if (
|
|
31
|
-
|
|
46
|
+
// 다시 늘어나는 애니메이션 (2단계)
|
|
47
|
+
else if (gap > 1) {
|
|
48
|
+
if (currentHeight < 140) {
|
|
49
|
+
// 1단계: 80 → 140
|
|
50
|
+
const next = Math.min(140, currentHeight + 4);
|
|
51
|
+
currentHeightRef.current = next;
|
|
52
|
+
setContentHeight(next);
|
|
32
53
|
}
|
|
33
|
-
if (
|
|
34
|
-
|
|
54
|
+
else if (currentHeight < 210) {
|
|
55
|
+
// 2단계: 140 → 210
|
|
56
|
+
const next = Math.min(210, currentHeight + 6);
|
|
57
|
+
currentHeightRef.current = next;
|
|
58
|
+
setContentHeight(next);
|
|
35
59
|
}
|
|
36
60
|
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
updateDistance(); // 초기 계산
|
|
41
|
-
const resizeObserver = new ResizeObserver(updateDistance);
|
|
42
|
-
if (wrapperRef.current) {
|
|
43
|
-
resizeObserver.observe(wrapperRef.current);
|
|
44
|
-
}
|
|
45
|
-
// window resize에도 반응
|
|
46
|
-
window.addEventListener('resize', updateDistance);
|
|
47
|
-
return () => {
|
|
48
|
-
resizeObserver.disconnect();
|
|
49
|
-
window.removeEventListener('resize', updateDistance);
|
|
50
61
|
};
|
|
51
|
-
|
|
62
|
+
let rafId;
|
|
63
|
+
const loop = () => {
|
|
64
|
+
updateContentHeight();
|
|
65
|
+
rafId = requestAnimationFrame(loop);
|
|
66
|
+
};
|
|
67
|
+
rafId = requestAnimationFrame(loop);
|
|
68
|
+
return () => cancelAnimationFrame(rafId);
|
|
69
|
+
}, [isMobile, inquiryMainData]);
|
|
52
70
|
useEffect(() => {
|
|
53
71
|
checkScroll();
|
|
54
72
|
}, [inquiryMainData]);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<header className={`
|
|
66
|
-
z-10
|
|
67
|
-
flex h-[56px] w-full justify-between px-[20px]
|
|
68
|
-
`}>
|
|
69
|
-
<div className={`
|
|
70
|
-
dr_talk_subtitle_small flex items-center gap-[2px] pt-[31.5px] text-drTalkGrayscale1
|
|
71
|
-
`}>
|
|
73
|
+
const backgroundImage = (inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.sleeve_image_url) || DaeryuntalkIntro;
|
|
74
|
+
return (<div ref={wrapperRef} className={`
|
|
75
|
+
no-scrollbar relative w-full rounded-t-[30px]
|
|
76
|
+
${isMobile
|
|
77
|
+
? 'flex h-[calc(100dvh-64px)] flex-col items-center justify-between '
|
|
78
|
+
: 'flex h-[100vh] flex-col items-center justify-between xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ' +
|
|
79
|
+
' xs:max-h-[626px] xs:min-h-[320px] '}
|
|
80
|
+
`}>
|
|
81
|
+
<header className="z-10 flex h-[56px] w-full justify-between rounded-t-[30px] px-[20px]">
|
|
82
|
+
<div className="dr_talk_subtitle_small flex items-center gap-[2px] pt-[31.5px] text-drTalkGrayscale1">
|
|
72
83
|
<TimeIcon width={20} height={20}/>
|
|
73
|
-
<span>24시간
|
|
84
|
+
<span>24시간 운영</span>
|
|
74
85
|
</div>
|
|
75
|
-
<div className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : '
|
|
86
|
+
<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}>
|
|
76
87
|
<CloseSvgIcon width={28} height={28}/>
|
|
77
88
|
</div>
|
|
78
89
|
</header>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
${isMobile ? `h-full max-h-[360px] w-full object-center will-change-transform ` : `w-full object-contain object-top will-change-transform`}`}/>
|
|
90
|
+
|
|
91
|
+
<div className="absolute left-0 top-0 z-0 h-full w-full overflow-hidden">
|
|
92
|
+
<Image src={backgroundImage} alt="대화 배경" fill className={`${isMobile
|
|
93
|
+
? 'h-full max-h-[360px] w-full object-center will-change-transform'
|
|
94
|
+
: 'w-full object-contain object-top will-change-transform'}`}/>
|
|
85
95
|
</div>
|
|
86
96
|
|
|
87
|
-
<div className={`
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<section className={`
|
|
96
|
-
flex flex-col rounded-[12px] bg-white px-[16px] py-[24px]
|
|
97
|
-
${isMobile ? `w-full` : ``}
|
|
98
|
-
`} style={{
|
|
99
|
-
boxShadow: '0px 4px 10px 0px #00000026'
|
|
100
|
-
}}>
|
|
101
|
-
<div className={`relative`}>
|
|
102
|
-
{/* 해당 높이가 먼저 줄어둘고 */}
|
|
103
|
-
<div ref={containerRef} className={`
|
|
104
|
-
no-scrollbar flex max-h-[210px] min-h-[80px] flex-col overflow-auto
|
|
105
|
-
`} style={{
|
|
106
|
-
height: `${clampHeight}px`
|
|
107
|
-
}}>
|
|
108
|
-
<div className={`flex items-center gap-[10px]`}>
|
|
109
|
-
{(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_logo_image_url) ? (<Image src={inquiryMainData.channel_logo_image_url} alt="로고" width={32} height={32} className={''}/>) : (<DaeryunLogoIcon width={24} height={24} className="mr-2"/>)}
|
|
110
|
-
<h1 className={`dr_talk_title_small text-drTalkBlack`}>
|
|
97
|
+
<div className={`relative z-10 px-[20px] ${isMobile ? 'flex w-full justify-center' : 'flex h-full w-full flex-col justify-center'}`}>
|
|
98
|
+
<section className={`flex flex-col rounded-[12px] bg-white px-[16px] py-[24px] ${isMobile ? 'w-full' : ''}`} style={{ boxShadow: '0px 4px 10px 0px #00000026' }}>
|
|
99
|
+
{/* 해당 컴포넌트의 최상위 부모와 브라우저 상단과 닿았을 때 우선적으로 해당 부분의 높이가 먼저 줄어들게 하고 싶다*/}
|
|
100
|
+
<div className="relative">
|
|
101
|
+
<div ref={containerRef} className="no-scrollbar flex max-h-[210px] min-h-[80px] flex-col overflow-auto" style={{ maxHeight: `${contentHeight}px` }}>
|
|
102
|
+
<div className="flex items-center gap-[10px]">
|
|
103
|
+
{(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_logo_image_url) ? (<Image src={inquiryMainData.channel_logo_image_url} alt="로고" width={32} height={32}/>) : (<DaeryunLogoIcon width={24} height={24} className="mr-2"/>)}
|
|
104
|
+
<h1 className="dr_talk_title_small text-drTalkBlack">
|
|
111
105
|
{(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.channel_name) || '법무법인(유한)대륜'}
|
|
112
106
|
</h1>
|
|
113
107
|
</div>
|
|
114
|
-
<div className=
|
|
115
|
-
|
|
116
|
-
{(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.salutation) ||
|
|
108
|
+
<div className="dr_talk_body_medium2 relative ml-[42px] mr-[16px] mt-[16px] whitespace-pre-line">
|
|
109
|
+
{(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.salutation) ||
|
|
117
110
|
`안녕하세요.
|
|
118
111
|
법무법인(유한)대륜입니다.
|
|
119
112
|
방문해 주셔서 감사합니다.\n
|
|
120
113
|
궁금한 점이나 도움이 필요하신 부분
|
|
121
114
|
말씀해 주시면 도와드리겠습니다.
|
|
122
115
|
6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다.
|
|
123
|
-
|
|
124
|
-
</div>
|
|
116
|
+
`}
|
|
125
117
|
</div>
|
|
126
118
|
</div>
|
|
127
119
|
{isScroll && !isBottom && <ShadowBox />}
|
|
128
120
|
</div>
|
|
129
121
|
|
|
130
|
-
<Button3 onClick={handleStartChat} isDisabled={isLoading} className=
|
|
131
|
-
<div className=
|
|
122
|
+
<Button3 onClick={handleStartChat} isDisabled={isLoading} className="mt-[40px]">
|
|
123
|
+
<div className="flex items-center justify-center gap-[4px]">
|
|
132
124
|
<div>{isLoading ? '로딩 중...' : '문의하기'}</div>
|
|
133
125
|
{!isLoading && <SendIcon width={24} height={24}/>}
|
|
134
126
|
</div>
|
|
135
127
|
</Button3>
|
|
136
128
|
|
|
137
|
-
<div className=
|
|
129
|
+
<div className="flex items-center justify-center gap-[4px] pt-[20px]">
|
|
138
130
|
<InfoIcon width={20} height={20}/>
|
|
139
|
-
<span className=
|
|
131
|
+
<span className="dr_talk_body_small1 text-drTalkGrayscale2">
|
|
140
132
|
{(inquiryMainData === null || inquiryMainData === void 0 ? void 0 : inquiryMainData.answer_speed_message) || '빠르게 답변 받으실 수 있어요'}
|
|
141
133
|
</span>
|
|
142
134
|
</div>
|
|
143
135
|
</section>
|
|
144
136
|
</div>
|
|
145
|
-
{isMobile && <div
|
|
137
|
+
{isMobile && <div />}
|
|
146
138
|
</div>);
|
|
147
139
|
};
|
|
148
140
|
export default HomeView;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
4
|
import Image from 'next/image';
|
|
3
5
|
import TimeIcon from '../../asset/images/daeryuntalk/time.svg';
|
|
4
6
|
import DaeryunLogoIcon from '../../asset/images/daeryuntalk/daeryun-logo.svg';
|
|
@@ -6,8 +8,7 @@ import ShadowBox from './_ui/ShadowBox';
|
|
|
6
8
|
import SendIcon from '../../asset/images/daeryuntalk/send.svg';
|
|
7
9
|
import InfoIcon from '../../asset/images/daeryuntalk/info.svg';
|
|
8
10
|
import { IChatInquiryMainDataResponse } from './_api/daeryuntalk/type/response';
|
|
9
|
-
|
|
10
|
-
import DaeryuntalkIntro from '../../asset/images/daeryuntalk/daeryuntalk-intro.png';
|
|
11
|
+
import DaeryuntalkIntro from '../../asset/images/daeryuntalk/daeryuntalk_home_bg.png';
|
|
11
12
|
import DaeryuntalkHomeLogo from '../../asset/images/daeryuntalk/home_bg_logo.png';
|
|
12
13
|
import CloseSvgIcon from '../../asset/images/daeryuntalk/close.svg';
|
|
13
14
|
import { useScrollShadow } from './_hooks/useScrollShadow';
|
|
@@ -21,183 +22,173 @@ interface IHomeViewProps {
|
|
|
21
22
|
onClose: () => void;
|
|
22
23
|
isHash: boolean;
|
|
23
24
|
}
|
|
25
|
+
|
|
24
26
|
const HomeView = ({ inquiryMainData, isLoading, handleStartChat, isMobile, onClose, isHash }: IHomeViewProps) => {
|
|
25
27
|
const { containerRef, isScroll, isBottom, checkScroll } = useScrollShadow<HTMLDivElement>();
|
|
26
28
|
|
|
27
|
-
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
28
|
-
const [
|
|
29
|
-
const
|
|
29
|
+
const wrapperRef = useRef<HTMLDivElement | null>(null);
|
|
30
|
+
const [contentHeight, setContentHeight] = useState(210);
|
|
31
|
+
const currentHeightRef = useRef(210);
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
//
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// 플러스일경우
|
|
41
|
-
else {
|
|
42
|
-
if (wrapperHeight !== 626) {
|
|
43
|
-
setWrapperHeight(626);
|
|
44
|
-
}
|
|
45
|
-
if (clampHeight !== 210) {
|
|
46
|
-
setClampHeight(210);
|
|
47
|
-
}
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const updateContentHeight = () => {
|
|
35
|
+
if (!wrapperRef.current) return;
|
|
36
|
+
|
|
37
|
+
// 모바일이거나 width가 480px 미만이면 contentHeight를 210으로 되돌림
|
|
38
|
+
if (isMobile || window.innerWidth < 480) {
|
|
39
|
+
currentHeightRef.current = 210;
|
|
40
|
+
setContentHeight(210);
|
|
41
|
+
return;
|
|
48
42
|
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
43
|
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
const rect = wrapperRef.current.getBoundingClientRect();
|
|
45
|
+
const gap = rect.top;
|
|
54
46
|
|
|
55
|
-
|
|
56
|
-
if (wrapperRef.current) {
|
|
57
|
-
resizeObserver.observe(wrapperRef.current);
|
|
58
|
-
}
|
|
47
|
+
const currentHeight = currentHeightRef.current;
|
|
59
48
|
|
|
60
|
-
|
|
61
|
-
|
|
49
|
+
// 줄어드는 애니메이션 (2단계)
|
|
50
|
+
if (gap <= 1) {
|
|
51
|
+
if (currentHeight > 140) {
|
|
52
|
+
// 1단계: 210 → 140
|
|
53
|
+
const next = Math.max(140, currentHeight - 6);
|
|
54
|
+
currentHeightRef.current = next;
|
|
55
|
+
setContentHeight(next);
|
|
56
|
+
} else if (currentHeight > 80) {
|
|
57
|
+
// 2단계: 140 → 80
|
|
58
|
+
const next = Math.max(80, currentHeight - 4);
|
|
59
|
+
currentHeightRef.current = next;
|
|
60
|
+
setContentHeight(next);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// 다시 늘어나는 애니메이션 (2단계)
|
|
64
|
+
else if (gap > 1) {
|
|
65
|
+
if (currentHeight < 140) {
|
|
66
|
+
// 1단계: 80 → 140
|
|
67
|
+
const next = Math.min(140, currentHeight + 4);
|
|
68
|
+
currentHeightRef.current = next;
|
|
69
|
+
setContentHeight(next);
|
|
70
|
+
} else if (currentHeight < 210) {
|
|
71
|
+
// 2단계: 140 → 210
|
|
72
|
+
const next = Math.min(210, currentHeight + 6);
|
|
73
|
+
currentHeightRef.current = next;
|
|
74
|
+
setContentHeight(next);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
62
78
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
79
|
+
let rafId: number;
|
|
80
|
+
const loop = () => {
|
|
81
|
+
updateContentHeight();
|
|
82
|
+
rafId = requestAnimationFrame(loop);
|
|
66
83
|
};
|
|
67
|
-
}, []);
|
|
68
84
|
|
|
85
|
+
rafId = requestAnimationFrame(loop);
|
|
86
|
+
|
|
87
|
+
return () => cancelAnimationFrame(rafId);
|
|
88
|
+
}, [isMobile, inquiryMainData]);
|
|
69
89
|
useEffect(() => {
|
|
70
90
|
checkScroll();
|
|
71
91
|
}, [inquiryMainData]);
|
|
72
|
-
// 아직 커버이미지 url이 안나옴
|
|
73
|
-
const backgroundImage = inquiryMainData?.sleeve_image_url ? inquiryMainData.sleeve_image_url : DaeryuntalkIntro;
|
|
74
92
|
|
|
93
|
+
const backgroundImage = inquiryMainData?.sleeve_image_url || DaeryuntalkIntro;
|
|
75
94
|
return (
|
|
76
|
-
// 중간 부분에 min-h-[80px]이 되면 여기서 스크롤이 생겨야함
|
|
77
95
|
<div
|
|
78
96
|
ref={wrapperRef}
|
|
79
97
|
className={`
|
|
80
|
-
relative w-full
|
|
81
|
-
${
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
98
|
+
no-scrollbar relative w-full rounded-t-[30px]
|
|
99
|
+
${
|
|
100
|
+
isMobile
|
|
101
|
+
? 'flex h-[calc(100dvh-64px)] flex-col items-center justify-between '
|
|
102
|
+
: 'flex h-[100vh] flex-col items-center justify-between xs:h-[calc(100vh-165px-64px)] lg:h-[calc(100vh-110px-64px)] ' +
|
|
103
|
+
' xs:max-h-[626px] xs:min-h-[320px] '
|
|
104
|
+
}
|
|
105
|
+
`}
|
|
86
106
|
>
|
|
87
|
-
<header
|
|
88
|
-
className=
|
|
89
|
-
z-10
|
|
90
|
-
flex h-[56px] w-full justify-between px-[20px]
|
|
91
|
-
`}
|
|
92
|
-
>
|
|
93
|
-
<div
|
|
94
|
-
className={`
|
|
95
|
-
dr_talk_subtitle_small flex items-center gap-[2px] pt-[31.5px] text-drTalkGrayscale1
|
|
96
|
-
`}
|
|
97
|
-
>
|
|
107
|
+
<header className="z-10 flex h-[56px] w-full justify-between rounded-t-[30px] px-[20px]">
|
|
108
|
+
<div className="dr_talk_subtitle_small flex items-center gap-[2px] pt-[31.5px] text-drTalkGrayscale1">
|
|
98
109
|
<TimeIcon width={20} height={20} />
|
|
99
|
-
<span>24시간
|
|
110
|
+
<span>24시간 운영</span>
|
|
100
111
|
</div>
|
|
101
112
|
<div
|
|
102
|
-
className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : '
|
|
113
|
+
className={`${isHash ? 'pointer-events-none !opacity-0' : ''} ${isMobile ? 'block' : 'xs:pointer-events-none xs:!opacity-0'} py-[14px] text-drTalkGrayscale2 hover:cursor-pointer`}
|
|
103
114
|
onClick={onClose}
|
|
104
115
|
>
|
|
105
116
|
<CloseSvgIcon width={28} height={28} />
|
|
106
117
|
</div>
|
|
107
118
|
</header>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</div>
|
|
111
|
-
<div className={'absolute left-0 top-0 z-0 h-full w-full overflow-hidden'}>
|
|
119
|
+
|
|
120
|
+
<div className="absolute left-0 top-0 z-0 h-full w-full overflow-hidden">
|
|
112
121
|
<Image
|
|
113
122
|
src={backgroundImage}
|
|
114
123
|
alt="대화 배경"
|
|
115
124
|
fill
|
|
116
|
-
className={
|
|
117
|
-
|
|
125
|
+
className={`${
|
|
126
|
+
isMobile
|
|
127
|
+
? 'h-full max-h-[360px] w-full object-center will-change-transform'
|
|
128
|
+
: 'w-full object-contain object-top will-change-transform'
|
|
129
|
+
}`}
|
|
118
130
|
/>
|
|
119
131
|
</div>
|
|
120
132
|
|
|
121
133
|
<div
|
|
122
|
-
className={`
|
|
123
|
-
relative z-10 px-[20px]
|
|
124
|
-
${
|
|
125
|
-
isMobile
|
|
126
|
-
? `flex w-full justify-center `
|
|
127
|
-
: `
|
|
128
|
-
flex h-full w-full flex-col justify-center
|
|
129
|
-
`
|
|
130
|
-
}
|
|
131
|
-
`}
|
|
134
|
+
className={`relative z-10 px-[20px] ${isMobile ? 'flex w-full justify-center' : 'flex h-full w-full flex-col justify-center'}`}
|
|
132
135
|
>
|
|
133
136
|
<section
|
|
134
|
-
className={`
|
|
135
|
-
|
|
136
|
-
${isMobile ? `w-full` : ``}
|
|
137
|
-
`}
|
|
138
|
-
style={{
|
|
139
|
-
boxShadow: '0px 4px 10px 0px #00000026'
|
|
140
|
-
}}
|
|
137
|
+
className={`flex flex-col rounded-[12px] bg-white px-[16px] py-[24px] ${isMobile ? 'w-full' : ''}`}
|
|
138
|
+
style={{ boxShadow: '0px 4px 10px 0px #00000026' }}
|
|
141
139
|
>
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
{/* 해당 컴포넌트의 최상위 부모와 브라우저 상단과 닿았을 때 우선적으로 해당 부분의 높이가 먼저 줄어들게 하고 싶다*/}
|
|
141
|
+
<div className="relative">
|
|
144
142
|
<div
|
|
145
143
|
ref={containerRef}
|
|
146
|
-
className=
|
|
147
|
-
|
|
148
|
-
`}
|
|
149
|
-
style={{
|
|
150
|
-
height: `${clampHeight}px`
|
|
151
|
-
}}
|
|
144
|
+
className="no-scrollbar flex max-h-[210px] min-h-[80px] flex-col overflow-auto"
|
|
145
|
+
style={{ maxHeight: `${contentHeight}px` }}
|
|
152
146
|
>
|
|
153
|
-
<div className=
|
|
147
|
+
<div className="flex items-center gap-[10px]">
|
|
154
148
|
{inquiryMainData?.channel_logo_image_url ? (
|
|
155
149
|
<Image
|
|
156
150
|
src={inquiryMainData.channel_logo_image_url}
|
|
157
151
|
alt="로고"
|
|
158
152
|
width={32}
|
|
159
153
|
height={32}
|
|
160
|
-
className={''}
|
|
161
154
|
/>
|
|
162
155
|
) : (
|
|
163
156
|
<DaeryunLogoIcon width={24} height={24} className="mr-2" />
|
|
164
157
|
)}
|
|
165
|
-
<h1 className=
|
|
158
|
+
<h1 className="dr_talk_title_small text-drTalkBlack">
|
|
166
159
|
{inquiryMainData?.channel_name || '법무법인(유한)대륜'}
|
|
167
160
|
</h1>
|
|
168
161
|
</div>
|
|
169
|
-
<div className=
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
`안녕하세요.
|
|
162
|
+
<div className="dr_talk_body_medium2 relative ml-[42px] mr-[16px] mt-[16px] whitespace-pre-line">
|
|
163
|
+
{inquiryMainData?.salutation ||
|
|
164
|
+
`안녕하세요.
|
|
173
165
|
법무법인(유한)대륜입니다.
|
|
174
166
|
방문해 주셔서 감사합니다.\n
|
|
175
167
|
궁금한 점이나 도움이 필요하신 부분
|
|
176
168
|
말씀해 주시면 도와드리겠습니다.
|
|
177
169
|
6:00~24:00 외 시간에는 상담인력의 편성에 따라 순차적으로 응대를 도와드리고 있습니다.
|
|
178
|
-
|
|
179
|
-
</div>
|
|
170
|
+
`}
|
|
180
171
|
</div>
|
|
181
172
|
</div>
|
|
182
173
|
{isScroll && !isBottom && <ShadowBox />}
|
|
183
174
|
</div>
|
|
184
175
|
|
|
185
|
-
<Button3 onClick={handleStartChat} isDisabled={isLoading} className=
|
|
186
|
-
<div className=
|
|
176
|
+
<Button3 onClick={handleStartChat} isDisabled={isLoading} className="mt-[40px]">
|
|
177
|
+
<div className="flex items-center justify-center gap-[4px]">
|
|
187
178
|
<div>{isLoading ? '로딩 중...' : '문의하기'}</div>
|
|
188
179
|
{!isLoading && <SendIcon width={24} height={24} />}
|
|
189
180
|
</div>
|
|
190
181
|
</Button3>
|
|
191
182
|
|
|
192
|
-
<div className=
|
|
183
|
+
<div className="flex items-center justify-center gap-[4px] pt-[20px]">
|
|
193
184
|
<InfoIcon width={20} height={20} />
|
|
194
|
-
<span className=
|
|
185
|
+
<span className="dr_talk_body_small1 text-drTalkGrayscale2">
|
|
195
186
|
{inquiryMainData?.answer_speed_message || '빠르게 답변 받으실 수 있어요'}
|
|
196
187
|
</span>
|
|
197
188
|
</div>
|
|
198
189
|
</section>
|
|
199
190
|
</div>
|
|
200
|
-
{isMobile && <div
|
|
191
|
+
{isMobile && <div />}
|
|
201
192
|
</div>
|
|
202
193
|
);
|
|
203
194
|
};
|
|
@@ -5,7 +5,7 @@ const NavigationFooter = ({ activeView, onHomeClick, onHistoryClick, historyList
|
|
|
5
5
|
if (activeView === 'conversation') {
|
|
6
6
|
return null;
|
|
7
7
|
}
|
|
8
|
-
return (<footer>
|
|
8
|
+
return (<footer className={`z-10`}>
|
|
9
9
|
<div className="h-px w-full bg-drTalkGrayscale4" role="separator"></div>
|
|
10
10
|
<nav className={' flex h-[64px] justify-around px-8 pb-[12px] pt-[8px]'}>
|
|
11
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}>
|
|
@@ -22,7 +22,7 @@ const NavigationFooter: React.FC<NavigationFooterProps> = ({
|
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
24
|
return (
|
|
25
|
-
<footer>
|
|
25
|
+
<footer className={`z-10`}>
|
|
26
26
|
<div className="h-px w-full bg-drTalkGrayscale4" role="separator"></div>
|
|
27
27
|
<nav className={' flex h-[64px] justify-around px-8 pb-[12px] pt-[8px]'}>
|
|
28
28
|
<div
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import NoticeIcon from '../../asset/images/daeryuntalk/notice.svg';
|
|
3
3
|
import PrevIcon from '../../asset/images/daeryuntalk/prev.svg';
|
|
4
|
-
const NoticeMessage = ({ content }) => {
|
|
4
|
+
const NoticeMessage = ({ content, isMobile }) => {
|
|
5
5
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
6
|
-
return (<div className=
|
|
6
|
+
return (<div className={`bg-[#F7F7F7]/90 px-[20px] pb-[12px] pt-[8px] backdrop-blur-[4px]`}>
|
|
7
7
|
<div className="flex items-start gap-[8px]">
|
|
8
8
|
<div className="flex-shrink-0">
|
|
9
9
|
<NoticeIcon width={24} height={24}/>
|
|
@@ -5,13 +5,14 @@ import PrevIcon from '../../asset/images/daeryuntalk/prev.svg';
|
|
|
5
5
|
|
|
6
6
|
type NoticeMessageProps = {
|
|
7
7
|
content: string;
|
|
8
|
+
isMobile: boolean;
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
const NoticeMessage: React.FC<NoticeMessageProps> = ({ content }) => {
|
|
11
|
+
const NoticeMessage: React.FC<NoticeMessageProps> = ({ content, isMobile }) => {
|
|
11
12
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
12
13
|
|
|
13
14
|
return (
|
|
14
|
-
<div className=
|
|
15
|
+
<div className={`bg-[#F7F7F7]/90 px-[20px] pb-[12px] pt-[8px] backdrop-blur-[4px]`}>
|
|
15
16
|
<div className="flex items-start gap-[8px]">
|
|
16
17
|
<div className="flex-shrink-0">
|
|
17
18
|
<NoticeIcon width={24} height={24} />
|
|
@@ -12,6 +12,7 @@ interface TiptapProps {
|
|
|
12
12
|
placeholder?: string;
|
|
13
13
|
onEnterKeyPress?: () => void;
|
|
14
14
|
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
15
|
+
contentClassName?: string;
|
|
15
16
|
}
|
|
16
17
|
declare const Tiptap: import("react").ForwardRefExoticComponent<TiptapProps & import("react").RefAttributes<TiptapEditorRef>>;
|
|
17
18
|
export default Tiptap;
|
|
@@ -5,7 +5,7 @@ import HardBreak from '@tiptap/extension-hard-break'; // 추가
|
|
|
5
5
|
import Document from '@tiptap/extension-document';
|
|
6
6
|
import Paragraph from '@tiptap/extension-paragraph';
|
|
7
7
|
import Text from '@tiptap/extension-text';
|
|
8
|
-
const Tiptap = forwardRef(({ onChange, placeholder = '메시지를 입력하세요...', onEnterKeyPress, onKeyDown }, ref) => {
|
|
8
|
+
const Tiptap = forwardRef(({ onChange, placeholder = '메시지를 입력하세요...', onEnterKeyPress, onKeyDown, contentClassName = '' }, ref) => {
|
|
9
9
|
const editor = useEditor({
|
|
10
10
|
extensions: [
|
|
11
11
|
Document,
|
|
@@ -36,7 +36,7 @@ const Tiptap = forwardRef(({ onChange, placeholder = '메시지를 입력하세
|
|
|
36
36
|
},
|
|
37
37
|
editorProps: {
|
|
38
38
|
attributes: {
|
|
39
|
-
class:
|
|
39
|
+
class: `dr_talk_body_medium2 focus:outline-none min-h-[36px] max-h-[72px] overflow-y-auto resize-none pt-[6px] pb-[4px] break-words whitespace-pre-wrap word-wrap break-word overflow-wrap-anywhere no-scrollbar `
|
|
40
40
|
},
|
|
41
41
|
handleKeyDown: (view, event) => {
|
|
42
42
|
if (event.key === 'Enter') {
|
|
@@ -91,7 +91,7 @@ const Tiptap = forwardRef(({ onChange, placeholder = '메시지를 입력하세
|
|
|
91
91
|
if (!editor)
|
|
92
92
|
return null;
|
|
93
93
|
// return <EditorContent editor={editor} tabIndex={0} className="rounded-md border text-black dark:text-white" />;
|
|
94
|
-
return (<EditorContent editor={editor} tabIndex={0} className=
|
|
94
|
+
return (<EditorContent editor={editor} tabIndex={0} className={`${contentClassName} w-full overflow-hidden rounded-md border text-black dark:text-white`}/>);
|
|
95
95
|
});
|
|
96
96
|
Tiptap.displayName = 'Tiptap';
|
|
97
97
|
export default Tiptap;
|