@daeryun/dr_components 1.1.54 → 1.1.56
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/components/Daeryuntalk/ChatInput.jsx +1 -1
- package/dist/components/Daeryuntalk/ChatInput.tsx +1 -1
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.jsx +1 -1
- package/dist/components/Daeryuntalk/Tiptap/Tiptap.tsx +1 -1
- package/dist/components/page/Notice/NoticeList.jsx +29 -24
- package/dist/components/page/Notice/NoticeList.tsx +35 -24
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ const ChatInput = ({ isMobile, isNotAgeCheck, chatInquiryNumber }) => {
|
|
|
39
39
|
{/* 최초 높이 44 */}
|
|
40
40
|
{/*내용이 2줄 이상되면 입력창 높이도 키워져야합니다. 최대한 4줄까지만 보이도록 해주시고, 그 이상은 스크롤 될 수 있도록 해주시는 게 좋을 것 같습니다. max height 값을 72로 지정 부탁드립니다*/}
|
|
41
41
|
|
|
42
|
-
{isNotAgeCheck ? (<DisabledInput placeholder="만 14세 이상 확인 후 이용 가능합니다."/>) : (<Tiptap key={`${chatInquiryNumber}-${isNotAgeCheck}`} ref={tiptapRef} onChange={setMessage} onEnterKeyPress={handleEnter} placeholder={'
|
|
42
|
+
{isNotAgeCheck ? (<DisabledInput placeholder="만 14세 이상 확인 후 이용 가능합니다."/>) : (<Tiptap key={`${chatInquiryNumber}-${isNotAgeCheck}`} ref={tiptapRef} onChange={setMessage} onEnterKeyPress={handleEnter} placeholder={'상담내용을 입력해 주세요.'} contentClassName="!outline-none !border-[0px] !pt-[4px] !pl-[4px]" isMobile={isMobile}/>)}
|
|
43
43
|
|
|
44
44
|
<div className={`flex flex-col justify-end`}>
|
|
45
45
|
<button type="submit" className={`flex h-10 w-10 items-center justify-center rounded-[8px] bg-drTalkBtnActive2 text-white
|
|
@@ -59,7 +59,7 @@ const ChatInput: React.FC<props> = ({ isMobile, isNotAgeCheck, chatInquiryNumber
|
|
|
59
59
|
ref={tiptapRef}
|
|
60
60
|
onChange={setMessage}
|
|
61
61
|
onEnterKeyPress={handleEnter}
|
|
62
|
-
placeholder={'
|
|
62
|
+
placeholder={'상담내용을 입력해 주세요.'}
|
|
63
63
|
contentClassName="!outline-none !border-[0px] !pt-[4px] !pl-[4px]"
|
|
64
64
|
isMobile={isMobile}
|
|
65
65
|
/>
|
|
@@ -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 = '
|
|
8
|
+
const Tiptap = forwardRef(({ onChange, placeholder = '상담내용을 입력해 주세요.', onEnterKeyPress, onKeyDown, contentClassName = '', isMobile = false }, ref) => {
|
|
9
9
|
const containerRef = useRef(null);
|
|
10
10
|
const [isScroll, setIsScroll] = useState(false);
|
|
11
11
|
const [isBottom, setIsBottom] = useState(false);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import React, { useState, useEffect } from 'react';
|
|
3
|
-
import { useRouter } from 'next/
|
|
3
|
+
import { useRouter } from 'next/navigation';
|
|
4
4
|
import Link from 'next/link';
|
|
5
5
|
import SearchBar from '../../SearchBar/SearchBar';
|
|
6
6
|
import PageTitleBox from '../../PageTitleBox/PageTitleBox';
|
|
@@ -25,8 +25,9 @@ const NoticeList = ({ noticeList = [], noticeName = [] }) => {
|
|
|
25
25
|
// 검색 및 필터링 로직
|
|
26
26
|
useEffect(() => {
|
|
27
27
|
var _a;
|
|
28
|
-
const
|
|
29
|
-
const
|
|
28
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
29
|
+
const searchTxt = String(urlParams.get('search') || '').toLowerCase();
|
|
30
|
+
const searchFilter = String(urlParams.get('nameFilter') || '');
|
|
30
31
|
let searchResultList = [];
|
|
31
32
|
if (!searchFilter || searchFilter === '전체') {
|
|
32
33
|
searchResultList = (noticeList || []).filter((item) => { var _a, _b; return ((_a = item.title) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTxt)) || ((_b = item.summary) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchTxt)); });
|
|
@@ -42,41 +43,45 @@ const NoticeList = ({ noticeList = [], noticeName = [] }) => {
|
|
|
42
43
|
setTotal(searchResultList.length);
|
|
43
44
|
setSearch(searchTxt || '');
|
|
44
45
|
setSearchInput(searchTxt || '');
|
|
45
|
-
setCurrentPage(Number(
|
|
46
|
-
}, [
|
|
46
|
+
setCurrentPage(Number(urlParams.get('page')) || 1);
|
|
47
|
+
}, [noticeList, noticeName]);
|
|
47
48
|
// 핸들러 함수들
|
|
48
49
|
const handleInputChange = (e) => {
|
|
49
50
|
setSearchInput(e.currentTarget.value);
|
|
50
51
|
};
|
|
51
52
|
const handleSearch = () => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
const params = new URLSearchParams();
|
|
54
|
+
params.set('page', '1');
|
|
55
|
+
if (searchInput) {
|
|
56
|
+
params.set('search', searchInput);
|
|
57
|
+
}
|
|
58
|
+
if (nameFilter.code_name && nameFilter.code_name !== '전체') {
|
|
59
|
+
params.set('nameFilter', nameFilter.code_name);
|
|
60
|
+
}
|
|
61
|
+
router.push(`/notice?${params.toString()}`);
|
|
58
62
|
setSearch(searchInput);
|
|
59
63
|
};
|
|
60
64
|
const handlePaginationChange = (pageNum) => {
|
|
61
|
-
const
|
|
65
|
+
const params = new URLSearchParams();
|
|
66
|
+
params.set('page', pageNum.toString());
|
|
62
67
|
if (search) {
|
|
63
|
-
|
|
68
|
+
params.set('search', search);
|
|
64
69
|
}
|
|
65
70
|
if (nameFilter.code_name && nameFilter.code_name !== '전체') {
|
|
66
|
-
|
|
71
|
+
params.set('nameFilter', nameFilter.code_name);
|
|
67
72
|
}
|
|
68
|
-
router.push({
|
|
69
|
-
pathname: '/notice',
|
|
70
|
-
query: queryParams
|
|
71
|
-
});
|
|
73
|
+
router.push(`/notice?${params.toString()}`);
|
|
72
74
|
};
|
|
73
75
|
const handleCategoryClick = (categoryName) => {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
const params = new URLSearchParams();
|
|
77
|
+
params.set('page', '1');
|
|
78
|
+
if (search) {
|
|
79
|
+
params.set('search', search);
|
|
80
|
+
}
|
|
81
|
+
if (categoryName && categoryName !== '전체') {
|
|
82
|
+
params.set('nameFilter', categoryName);
|
|
83
|
+
}
|
|
84
|
+
router.push(`/notice?${params.toString()}`);
|
|
80
85
|
};
|
|
81
86
|
return (<>
|
|
82
87
|
<PageTitleBox titleTxt={'공지사항'} subTxt={<>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import React, { useState, useEffect } from 'react';
|
|
4
|
-
import { useRouter } from 'next/
|
|
4
|
+
import { useRouter } from 'next/navigation';
|
|
5
5
|
|
|
6
6
|
// 스토리북용 전역 타입 선언
|
|
7
7
|
declare global {
|
|
@@ -60,8 +60,9 @@ const NoticeList = ({ noticeList = [], noticeName = [] }: NoticeListProps) => {
|
|
|
60
60
|
|
|
61
61
|
// 검색 및 필터링 로직
|
|
62
62
|
useEffect(() => {
|
|
63
|
-
const
|
|
64
|
-
const
|
|
63
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
64
|
+
const searchTxt = String(urlParams.get('search') || '').toLowerCase();
|
|
65
|
+
const searchFilter = String(urlParams.get('nameFilter') || '');
|
|
65
66
|
|
|
66
67
|
let searchResultList = [];
|
|
67
68
|
|
|
@@ -85,8 +86,8 @@ const NoticeList = ({ noticeList = [], noticeName = [] }: NoticeListProps) => {
|
|
|
85
86
|
setTotal(searchResultList.length);
|
|
86
87
|
setSearch(searchTxt || '');
|
|
87
88
|
setSearchInput(searchTxt || '');
|
|
88
|
-
setCurrentPage(Number(
|
|
89
|
-
}, [
|
|
89
|
+
setCurrentPage(Number(urlParams.get('page')) || 1);
|
|
90
|
+
}, [noticeList, noticeName]);
|
|
90
91
|
|
|
91
92
|
// 핸들러 함수들
|
|
92
93
|
const handleInputChange = (e: React.FormEvent<HTMLInputElement>) => {
|
|
@@ -94,39 +95,49 @@ const NoticeList = ({ noticeList = [], noticeName = [] }: NoticeListProps) => {
|
|
|
94
95
|
};
|
|
95
96
|
|
|
96
97
|
const handleSearch = () => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
98
|
+
const params = new URLSearchParams();
|
|
99
|
+
params.set('page', '1');
|
|
100
|
+
|
|
101
|
+
if (searchInput) {
|
|
102
|
+
params.set('search', searchInput);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (nameFilter.code_name && nameFilter.code_name !== '전체') {
|
|
106
|
+
params.set('nameFilter', nameFilter.code_name);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
router.push(`/notice?${params.toString()}`);
|
|
103
110
|
setSearch(searchInput);
|
|
104
111
|
};
|
|
105
112
|
|
|
106
113
|
const handlePaginationChange = (pageNum: number) => {
|
|
107
|
-
const
|
|
114
|
+
const params = new URLSearchParams();
|
|
115
|
+
params.set('page', pageNum.toString());
|
|
108
116
|
|
|
109
117
|
if (search) {
|
|
110
|
-
|
|
118
|
+
params.set('search', search);
|
|
111
119
|
}
|
|
112
120
|
|
|
113
121
|
if (nameFilter.code_name && nameFilter.code_name !== '전체') {
|
|
114
|
-
|
|
122
|
+
params.set('nameFilter', nameFilter.code_name);
|
|
115
123
|
}
|
|
116
124
|
|
|
117
|
-
router.push({
|
|
118
|
-
pathname: '/notice',
|
|
119
|
-
query: queryParams
|
|
120
|
-
});
|
|
125
|
+
router.push(`/notice?${params.toString()}`);
|
|
121
126
|
};
|
|
122
127
|
|
|
123
128
|
const handleCategoryClick = (categoryName: string) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
129
|
+
const params = new URLSearchParams();
|
|
130
|
+
params.set('page', '1');
|
|
131
|
+
|
|
132
|
+
if (search) {
|
|
133
|
+
params.set('search', search);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (categoryName && categoryName !== '전체') {
|
|
137
|
+
params.set('nameFilter', categoryName);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
router.push(`/notice?${params.toString()}`);
|
|
130
141
|
};
|
|
131
142
|
|
|
132
143
|
return (
|