@daeryun/dr_components 1.3.49 → 1.3.51

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,152 @@
1
+ 'use client';
2
+
3
+ import { useRouter } from 'next/router';
4
+ import React, { useState } from 'react';
5
+ import PageWrapper from '../../Layout/PageWrapper';
6
+ import SearchBar from '../../SearchBar/SearchBar';
7
+ import Link from 'next/link';
8
+ import Image from 'next/image';
9
+ import PaginationForGroup from '../../PaginationForGroup/PaginationForGroup';
10
+ import { htmlTagRemove } from '../../../lib';
11
+
12
+ export interface IBlogListTypes {
13
+ tag_title: string;
14
+ description: string;
15
+ type_idx: number;
16
+ created_at: string;
17
+ file_alt: string;
18
+ file_path: string;
19
+ save_file_name: string;
20
+ center_code?: string;
21
+ domain?: string;
22
+ }
23
+
24
+ const BlogList = ({
25
+ list,
26
+ currentPage,
27
+ totalCount,
28
+ isCenterBlogHas
29
+ }: {
30
+ list: IBlogListTypes[];
31
+ currentPage: number;
32
+ totalCount: number;
33
+ isCenterBlogHas: boolean;
34
+ }) => {
35
+ const router = useRouter();
36
+
37
+ const [searchInput, setSearchInput] = useState<string>('');
38
+
39
+ const handleInputChange = (e: React.FormEvent<HTMLInputElement>) => {
40
+ setSearchInput(e.currentTarget.value);
41
+ };
42
+
43
+ const handleClick = async () => {
44
+ await router.push({
45
+ pathname: '/blog',
46
+ query: { page: 1, search: searchInput }
47
+ });
48
+ };
49
+
50
+ const onPaginationChange = async (pageNum: number) => {
51
+ await router.push({
52
+ pathname: '/blog',
53
+ query: { ...router.query, page: pageNum }
54
+ });
55
+ };
56
+
57
+ return (
58
+ <>
59
+ <PageWrapper>
60
+ <div className="sticky top-[100px] z-[45] mb-[20px] bg-white pb-[2px] pt-4 max-md:top-[60px]">
61
+ <SearchBar
62
+ onChange={handleInputChange}
63
+ onClick={handleClick}
64
+ search={searchInput}
65
+ placeholder={'검색어를 입력해주세요.'}
66
+ isKeyPress={true}
67
+ marginTop={[70, 50, 50]}
68
+ marginBottom={0}
69
+ />
70
+ </div>
71
+ <section className={'column-section'}>
72
+ {list?.length > 0 ? (
73
+ <div className={'grid gap-[18px] sm:grid-cols-2 lg2:grid-cols-3'}>
74
+ {list.map((card, idx) => (
75
+ <Link
76
+ href={
77
+ card.center_code === process.env.NEXT_PUBLIC_CENTER_CODE || isCenterBlogHas
78
+ ? `/blog/${card.type_idx}`
79
+ : card.domain + `blog/${card.type_idx}`
80
+ }
81
+ key={idx}
82
+ className="group flex flex-col overflow-hidden rounded-[30px] border border-solid border-transparent transition duration-300 ease-out hover:border-[#DDDDDD] max-xl:border-[#DDDDDD]"
83
+ target={
84
+ card.center_code === process.env.NEXT_PUBLIC_CENTER_CODE || isCenterBlogHas
85
+ ? '_self'
86
+ : '_blank'
87
+ }
88
+ >
89
+ <div className="relative aspect-square w-full overflow-hidden">
90
+ {card.save_file_name ? (
91
+ <Image
92
+ src={
93
+ process.env.NEXT_PUBLIC_S3_URL +
94
+ '/upload/seo/blog/' +
95
+ card.save_file_name
96
+ }
97
+ alt={card.file_alt}
98
+ fill
99
+ sizes={'600px'}
100
+ className="object-cover"
101
+ />
102
+ ) : (
103
+ <Image
104
+ src={`/images/column/column_list_${(idx % 6) + 1}.webp`}
105
+ alt=""
106
+ fill
107
+ sizes={'600px'}
108
+ className="object-cover"
109
+ />
110
+ )}
111
+ </div>
112
+
113
+ <div className="flex flex-col gap-3 bg-white px-4 py-6">
114
+ <p
115
+ className="line-clamp-2 text-xl font-extrabold md:text-2xl"
116
+ dangerouslySetInnerHTML={{ __html: card.tag_title }}
117
+ />
118
+ <p
119
+ className="line-clamp-2 text-[16px] text-[#666] md:text-[18px]"
120
+ dangerouslySetInnerHTML={{ __html: htmlTagRemove(card.description) }}
121
+ ></p>
122
+ </div>
123
+ </Link>
124
+ ))}
125
+ </div>
126
+ ) : (
127
+ <></>
128
+ )}
129
+ {list?.length < 1 ? (
130
+ <>
131
+ <div className={'h-[300px] text-center text-[20px] leading-[300px] '}>
132
+ 검색 결과가 없습니다.
133
+ </div>
134
+ </>
135
+ ) : (
136
+ <></>
137
+ )}
138
+ </section>
139
+
140
+ <PaginationForGroup
141
+ total={totalCount}
142
+ currentPage={Number(currentPage)}
143
+ size={12}
144
+ className={'my-[100px]'}
145
+ onChange={onPaginationChange}
146
+ />
147
+ </PageWrapper>
148
+ </>
149
+ );
150
+ };
151
+
152
+ export default BlogList;
@@ -4,20 +4,21 @@ export interface IBlogPageTypes {
4
4
  data: IBlogTypes;
5
5
  tel: string;
6
6
  }
