@daeryun/dr_components 1.1.27 → 1.1.29

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.
@@ -0,0 +1,265 @@
1
+ 'use client';
2
+
3
+ import React from 'react';
4
+
5
+ // 스토리북용 전역 타입 선언
6
+ declare global {
7
+ interface Window {
8
+ next?: {
9
+ router?: any;
10
+ };
11
+ }
12
+ }
13
+ import Link from 'next/link';
14
+ import PageWrapper from '../../Layout/PageWrapper';
15
+ import SearchBar from '../../SearchBar/SearchBar';
16
+ // 공지사항 데이터 타입 정의
17
+ interface INoticeTypes {
18
+ id: number;
19
+ title: string;
20
+ summary: string;
21
+ code_name: string;
22
+ top_count?: number;
23
+ timestamp?: string;
24
+ }
25
+ import Pagination from '../../Pagination/Pagination';
26
+
27
+ interface ISearchBarProps {
28
+ handleInputChange: (e: React.FormEvent<HTMLInputElement>) => void;
29
+ handleSearch: () => void;
30
+ searchInput: string;
31
+ }
32
+ interface IPaginationProps {
33
+ onPaginationChange: (pageNum: number) => void;
34
+ currentPage: number;
35
+ totalCount: number;
36
+ }
37
+
38
+ interface NoticeListProps {
39
+ SearchBarProps: ISearchBarProps;
40
+ PaginationProps: IPaginationProps;
41
+ noticeName: {
42
+ code: string;
43
+ code_name: string | null;
44
+ [key: string]: any;
45
+ }[];
46
+ noticeList: INoticeTypes[];
47
+ currentCodeDesc?: string;
48
+ isUseHeaderComponent?: boolean;
49
+ nameFilter: { code_name: string; code: string };
50
+ search: string;
51
+ indexOfFirstPost: number;
52
+ indexOfLastPost: number;
53
+ postPerPage: number;
54
+ currentPage: number;
55
+ router: any;
56
+ }
57
+
58
+ const NoticeList = ({
59
+ SearchBarProps,
60
+ PaginationProps,
61
+ noticeName,
62
+ noticeList,
63
+ currentCodeDesc,
64
+ isUseHeaderComponent,
65
+ nameFilter,
66
+ search,
67
+ indexOfFirstPost,
68
+ indexOfLastPost,
69
+ postPerPage,
70
+ currentPage,
71
+ router
72
+ }: NoticeListProps) => {
73
+ return (
74
+ <>
75
+ <PageWrapper>
76
+ <SearchBar
77
+ label={'검색어를 입력해주세요.'}
78
+ onChange={SearchBarProps.handleInputChange}
79
+ onClick={SearchBarProps.handleSearch}
80
+ search={SearchBarProps.searchInput}
81
+ placeholder={'검색어를 입력해주세요.'}
82
+ isKeyPress={true}
83
+ marginTop={[70, 50, 50]}
84
+ />
85
+ <div
86
+ className={
87
+ 'mb-10 flex w-full cursor-pointer border-[1px] border-solid border-[#DBDBDB] text-center '
88
+ }
89
+ >
90
+ <div
91
+ tabIndex={0}
92
+ className={`${
93
+ nameFilter.code_name === '전체'
94
+ ? 'bg-[#285FA7] text-[#fff]'
95
+ : "after:absolute after:right-[-1px] after:z-[-1] after:h-[45%] after:w-[1px] after:bg-[#DBDBDB] after:content-['']"
96
+ } relative w-[20%] py-3 text-[13px] 2xs:text-[16px] xs:py-4 sm:text-[22px]`}
97
+ onClick={() => {
98
+ router.push({
99
+ pathname: '/notice',
100
+ query: search
101
+ ? { page: 1, search: search, nameFilter: '전체' }
102
+ : { page: 1, nameFilter: '전체' }
103
+ });
104
+ }}
105
+ onKeyDown={(e: any) => {
106
+ if (e.key === 'Enter') {
107
+ router.push({
108
+ pathname: '/notice',
109
+ query: search
110
+ ? { page: 1, search: search, nameFilter: '전체' }
111
+ : { page: 1, nameFilter: '전체' }
112
+ });
113
+ }
114
+ }}
115
+ >
116
+ 전체
117
+ </div>
118
+ {noticeName.map((item: any, index: number) => (
119
+ <div
120
+ tabIndex={0}
121
+ key={index}
122
+ className={`${
123
+ nameFilter.code_name === item.code_name
124
+ ? 'bg-[#285FA7] text-[#fff] '
125
+ : "after:absolute after:right-[-1px] after:z-[-1] after:h-[45%] after:w-[1px] after:bg-[#DBDBDB] after:content-['']"
126
+ } relative w-[20%] py-3 text-[13px] 2xs:text-[16px] xs:py-4 sm:text-[22px]`}
127
+ onClick={() => {
128
+ router.push({
129
+ pathname: '/notice',
130
+ query: search
131
+ ? { page: 1, search: search, nameFilter: item.code_name }
132
+ : { page: 1, nameFilter: item.code_name }
133
+ });
134
+ }}
135
+ onKeyDown={(e: any) => {
136
+ if (e.key === 'Enter') {
137
+ router.push({
138
+ pathname: '/notice',
139
+ query: search
140
+ ? { page: 1, search: search, nameFilter: item.code_name }
141
+ : { page: 1, nameFilter: item.code_name }
142
+ });
143
+ }
144
+ }}
145
+ >
146
+ {item.code_name}
147
+ </div>
148
+ ))}
149
+ </div>
150
+ <div className={'m-auto h-[100%] '}>
151
+ <table className={'w-[100%] table-fixed border-t-[2px] border-solid border-[#999] text-[12px]'}>
152
+ <colgroup className={''}>
153
+ <col className={'sm:w-[10%]'} />
154
+ <col width="55" className={'w-[75%] max-xs:w-[70%]'} />
155
+ {/* <col className={'w-[15%] max-xs:w-[20%]'} /> */}
156
+ </colgroup>
157
+
158
+ <thead>
159
+ <tr className={'border-t-[3px] border-solid border-[#515151] bg-[#FAFAFA]'}>
160
+ <th
161
+ scope="col"
162
+ className={
163
+ 'border-b-[1px] border-solid border-[#d2d2d2] py-[15px] text-[16px] font-[800] max-sm:text-xs'
164
+ }
165
+ >
166
+ No
167
+ </th>
168
+ <th
169
+ scope="col"
170
+ className={
171
+ 'border-b-[1px] border-solid border-[#d2d2d2] py-[15px] text-[16px] font-[800] max-sm:text-xs'
172
+ }
173
+ >
174
+ 제목
175
+ </th>
176
+ {/* <th
177
+ scope="col"
178
+ className={
179
+ 'py-[15px] border-b-[1px] border-[#d2d2d2] border-solid text-[16px] font-[800] max-sm:text-xs'
180
+ }
181
+ >
182
+ 작성일
183
+ </th> */}
184
+ </tr>
185
+ </thead>
186
+
187
+ <tbody>
188
+ {noticeList.length > 0 && noticeList.slice(indexOfFirstPost, indexOfLastPost).length > 0 ? (
189
+ noticeList.slice(indexOfFirstPost, indexOfLastPost).map((item: any, index: number) => (
190
+ <tr key={item.id} className={''}>
191
+ <td
192
+ className={
193
+ 'border-b-[1px] border-solid border-[#d2d2d2] py-[15px] text-center sm:text-[16px]'
194
+ }
195
+ >
196
+ {noticeList.length -
197
+ (index + 1 + currentPage * postPerPage) +
198
+ postPerPage +
199
+ 1}
200
+ </td>
201
+ <td
202
+ className={
203
+ 'border-b-[1px] border-solid border-[#d2d2d2] py-[15px] sm:text-[16px]'
204
+ }
205
+ >
206
+ <Link href={'/notice/' + item.id}>
207
+ <div>
208
+ <div className={'truncate'}>{item.title}</div>
209
+ </div>
210
+ </Link>
211
+ </td>
212
+ {/* <td
213
+ className={
214
+ 'text-center py-[15px] border-b-[1px] border-[#d2d2d2] border-solid sm:text-[16px] tracking-[-1px]'
215
+ }
216
+ >
217
+ {item.timestamp}
218
+ </td> */}
219
+ </tr>
220
+ ))
221
+ ) : noticeList.length < 1 ? (
222
+ <tr>
223
+ <td
224
+ colSpan={2}
225
+ className={
226
+ 'border-b-[1px] border-[#d2d2d2] py-[15px] ' +
227
+ 'order-solid text-[16px] font-[400]'
228
+ }
229
+ >
230
+ <div className={'text-center'}>
231
+ <p>검색 결과가 없습니다.</p>
232
+ </div>
233
+ </td>
234
+ </tr>
235
+ ) : (
236
+ <tr>
237
+ <td
238
+ colSpan={2}
239
+ className={
240
+ 'border-b-[1px] border-solid border-[#d2d2d2] py-[15px] text-[16px] font-[400]'
241
+ }
242
+ >
243
+ <div className={'text-center'}>
244
+ <p>정보 조회 중입니다.</p>
245
+ </div>
246
+ </td>
247
+ </tr>
248
+ )}
249
+ </tbody>
250
+ </table>
251
+ {noticeList && noticeList.length > 0 ? (
252
+ <Pagination
253
+ currentPage={PaginationProps.currentPage}
254
+ onPageChange={PaginationProps.onPaginationChange}
255
+ totalPages={Math.ceil(PaginationProps.totalCount / 9)}
256
+ />
257
+ ) : (
258
+ <></>
259
+ )}
260
+ </div>
261
+ </PageWrapper>
262
+ </>
263
+ );
264
+ };
265
+ export default NoticeList;
@@ -123,8 +123,10 @@ const RightTextItem = ({ item, consult_step, index }) => {
123
123
  </div>
124
124
  <ul className="flex flex-col text-[18px] leading-[1.8] max-xl:gap-[3px] max-xl:text-[16px] max-xl:leading-[1.4]">
125
125
  {li.list.slice(1, -1).map((l, l_index) => {
126
- return (<li key={l_index} className={'flex gap-[13px] max-xl:gap-[10px]'}>
127
- <span>•</span>
126
+ return (<li key={l_index} className={'flex gap-[13px] max-xl:gap-[10px] ' +
127
+ (l_index === 1 ? 'mb-4' : '')}>
128
+ {l_index % 2 === 0 ? (<span>•</span>) : (<span className={'pl-5 max-xl:pl-4'}>→</span>)}
129
+
128
130
  {l}
129
131
  </li>);
130
132
  })}
@@ -258,9 +258,17 @@ const RightTextItem = ({
258
258
  return (
259
259
  <li
260
260
  key={l_index}
261
- className={'flex gap-[13px] max-xl:gap-[10px]'}
261
+ className={
262
+ 'flex gap-[13px] max-xl:gap-[10px] ' +
263
+ (l_index === 1 ? 'mb-4' : '')
264
+ }
262
265
  >
263
- <span>•</span>
266
+ {l_index % 2 === 0 ? (
267
+ <span>•</span>
268
+ ) : (
269
+ <span className={'pl-5 max-xl:pl-4'}>→</span>
270
+ )}
271
+
264
272
  {l}
265
273
  </li>
266
274
  );
@@ -15,6 +15,7 @@ export { default as logout } from './Login/_api/logout';
15
15
  export { default as goToAIDaeryun } from './Login/_lib/goToAIDaeryun';
16
16
  export { default as FaqList } from './Faq/FaqList';
17
17
  export { default as FaqDetail } from './Faq/Detail/FaqDetail';
18
+ export { default as NoticeList } from './Notice/NoticeList';
18
19
  export { default as ConsultComplete } from './ConsultComplete/ConsultComplete';
19
20
  export { default as Lawfirm } from './Lawfirm/Lawfirm';
20
21
  export { default as StrengthNew } from './StrengthNew/StrengthNew';
@@ -17,6 +17,7 @@ export { default as logout } from './Login/_api/logout';
17
17
  export { default as goToAIDaeryun } from './Login/_lib/goToAIDaeryun';
18
18
  export { default as FaqList } from './Faq/FaqList';
19
19
  export { default as FaqDetail } from './Faq/Detail/FaqDetail';
20
+ export { default as NoticeList } from './Notice/NoticeList';
20
21
  export { default as ConsultComplete } from './ConsultComplete/ConsultComplete';
21
22
  export { default as Lawfirm } from './Lawfirm/Lawfirm';
22
23
  export { default as StrengthNew } from './StrengthNew/StrengthNew';
@@ -17,6 +17,7 @@ export { default as logout } from './Login/_api/logout';
17
17
  export { default as goToAIDaeryun } from './Login/_lib/goToAIDaeryun';
18
18
  export { default as FaqList } from './Faq/FaqList';
19
19
  export { default as FaqDetail } from './Faq/Detail/FaqDetail';
20
+ export { default as NoticeList } from './Notice/NoticeList';
20
21
  export { default as ConsultComplete } from './ConsultComplete/ConsultComplete';
21
22
  export { default as Lawfirm } from './Lawfirm/Lawfirm';
22
23
  export { default as StrengthNew } from './StrengthNew/StrengthNew';