@daeryun/dr_components 1.1.26 → 1.1.28
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/board/calendar.webp +0 -0
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/components/index.js +1 -0
- package/dist/components/index.ts +1 -0
- package/dist/components/page/Broadcast/BroadcastDetail.d.ts +30 -0
- package/dist/components/page/Broadcast/BroadcastDetail.jsx +114 -0
- package/dist/components/page/Broadcast/BroadcastDetail.stories.d.ts +6 -0
- package/dist/components/page/Broadcast/BroadcastDetail.stories.jsx +40 -0
- package/dist/components/page/Broadcast/BroadcastDetail.stories.tsx +50 -0
- package/dist/components/page/Broadcast/BroadcastDetail.tsx +240 -0
- package/dist/components/page/Broadcast/BroadcastList.d.ts +17 -0
- package/dist/components/page/Broadcast/BroadcastList.jsx +91 -0
- package/dist/components/page/Broadcast/BroadcastList.stories.d.ts +6 -0
- package/dist/components/page/Broadcast/BroadcastList.stories.jsx +105 -0
- package/dist/components/page/Broadcast/BroadcastList.stories.tsx +123 -0
- package/dist/components/page/Broadcast/BroadcastList.tsx +187 -0
- package/dist/components/page/Notice/NoticeList.d.ts +50 -0
- package/dist/components/page/Notice/NoticeList.jsx +125 -0
- package/dist/components/page/Notice/NoticeList.stories.d.ts +9 -0
- package/dist/components/page/Notice/NoticeList.stories.jsx +259 -0
- package/dist/components/page/Notice/NoticeList.stories.tsx +277 -0
- package/dist/components/page/Notice/NoticeList.tsx +265 -0
- package/dist/components/page/index.d.ts +3 -0
- package/dist/components/page/index.js +3 -0
- package/dist/components/page/index.ts +3 -0
- package/dist/components/postNavigation/PostNavigation.d.ts +23 -0
- package/dist/components/postNavigation/PostNavigation.jsx +31 -0
- package/dist/components/postNavigation/PostNavigation.tsx +94 -0
- package/dist/styles/globals.css +678 -386
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -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;
|
|
@@ -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';
|
|
@@ -24,3 +25,5 @@ export { default as StrengthPeople } from './StrengthNew/StrengthPeople';
|
|
|
24
25
|
export { default as StrengthSystem } from './StrengthNew/StrengthSystem';
|
|
25
26
|
export { default as DaeryunGreeting } from './DaeryunGreeting/DaeryunGreeting';
|
|
26
27
|
export { default as MapPage } from './MapPage/MapPage';
|
|
28
|
+
export { default as BroadcastList } from './Broadcast/BroadcastList';
|
|
29
|
+
export { default as BroadcastDetail } from './Broadcast/BroadcastDetail';
|
|
@@ -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';
|
|
@@ -26,3 +27,5 @@ export { default as StrengthPeople } from './StrengthNew/StrengthPeople';
|
|
|
26
27
|
export { default as StrengthSystem } from './StrengthNew/StrengthSystem';
|
|
27
28
|
export { default as DaeryunGreeting } from './DaeryunGreeting/DaeryunGreeting';
|
|
28
29
|
export { default as MapPage } from './MapPage/MapPage';
|
|
30
|
+
export { default as BroadcastList } from './Broadcast/BroadcastList';
|
|
31
|
+
export { default as BroadcastDetail } from './Broadcast/BroadcastDetail';
|
|
@@ -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';
|
|
@@ -26,3 +27,5 @@ export { default as StrengthPeople } from './StrengthNew/StrengthPeople';
|
|
|
26
27
|
export { default as StrengthSystem } from './StrengthNew/StrengthSystem';
|
|
27
28
|
export { default as DaeryunGreeting } from './DaeryunGreeting/DaeryunGreeting';
|
|
28
29
|
export { default as MapPage } from './MapPage/MapPage';
|
|
30
|
+
export { default as BroadcastList } from './Broadcast/BroadcastList';
|
|
31
|
+
export { default as BroadcastDetail } from './Broadcast/BroadcastDetail';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IPostNav {
|
|
3
|
+
created_at?: string;
|
|
4
|
+
idx?: number;
|
|
5
|
+
is_template?: boolean;
|
|
6
|
+
keyword?: string;
|
|
7
|
+
next_idx: number;
|
|
8
|
+
next_template?: boolean;
|
|
9
|
+
next_title: string;
|
|
10
|
+
pre_idx: number;
|
|
11
|
+
pre_template?: boolean;
|
|
12
|
+
pre_title: string;
|
|
13
|
+
}
|
|
14
|
+
interface PostNavigationProps {
|
|
15
|
+
url: string;
|
|
16
|
+
postNav: IPostNav;
|
|
17
|
+
preTxt: string;
|
|
18
|
+
nextTxt: string;
|
|
19
|
+
listTxt: string;
|
|
20
|
+
queryStr?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const PostNavigation: ({ url, postNav, preTxt, nextTxt, listTxt, queryStr }: PostNavigationProps) => React.JSX.Element;
|
|
23
|
+
export default PostNavigation;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
const PostNavigation = ({ url, postNav, preTxt, nextTxt, listTxt, queryStr = '' }) => {
|
|
5
|
+
return (<div className={'flex w-full items-center justify-between max-md:flex-col'}>
|
|
6
|
+
{postNav.pre_idx ? (<Link href={`${url}${postNav.pre_template ? '_template/' : '/'}` + postNav.pre_idx} className={'mb-6 flex w-full flex-col gap-[8px] md:mb-0 md:w-auto md:flex-row md:gap-[20px] lg:w-auto lg2:gap-[28px]'} aria-label={'이전글 ' + postNav.pre_title}>
|
|
7
|
+
<Image src={'/images/youtube/left.webp'} alt={''} width={15} height={15} className={'m-auto hidden md:block'}/>
|
|
8
|
+
<p className={'text-[#285FA7]'}>{preTxt}</p>
|
|
9
|
+
<div>
|
|
10
|
+
<p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>{postNav.pre_title}</p>
|
|
11
|
+
</div>
|
|
12
|
+
</Link>) : (<div className={'flex w-[30%] gap-[28px]'}></div>)}
|
|
13
|
+
|
|
14
|
+
{postNav.next_idx ? (<>
|
|
15
|
+
<Link href={`${url}${postNav.pre_template ? '_template/' : '/'}` + postNav.next_idx} className={'flex w-full flex-col justify-end gap-[8px] md:order-last md:w-auto md:flex-row md:gap-[20px] lg:w-auto lg2:gap-[28px]'} aria-label={'다음글 ' + postNav.next_title}>
|
|
16
|
+
<p className={'text-[#285FA7]'}>{nextTxt}</p>
|
|
17
|
+
<div aria-label={'다음글 ' + postNav.next_title}>
|
|
18
|
+
<p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>{postNav.next_title}</p>
|
|
19
|
+
</div>
|
|
20
|
+
<Image src={'/images/youtube/right.webp'} alt={''} width={15} height={15} className={'m-auto hidden md:block'}/>
|
|
21
|
+
</Link>
|
|
22
|
+
</>) : (<div className={'order-last flex w-[30%] gap-[28px]'}></div>)}
|
|
23
|
+
|
|
24
|
+
<Link href={`${url}${queryStr}`} className={'max-md:mt-[40px]'}>
|
|
25
|
+
<div className={'rounded-[30px] border-[1px] border-solid border-[#b0b0b0] bg-[#41464C] px-[32px] py-[10px] text-[#fff] lg2:px-[70px] lg2:py-[15px] '}>
|
|
26
|
+
{listTxt}
|
|
27
|
+
</div>
|
|
28
|
+
</Link>
|
|
29
|
+
</div>);
|
|
30
|
+
};
|
|
31
|
+
export default PostNavigation;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
interface IPostNav {
|
|
6
|
+
created_at?: string;
|
|
7
|
+
idx?: number;
|
|
8
|
+
is_template?: boolean;
|
|
9
|
+
keyword?: string;
|
|
10
|
+
|
|
11
|
+
next_idx: number;
|
|
12
|
+
next_template?: boolean;
|
|
13
|
+
next_title: string;
|
|
14
|
+
|
|
15
|
+
pre_idx: number;
|
|
16
|
+
pre_template?: boolean;
|
|
17
|
+
pre_title: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface PostNavigationProps {
|
|
21
|
+
url: string; // 페이지 url (리스트페이지 : url, 상세페이지 : url/next_id ...)
|
|
22
|
+
postNav: IPostNav; // 페이지 정보
|
|
23
|
+
preTxt: string; // 이전글 텍스트 (다국어)
|
|
24
|
+
nextTxt: string; // 다음글 텍스트 (다국어)
|
|
25
|
+
listTxt: string; // 목록보기 텍스트 (다국어)
|
|
26
|
+
queryStr?: string; // 목록 이동 시 추가할 쿼리 텍스트
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const PostNavigation = ({ url, postNav, preTxt, nextTxt, listTxt, queryStr = '' }: PostNavigationProps) => {
|
|
30
|
+
return (
|
|
31
|
+
<div className={'flex w-full items-center justify-between max-md:flex-col'}>
|
|
32
|
+
{postNav.pre_idx ? (
|
|
33
|
+
<Link
|
|
34
|
+
href={`${url}${postNav.pre_template ? '_template/' : '/'}` + postNav.pre_idx}
|
|
35
|
+
className={
|
|
36
|
+
'mb-6 flex w-full flex-col gap-[8px] md:mb-0 md:w-auto md:flex-row md:gap-[20px] lg:w-auto lg2:gap-[28px]'
|
|
37
|
+
}
|
|
38
|
+
aria-label={'이전글 ' + postNav.pre_title}
|
|
39
|
+
>
|
|
40
|
+
<Image
|
|
41
|
+
src={'/images/youtube/left.webp'}
|
|
42
|
+
alt={''}
|
|
43
|
+
width={15}
|
|
44
|
+
height={15}
|
|
45
|
+
className={'m-auto hidden md:block'}
|
|
46
|
+
/>
|
|
47
|
+
<p className={'text-[#285FA7]'}>{preTxt}</p>
|
|
48
|
+
<div>
|
|
49
|
+
<p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>{postNav.pre_title}</p>
|
|
50
|
+
</div>
|
|
51
|
+
</Link>
|
|
52
|
+
) : (
|
|
53
|
+
<div className={'flex w-[30%] gap-[28px]'}></div>
|
|
54
|
+
)}
|
|
55
|
+
|
|
56
|
+
{postNav.next_idx ? (
|
|
57
|
+
<>
|
|
58
|
+
<Link
|
|
59
|
+
href={`${url}${postNav.pre_template ? '_template/' : '/'}` + postNav.next_idx}
|
|
60
|
+
className={
|
|
61
|
+
'flex w-full flex-col justify-end gap-[8px] md:order-last md:w-auto md:flex-row md:gap-[20px] lg:w-auto lg2:gap-[28px]'
|
|
62
|
+
}
|
|
63
|
+
aria-label={'다음글 ' + postNav.next_title}
|
|
64
|
+
>
|
|
65
|
+
<p className={'text-[#285FA7]'}>{nextTxt}</p>
|
|
66
|
+
<div aria-label={'다음글 ' + postNav.next_title}>
|
|
67
|
+
<p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>{postNav.next_title}</p>
|
|
68
|
+
</div>
|
|
69
|
+
<Image
|
|
70
|
+
src={'/images/youtube/right.webp'}
|
|
71
|
+
alt={''}
|
|
72
|
+
width={15}
|
|
73
|
+
height={15}
|
|
74
|
+
className={'m-auto hidden md:block'}
|
|
75
|
+
/>
|
|
76
|
+
</Link>
|
|
77
|
+
</>
|
|
78
|
+
) : (
|
|
79
|
+
<div className={'order-last flex w-[30%] gap-[28px]'}></div>
|
|
80
|
+
)}
|
|
81
|
+
|
|
82
|
+
<Link href={`${url}${queryStr}`} className={'max-md:mt-[40px]'}>
|
|
83
|
+
<div
|
|
84
|
+
className={
|
|
85
|
+
'rounded-[30px] border-[1px] border-solid border-[#b0b0b0] bg-[#41464C] px-[32px] py-[10px] text-[#fff] lg2:px-[70px] lg2:py-[15px] '
|
|
86
|
+
}
|
|
87
|
+
>
|
|
88
|
+
{listTxt}
|
|
89
|
+
</div>
|
|
90
|
+
</Link>
|
|
91
|
+
</div>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
export default PostNavigation;
|