7
+ export interface IPnData {
8
+ pre_idx: number;
9
+ pre_title: string;
10
+ pre_center_code: string;
11
+ pre_domain: string;
12
+ next_idx: number;
13
+ next_title: string;
14
+ next_center_code: string;
15
+ next_domain: string;
16
+ }
7
17
  export interface IBlogTypes {
8
18
  template: ISeoTemplateTypes[];
9
19
  h2List: ISeoTemplateTypes[] | null;
10
20
  contentsList: IContentsListTypes[] | null;
11
- prevPost: {
12
- idx: number;
13
- title: string;
14
- pathname: string;
15
- } | null;
16
- nextPost: {
17
- idx: number;
18
- title: string;
19
- pathname: string;
20
- } | null;
21
+ pnData: IPnData[];
21
22
  fieldData: IFieldTypes[];
22
23
  successData: ISuccessTypes[];
23
24
  referenceLinkList: IAddLinkTypes[];
@@ -12,12 +12,24 @@ export interface IBlogPageTypes {
12
12
  data: IBlogTypes;
13
13
  tel: string;
14
14
  }
15
+
16
+ export interface IPnData {
17
+ pre_idx: number;
18
+ pre_title: string;
19
+ pre_center_code: string;
20
+ pre_domain: string;
21
+
22
+ next_idx: number;
23
+ next_title: string;
24
+ next_center_code: string;
25
+ next_domain: string;
26
+ }
27
+
15
28
  export interface IBlogTypes {
16
29
  template: ISeoTemplateTypes[];
17
30
  h2List: ISeoTemplateTypes[] | null;
18
31
  contentsList: IContentsListTypes[] | null;
19
- prevPost: { idx: number; title: string; pathname: string } | null;
20
- nextPost: { idx: number; title: string; pathname: string } | null;
32
+ pnData: IPnData[];
21
33
  fieldData: IFieldTypes[];
22
34
  successData: ISuccessTypes[];
23
35
  referenceLinkList: IAddLinkTypes[];
@@ -19,7 +19,7 @@ import Arrow from '../../../asset/images/success_new/left.webp';
19
19
  import RightArrow from '../../../asset/images/success_new/right.webp';
20
20
  import BlogWrapper from './BlogWrapper';
21
21
  const BlogView = ({ data, tel }) => {
22
- const { template, contentsList, h2List, fieldData, successData, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, initialData, nextPost, prevPost, faqElementMaxCountInContents } = data;
22
+ const { template, contentsList, h2List, fieldData, successData, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, initialData, pnData, faqElementMaxCountInContents } = data;
23
23
  const { width } = useBrowser(true);
24
24
  const [isFaqActive, setIsFaqActive] = useState(false);
25
25
  const printRef = useRef(null);
@@ -177,39 +177,43 @@ const BlogView = ({ data, tel }) => {
177
177
  </div>
178
178
  <SeoConsulting tel={tel}/>
179
179
  </div>) : (<></>)}
180
- <div className="m-auto mt-[60px] max-md:mb-[30px]">
181
- <div className={'flex flex-col items-start justify-between md:mb-[60px] lg:flex-row lg:items-center'}>
182
- <div className={'mb-6 flex w-full flex-col gap-[8px] lg:mb-0 lg:w-auto lg:flex-row lg:items-center lg:gap-[20px] lg2:gap-[28px]'}>
183
- <Image src={Arrow} alt={'화살표'} title={'화살표'} width={15} height={15} className={'m-auto hidden lg:block'}/>
184
- <p className={'shrink-0 text-[18px] text-[#285FA7] '}>이전글</p>
185
- {prevPost ? (<Link href={prevPost.pathname + String(prevPost.idx)}>
186
- <p className={'w-full truncate text-[16px] xs:text-[18px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em] '}>
187
- {prevPost.title}
180
+ <section className={'mt-[60px] w-full max-md:mb-[30px]'}>
181
+ <div className={'flex w-full items-center justify-between max-md:flex-col'}>
182
+ {pnData[0].pre_idx ? (<Link href={pnData[0].pre_domain + 'blog/' + pnData[0].pre_idx} target={pnData[0].pre_center_code != process.env.NEXT_PUBLIC_CENTER_CODE
183
+ ? '_target'
184
+ : '_self'} 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={'이전글 ' + pnData[0].pre_title}>
185
+ <Image src={Arrow} alt={''} width={15} height={15} className={'m-auto hidden md:block'}/>
186
+ <p className={'text-[#285FA7]'}>이전글</p>
187
+ <div>
188
+ <p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>
189
+ {pnData[0].pre_title}
188
190
  </p>
189
- </Link>) : (<p className={'truncate text-[16px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em]'}>
190
- 이전글이 없습니다.
191
- </p>)}
192
- </div>
191
+ </div>
192
+ </Link>) : (<div className={'flex w-[30%] gap-[28px]'}></div>)}
193
+
194
+ {pnData[0].next_idx ? (<>
195
+ <Link href={pnData[0].next_domain + 'blog/' + pnData[0].next_idx} target={pnData[0].next_center_code != process.env.NEXT_PUBLIC_CENTER_CODE
196
+ ? '_target'
197
+ : '_self'} 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={'다음글 ' + pnData[0].next_title}>
198
+ <p className={'text-[#285FA7]'}>다음글</p>
199
+ <div aria-label={'다음글 ' + pnData[0].next_title}>
200
+ <p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>
201
+ {pnData[0].next_title}
202
+ </p>
203
+ </div>
204
+ <Image src={RightArrow} alt={''} width={15} height={15} className={'m-auto hidden md:block'}/>
205
+ </Link>
206
+ </>) : (<div className={'order-last flex w-[30%] gap-[28px]'}></div>)}
193
207
 
194
- <Link href={`/info`} className={'hidden w-[198px] shrink-0 max-xxl:w-[138px] lg:block'}>
195
- <button className={'rounded-[30px] border-[1px] border-solid border-[#b0b0b0] bg-[#41464C] px-[40px] py-[10px] text-[#fff] xxl:px-[70px] xxl:py-[15px]'}>
208
+ <Link href={`/blog`} className={'max-md:mt-[40px]'}>
209
+ <div className={'rounded-[30px] border-[1px] border-solid border-[#b0b0b0] bg-[#41464C] px-[32px] py-[10px] text-[#fff] lg2:px-[70px] lg2:py-[15px] '}>
196
210
  목록보기
197
- </button>
211
+ </div>
198
212
  </Link>
199
-
200
- <div className={'flex w-full flex-col justify-end gap-[8px] lg:w-auto lg:flex-row lg:items-center lg:gap-[20px] lg2:gap-[28px]'}>
201
- <p className={'shrink-0 text-[18px] text-[#285FA7]'}>다음글</p>
202
- {nextPost ? (<Link href={nextPost.pathname + String(nextPost.idx)}>
203
- <p className={'w-full truncate text-[16px] xs:text-[18px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em] '}>
204
- {nextPost.title}
205
- </p>
206
- </Link>) : (<p className={'truncate xs:text-[18px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em] '}>
207
- 다음글이 없습니다.
208
- </p>)}
209
- <Image src={RightArrow} alt={'화살표'} title={'화살표'} width={15} height={15} className={'m-auto hidden lg:block'}/>
210
- </div>
211
213
  </div>
212
- </div>
214
+
215
+ <div className={'my-10 mt-20 w-[100%]'}></div>
216
+ </section>
213
217
  </div>
214
218
  </BlogWrapper>
215
219
  </div>
@@ -34,8 +34,7 @@ const BlogView = ({ data, tel }: IBlogPageTypes) => {
34
34
  shortsLinkList,
35
35
  youtubeLinkList,
36
36
  initialData,
37
- nextPost,
38
- prevPost,
37
+ pnData,
39
38
  faqElementMaxCountInContents
40
39
  } = data;
41
40
  const { width } = useBrowser(true);
@@ -347,93 +346,85 @@ const BlogView = ({ data, tel }: IBlogPageTypes) => {
347
346
  ) : (
348
347
  <></>
349
348
  )}
350
- <div className="m-auto mt-[60px] max-md:mb-[30px]">
351
- <div
352
- className={
353
- 'flex flex-col items-start justify-between md:mb-[60px] lg:flex-row lg:items-center'
354
- }
355
- >
356
- <div
357
- className={
358
- 'mb-6 flex w-full flex-col gap-[8px] lg:mb-0 lg:w-auto lg:flex-row lg:items-center lg:gap-[20px] lg2:gap-[28px]'
359
- }
360
- >
361
- <Image
362
- src={Arrow}
363
- alt={'화살표'}
364
- title={'화살표'}
365
- width={15}
366
- height={15}
367
- className={'m-auto hidden lg:block'}
368
- />
369
- <p className={'shrink-0 text-[18px] text-[#285FA7] '}>이전글</p>
370
- {prevPost ? (
371
- <Link href={prevPost.pathname + String(prevPost.idx)}>
372
- <p
373
- className={
374
- 'w-full truncate text-[16px] xs:text-[18px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em] '
375
- }
376
- >
377
- {prevPost.title}
349
+ <section className={'mt-[60px] w-full max-md:mb-[30px]'}>
350
+ <div className={'flex w-full items-center justify-between max-md:flex-col'}>
351
+ {pnData[0].pre_idx ? (
352
+ <Link
353
+ href={pnData[0].pre_domain + 'blog/' + pnData[0].pre_idx}
354
+ target={
355
+ pnData[0].pre_center_code != process.env.NEXT_PUBLIC_CENTER_CODE
356
+ ? '_target'
357
+ : '_self'
358
+ }
359
+ className={
360
+ '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]'
361
+ }
362
+ aria-label={'이전글 ' + pnData[0].pre_title}
363
+ >
364
+ <Image
365
+ src={Arrow}
366
+ alt={''}
367
+ width={15}
368
+ height={15}
369
+ className={'m-auto hidden md:block'}
370
+ />
371
+ <p className={'text-[#285FA7]'}>이전글</p>
372
+ <div>
373
+ <p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>
374
+ {pnData[0].pre_title}
378
375
  </p>
379
- </Link>
380
- ) : (
381
- <p
376
+ </div>
377
+ </Link>
378
+ ) : (
379
+ <div className={'flex w-[30%] gap-[28px]'}></div>
380
+ )}
381
+
382
+ {pnData[0].next_idx ? (
383
+ <>
384
+ <Link
385
+ href={pnData[0].next_domain + 'blog/' + pnData[0].next_idx}
386
+ target={
387
+ pnData[0].next_center_code != process.env.NEXT_PUBLIC_CENTER_CODE
388
+ ? '_target'
389
+ : '_self'
390
+ }
382
391
  className={
383
- 'truncate text-[16px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em]'
392
+ '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]'
384
393
  }
394
+ aria-label={'다음글 ' + pnData[0].next_title}
385
395
  >
386
- 이전글이 없습니다.
387
- </p>
388
- )}
389
- </div>
396
+ <p className={'text-[#285FA7]'}>다음글</p>
397
+ <div aria-label={'다음글 ' + pnData[0].next_title}>
398
+ <p className={'truncate md:w-[11em] lg:w-[14em] lg2:w-[18em] '}>
399
+ {pnData[0].next_title}
400
+ </p>
401
+ </div>
402
+ <Image
403
+ src={RightArrow}
404
+ alt={''}
405
+ width={15}
406
+ height={15}
407
+ className={'m-auto hidden md:block'}
408
+ />
409
+ </Link>
410
+ </>
411
+ ) : (
412
+ <div className={'order-last flex w-[30%] gap-[28px]'}></div>
413
+ )}
390
414
 
391
- <Link href={`/info`} className={'hidden w-[198px] shrink-0 max-xxl:w-[138px] lg:block'}>
392
- <button
415
+ <Link href={`/blog`} className={'max-md:mt-[40px]'}>
416
+ <div
393
417
  className={
394
- 'rounded-[30px] border-[1px] border-solid border-[#b0b0b0] bg-[#41464C] px-[40px] py-[10px] text-[#fff] xxl:px-[70px] xxl:py-[15px]'
418
+ 'rounded-[30px] border-[1px] border-solid border-[#b0b0b0] bg-[#41464C] px-[32px] py-[10px] text-[#fff] lg2:px-[70px] lg2:py-[15px] '
395
419
  }
396
420
  >
397
421
  목록보기
398
- </button>
422
+ </div>
399
423
  </Link>
400
-
401
- <div
402
- className={
403
- 'flex w-full flex-col justify-end gap-[8px] lg:w-auto lg:flex-row lg:items-center lg:gap-[20px] lg2:gap-[28px]'
404
- }
405
- >
406
- <p className={'shrink-0 text-[18px] text-[#285FA7]'}>다음글</p>
407
- {nextPost ? (
408
- <Link href={nextPost.pathname + String(nextPost.idx)}>
409
- <p
410
- className={
411
- 'w-full truncate text-[16px] xs:text-[18px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em] '
412
- }
413
- >
414
- {nextPost.title}
415
- </p>
416
- </Link>
417
- ) : (
418
- <p
419
- className={
420
- 'truncate xs:text-[18px] lg:w-[13em] xl:w-[16em] xxl:text-[20px] 4xl:w-[20em] '
421
- }
422
- >
423
- 다음글이 없습니다.
424
- </p>
425
- )}
426
- <Image
427
- src={RightArrow}
428
- alt={'화살표'}
429
- title={'화살표'}
430
- width={15}
431
- height={15}
432
- className={'m-auto hidden lg:block'}
433
- />
434
- </div>
435
424
  </div>
436
- </div>
425
+
426
+ <div className={'my-10 mt-20 w-[100%]'}></div>
427
+ </section>
437
428
  </div>
438
429
  </BlogWrapper>
439
430
  </div>
@@ -33,3 +33,4 @@ export { default as TrendList } from './Trend/TrendList';
33
33
  export { default as TrendDetail } from './Trend/TrendDetail';
34
34
  export { default as Blog } from './Blog/Blog';
35
35
  export { default as BlogView } from './Blog/BlogView';
36
+ export { default as BlogList } from './Blog/BlogList';
@@ -35,3 +35,4 @@ export { default as TrendList } from './Trend/TrendList';
35
35
  export { default as TrendDetail } from './Trend/TrendDetail';
36
36
  export { default as Blog } from './Blog/Blog';
37
37
  export { default as BlogView } from './Blog/BlogView';
38
+ export { default as BlogList } from './Blog/BlogList';
@@ -35,3 +35,4 @@ export { default as TrendList } from './Trend/TrendList';
35
35
  export { default as TrendDetail } from './Trend/TrendDetail';
36
36
  export { default as Blog } from './Blog/Blog';
37
37
  export { default as BlogView } from './Blog/BlogView';
38
+ export { default as BlogList } from './Blog/BlogList';
@@ -7203,6 +7203,11 @@ html {
7203
7203
  padding-bottom: 1.25rem;
7204
7204
  }
7205
7205
 
7206
+ .py-6 {
7207
+ padding-top: 1.5rem;
7208
+ padding-bottom: 1.5rem;
7209
+ }
7210
+
7206
7211
  .py-7 {
7207
7212
  padding-top: 1.75rem;
7208
7213
  padding-bottom: 1.75rem;
@@ -10426,6 +10431,11 @@ body {
10426
10431
  border-color: rgb(40 95 167 / var(--tw-border-opacity, 1));
10427
10432
  }
10428
10433
 
10434
+ .hover\:border-\[\#DDDDDD\]:hover {
10435
+ --tw-border-opacity: 1;
10436
+ border-color: rgb(221 221 221 / var(--tw-border-opacity, 1));
10437
+ }
10438
+
10429
10439
  .hover\:border-gray-500:hover {
10430
10440
  --tw-border-opacity: 1;
10431
10441
  border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));
@@ -13463,6 +13473,11 @@ body {
13463
13473
  border-style: none;
13464
13474
  }
13465
13475
 
13476
+ .max-xl\:border-\[\#DDDDDD\] {
13477
+ --tw-border-opacity: 1;
13478
+ border-color: rgb(221 221 221 / var(--tw-border-opacity, 1));
13479
+ }
13480
+
13466
13481
  .max-xl\:border-t-\[\#ffffff00\] {
13467
13482
  border-top-color: #ffffff00;
13468
13483
  }
@@ -23032,6 +23047,10 @@ body {
23032
23047
  width: 42.14%;
23033
23048
  }
23034
23049
 
23050
+ .lg2\:grid-cols-3 {
23051
+ grid-template-columns: repeat(3, minmax(0, 1fr));
23052
+ }
23053
+
23035
23054
  .lg2\:flex-row {
23036
23055
  flex-direction: row;
23037
23056
  }