@daeryun/dr_components 1.3.21 → 1.3.24

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.
@@ -1,3 +1,4 @@
1
+ import { IInitialDataTypes } from '../index';
1
2
  export interface ITrendTypes {
2
3
  id: number;
3
4
  title: string;
@@ -16,3 +17,87 @@ export interface ITrendTypes {
16
17
  is_foreigner: boolean[];
17
18
  pathname: string;
18
19
  }
20
+ export interface ITrendDetailPageTypes {
21
+ data: ITrendDetailTypes;
22
+ tel: string;
23
+ }
24
+ export interface ITrendDetailTypes {
25
+ template: ISeoTemplateTypes[];
26
+ contentsList: IContentsListTypes[] | null;
27
+ h2List: ISeoTemplateTypes[] | null;
28
+ lawyerData: ILawyerTypes[];
29
+ fieldData: IFieldTypes[];
30
+ pnData: IPnData[];
31
+ referenceLinkList: IAddLinkTypes[];
32
+ newsLinkList: IAddLinkTypes[];
33
+ shortsLinkList: IAddLinkTypes[];
34
+ youtubeLinkList: IAddLinkTypes[];
35
+ initialData: IInitialDataTypes;
36
+ }
37
+ export interface ISeoTemplateTypes {
38
+ type: string;
39
+ idx: number;
40
+ tag: string;
41
+ parent: number;
42
+ description: string;
43
+ created_at?: Date | null;
44
+ creator?: string | null;
45
+ modified_at?: Date | null;
46
+ modifier?: string | null;
47
+ tag_title: string;
48
+ type_idx: number;
49
+ is_index: boolean | null;
50
+ hit: number;
51
+ center_code: string;
52
+ sub_title?: string | null;
53
+ crime_result?: string | null;
54
+ case_number?: string | null;
55
+ deleted_at?: string | null;
56
+ template_type?: string | null;
57
+ is_editor: boolean;
58
+ is_consult: boolean | null;
59
+ news_is_use: boolean | null;
60
+ reference_is_use: boolean | null;
61
+ youtube_is_use: boolean | null;
62
+ active_faq: boolean;
63
+ faqCount?: number;
64
+ }
65
+ export interface IContentsListTypes {
66
+ center_code: string;
67
+ domain: string;
68
+ tag_title: string;
69
+ type_idx: number;
70
+ }
71
+ export interface ILawyerTypes {
72
+ lawyer_name: string | null;
73
+ l_ability: string;
74
+ l_tel: string;
75
+ l_id: string;
76
+ l_del: string;
77
+ mark: string;
78
+ lawyer_position: string;
79
+ lawyer_code: string;
80
+ img_url: string;
81
+ center_ability?: string | null;
82
+ }
83
+ export interface IFieldTypes {
84
+ idx: number;
85
+ title_text: string;
86
+ field_title: string;
87
+ pathname: string;
88
+ }
89
+ export interface IPnData {
90
+ pre_idx: number | null;
91
+ pre_title: string | null;
92
+ next_idx: number | null;
93
+ next_title: string | null;
94
+ }
95
+ export interface IAddLinkTypes {
96
+ type_idx: number;
97
+ tag_idx: number;
98
+ type: string;
99
+ seo_type: string;
100
+ title: string;
101
+ link: string;
102
+ idx: number;
103
+ }
@@ -1,3 +1,5 @@
1
+ import { IInitialDataTypes } from '../index';
2
+
1
3
  export interface ITrendTypes {
2
4
  id: number;
3
5
  title: string;
@@ -16,3 +18,93 @@ export interface ITrendTypes {
16
18
  is_foreigner: boolean[];
17
19
  pathname: string;
18
20
  }
21
+
22
+ export interface ITrendDetailPageTypes {
23
+ data: ITrendDetailTypes;
24
+ tel: string;
25
+ }
26
+
27
+ export interface ITrendDetailTypes {
28
+ template: ISeoTemplateTypes[];
29
+ contentsList: IContentsListTypes[] | null;
30
+ h2List: ISeoTemplateTypes[] | null;
31
+ lawyerData: ILawyerTypes[];
32
+ fieldData: IFieldTypes[];
33
+ pnData: IPnData[];
34
+ referenceLinkList: IAddLinkTypes[];
35
+ newsLinkList: IAddLinkTypes[];
36
+ shortsLinkList: IAddLinkTypes[];
37
+ youtubeLinkList: IAddLinkTypes[];
38
+ initialData: IInitialDataTypes;
39
+ }
40
+
41
+ export interface ISeoTemplateTypes {
42
+ type: string;
43
+ idx: number;
44
+ tag: string;
45
+ parent: number;
46
+ description: string;
47
+ created_at?: Date | null;
48
+ creator?: string | null;
49
+ modified_at?: Date | null;
50
+ modifier?: string | null;
51
+ tag_title: string;
52
+ type_idx: number;
53
+ is_index: boolean | null;
54
+ hit: number;
55
+ center_code: string;
56
+ sub_title?: string | null;
57
+ crime_result?: string | null;
58
+ case_number?: string | null;
59
+ deleted_at?: string | null;
60
+ template_type?: string | null;
61
+ is_editor: boolean;
62
+ is_consult: boolean | null;
63
+ news_is_use: boolean | null;
64
+ reference_is_use: boolean | null;
65
+ youtube_is_use: boolean | null;
66
+ active_faq: boolean;
67
+ faqCount?: number;
68
+ }
69
+
70
+ export interface IContentsListTypes {
71
+ center_code: string;
72
+ domain: string;
73
+ tag_title: string;
74
+ type_idx: number;
75
+ }
76
+
77
+ export interface ILawyerTypes {
78
+ lawyer_name: string | null;
79
+ l_ability: string;
80
+ l_tel: string;
81
+ l_id: string;
82
+ l_del: string;
83
+ mark: string;
84
+ lawyer_position: string;
85
+ lawyer_code: string;
86
+ img_url: string;
87
+ center_ability?: string | null;
88
+ }
89
+ export interface IFieldTypes {
90
+ idx: number;
91
+ title_text: string;
92
+ field_title: string;
93
+ pathname: string;
94
+ }
95
+
96
+ export interface IPnData {
97
+ pre_idx: number | null;
98
+ pre_title: string | null;
99
+ next_idx: number | null;
100
+ next_title: string | null;
101
+ }
102
+ export interface IAddLinkTypes {
103
+ type_idx: number;
104
+ tag_idx: number;
105
+ type: string;
106
+ seo_type: string;
107
+ title: string;
108
+ link: string;
109
+ idx: number;
110
+ }
@@ -81,5 +81,7 @@ export { default as PaginationForGroup } from './PaginationForGroup/PaginationFo
81
81
  export { default as SuccessList } from './page/Success/SuccessList';
82
82
  export { default as GlobalOfficeSection } from './GlobalOfficeSection/GlobalOfficeSection';
83
83
  export { default as GoToMYSJKP } from './GoToMYSJKP/GoToMYSJKP';
84
+ export { default as TrendList } from './page/Trend/TrendList';
85
+ export { default as TrendDetail } from './page/Trend/TrendDetail';
84
86
  // Hooks
85
87
  export { useLoginUuidSync } from './hook/useLoginUuidSync';
@@ -81,6 +81,8 @@ export { default as PaginationForGroup } from './PaginationForGroup/PaginationFo
81
81
  export { default as SuccessList } from './page/Success/SuccessList';
82
82
  export { default as GlobalOfficeSection } from './GlobalOfficeSection/GlobalOfficeSection';
83
83
  export { default as GoToMYSJKP } from './GoToMYSJKP/GoToMYSJKP';
84
+ export { default as TrendList } from './page/Trend/TrendList';
85
+ export { default as TrendDetail } from './page/Trend/TrendDetail';
84
86
 
85
87
  // Hooks
86
88
  export { useLoginUuidSync } from './hook/useLoginUuidSync';
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ITrendDetailPageTypes } from '../../common/types/trend';
3
+ declare const TrendDetail: ({ data, tel }: ITrendDetailPageTypes) => React.JSX.Element;
4
+ export default TrendDetail;
@@ -0,0 +1,203 @@
1
+ 'use client';
2
+ import useBrowser from '../../hook/useBrowser';
3
+ import { usePathname, useRouter, useSearchParams } from 'next/navigation';
4
+ import React, { useEffect, useRef, useState } from 'react';
5
+ import PageTitleBox from '../../PageTitleBox/PageTitleBox';
6
+ import { ImgTypes } from '../../PageTitleBox/ImgTypes';
7
+ import PdfPrintCopyLink from '../../PdfPrintCopyLink/PdfPrintCopyLink';
8
+ import { htmlUrlDecode } from '../../../lib';
9
+ import ContentList from '../SuccessNew/components/ContentList';
10
+ import H2Contents from '../SuccessNew/components/H2Contents';
11
+ import H3Contents from '../SuccessNew/components/H3Contents';
12
+ import SeoAdditionalLink from '../../Seo/SeoAdditionalLink';
13
+ import SeoYoutube from '../../Seo/SeoYoutube';
14
+ import SeoStrength from '../../Seo/SeoStrength';
15
+ import SeoConsulting from '../../Seo/SeoConsulting';
16
+ import LawInfoContentList from '../SuccessNew/components/LawInfoContentList';
17
+ import { Lawyer } from '../../Seo/Lawyer';
18
+ import PostNavigation from '../../postNavigation/PostNavigation';
19
+ import { FieldCase } from '../SuccessNew/components/FieldCase';
20
+ const TrendDetail = ({ data, tel }) => {
21
+ const { template, contentsList, h2List, lawyerData, fieldData, pnData, referenceLinkList, newsLinkList, shortsLinkList, youtubeLinkList, initialData } = data;
22
+ const { width } = useBrowser(true);
23
+ const router = useRouter();
24
+ const pathname = usePathname();
25
+ const searchParams = useSearchParams();
26
+ const printRef = useRef(null);
27
+ //details 태그
28
+ const detailsRef = useRef(null);
29
+ const [isOpen, setIsOpen] = useState(false);
30
+ const [isFaqActive, setIsFaqActive] = useState(false);
31
+ const handleScrollToElement = (idx) => {
32
+ if (typeof window != 'undefined') {
33
+ const element = document.getElementById(idx.toString());
34
+ if (element) {
35
+ const topOffset = element.getBoundingClientRect().top;
36
+ window.scrollTo({
37
+ top: window.scrollY + topOffset - 130,
38
+ behavior: 'smooth'
39
+ });
40
+ }
41
+ }
42
+ };
43
+ const handleClickGoImg = () => {
44
+ var _a, _b;
45
+ const imgLocation = (_b = (_a = document.getElementById('img_wrap')) === null || _a === void 0 ? void 0 : _a.offsetTop) !== null && _b !== void 0 ? _b : 0;
46
+ window.scrollTo({ top: imgLocation + (width > 680 ? 300 : 200), behavior: 'smooth' });
47
+ };
48
+ useEffect(() => {
49
+ const detailsElement = detailsRef.current;
50
+ if (detailsElement) {
51
+ const handleToggle = () => setIsOpen(detailsElement.open);
52
+ detailsElement.addEventListener('toggle', handleToggle);
53
+ setIsOpen(detailsElement.open);
54
+ return () => detailsElement.removeEventListener('toggle', handleToggle);
55
+ }
56
+ }, []);
57
+ useEffect(() => {
58
+ const el = document.getElementById('daum-wm-content');
59
+ el.focus();
60
+ }, [pathname, searchParams]);
61
+ useEffect(() => {
62
+ if (template) {
63
+ // 초기화
64
+ setIsFaqActive(false);
65
+ for (const data of template) {
66
+ // console.log("faq 활성화: ", data['active_faq']);
67
+ if (data['active_faq']) {
68
+ setIsFaqActive(true);
69
+ }
70
+ }
71
+ }
72
+ }, [template]);
73
+ return (<>
74
+ <PageTitleBox titleTxt={'판결분석/최신동향'} subTxt={<>
75
+ 분야별 전문성을 갖춘 법무법인(유한) 대륜의 <br /> 판결과 법적이슈에 대한 분석을 전해드립니다.
76
+ </>} imgType={ImgTypes.TREND} isViewP isSeo/>
77
+ <div id={'sub_contents'} ref={printRef} itemScope={isFaqActive ? undefined : true} itemType={isFaqActive ? undefined : 'https://schema.org/FAQPage'}>
78
+ <div className="relative m-auto mb-[100px] w-[90%] max-w-screen-2xl max-md2:mb-[40px] max-xs:mb-[30px]">
79
+ <div className={'m-auto mt-[100px] flex gap-[120px] ' +
80
+ //1700px
81
+ 'max-5xl:gap-[80px] ' +
82
+ //1500px
83
+ 'max-3xl:gap-10 ' +
84
+ //1280px
85
+ 'max-xl:mt-0 max-xl:flex-col max-xl:gap-0 ' +
86
+ //600px
87
+ 'max-sm:mt-[10px] '}>
88
+ <span>
89
+ <div className="flex-1">
90
+ {template && width < 1280 ? (<PdfPrintCopyLink fileName={template.filter(t => t.tag === 'h1')[0].tag_title} printRef={printRef}/>) : null}
91
+ <div className={'max-xl:mt-[25px] max-xs:mt-[15px]'}>
92
+ {template
93
+ .filter(t => t.tag === 'h1')
94
+ .map((h1Contents, index) => {
95
+ return (<React.Fragment key={index}>
96
+ {/*h1*/}
97
+
98
+ <h1 className={'text-[52.5px] font-[800] !leading-[1.3] tracking-[-2.1px] text-[#285FA7] max-3xl:text-5xl max-md:text-4xl max-xs:text-[28px] '} key={index}>
99
+ {h1Contents.tag_title}
100
+ </h1>
101
+ <div className={'mt-[32px] h-[2px] w-full bg-[#285FA7]'}></div>
102
+ {/*h1 설명글*/}
103
+ <div className={'mb-[54px] mt-[16px] text-[16px] font-normal tracking-[-0.96px] xs:text-[18px] sm:mb-[62px] sm:mt-[26px] sm:text-[20px] lg:mb-[75px] lg:mt-[26px] lg:text-[24px] '}>
104
+ {h1Contents.is_editor ? (<div id={'ck-content'} dangerouslySetInnerHTML={{
105
+ __html: htmlUrlDecode(h1Contents.description.replace('../../UploadFile', '/SE2/upload'))
106
+ }}/>) : (h1Contents.description)}
107
+ </div>
108
+ </React.Fragment>);
109
+ })}
110
+ </div>
111
+ <article>
112
+ {/*목차*/}
113
+ <ContentList template={template} h2List={h2List ? h2List : []} onImageMove={handleClickGoImg} onScrollToElement={handleScrollToElement}/>
114
+
115
+ {/*h2*/}
116
+ {h2List &&
117
+ h2List.map((h2Template, index) => {
118
+ return (<section className={'mt-[52px] sm:mt-[62px] lg:mt-[75px]'} key={'h2영역' + h2Template.idx}>
119
+ <H2Contents index={index} h2Template={h2Template}/>
120
+
121
+ {/*h3*/}
122
+ {template
123
+ .filter(t => t.parent === h2Template.idx)
124
+ .map((h3Template, h3Index) => {
125
+ const refer_is_use = h3Template.reference_is_use;
126
+ const refer_length = referenceLinkList.length;
127
+ const refer_content_length = referenceLinkList.filter(i => i.tag_idx === h3Template.idx).length;
128
+ const news_is_use = h3Template.news_is_use;
129
+ const news_length = newsLinkList.length;
130
+ const news_content_length = newsLinkList.filter(i => i.tag_idx === h3Template.idx).length;
131
+ return (<React.Fragment key={'h3영역' + h3Template.idx}>
132
+ <H3Contents h3Template={h3Template}/>
133
+ {(refer_is_use &&
134
+ refer_length > 0 &&
135
+ refer_content_length > 0) ||
136
+ (news_is_use &&
137
+ news_length > 0 &&
138
+ news_content_length > 0) ? (<span className={'mb-[44px] flex flex-col gap-[26px] px-[10px] sm:mx-[33px] sm:mb-[50px] sm:px-[18px] lg:mb-[78px] ' +
139
+ //520px
140
+ 'max-2sm:gap-[16px]'}>
141
+ {refer_is_use && refer_length > 0 && (<SeoAdditionalLink type={'더보기'} linkList={referenceLinkList.filter(i => i.tag_idx === h3Template.idx)}/>)}
142
+ {news_is_use && news_length > 0 && (<SeoAdditionalLink type={'관련기사'} linkList={newsLinkList.filter(i => i.tag_idx === h3Template.idx)}/>)}
143
+ </span>) : (<></>)}
144
+ </React.Fragment>);
145
+ })}
146
+ <span className={'flex flex-col gap-[26px] ' +
147
+ //520px
148
+ 'max-2sm:gap-[16px]'}>
149
+ {h2Template.reference_is_use &&
150
+ referenceLinkList.length > 0 && (<SeoAdditionalLink type={'더보기'} linkList={referenceLinkList.filter(i => i.tag_idx === h2Template.idx)}/>)}
151
+ {h2Template.news_is_use && newsLinkList.length > 0 && (<SeoAdditionalLink type={'관련기사'} linkList={newsLinkList.filter(i => i.tag_idx === h2Template.idx)}/>)}
152
+ {shortsLinkList.length > 0 && (<SeoYoutube type={'shorts'} linkList={shortsLinkList.filter(i => i.tag_idx === h2Template.idx)}/>)}
153
+ {youtubeLinkList.length > 0 && (<SeoYoutube type={'youtube'} linkList={youtubeLinkList.filter(i => i.tag_idx === h2Template.idx)}/>)}
154
+ </span>
155
+ </section>);
156
+ })}
157
+ </article>
158
+ {width >= 1280 ? (<div className={'flex flex-col gap-[60px] lg:mt-[60px]'}>
159
+ <div className={'relative w-full '}>
160
+ <SeoStrength initialData={initialData}/>
161
+ </div>
162
+ <SeoConsulting tel={tel}/>
163
+ <LawInfoContentList contentsList={contentsList} className={''} template={template}/>
164
+ </div>) : (<></>)}
165
+ </div>
166
+ </span>
167
+ <span className={'relative mb-[30px] mt-[30px] w-[340px] shrink-0 ' +
168
+ //1500px
169
+ 'max-3xl:mt-[10px] max-3xl:w-[300px] ' +
170
+ //1280px
171
+ 'max-xl:mt-[50px] max-xl:w-full max-xl:pt-0'}>
172
+ <span id={'fixSideBar'} className={'top-[140px] flex w-[340px] flex-col gap-[50px] xl:sticky ' +
173
+ 'max-3xl:w-[300px] max-xl:w-full'}>
174
+ {template && width >= 1280 ? (<PdfPrintCopyLink fileName={template.filter(t => t.tag === 'h1')[0].tag_title} printRef={printRef}/>) : null}
175
+ {fieldData ? <FieldCase fieldData={fieldData}/> : <></>}
176
+ {lawyerData ? <Lawyer lawyerData={lawyerData}/> : <></>}
177
+ </span>
178
+ </span>
179
+ </div>
180
+ <hr className={'mb-[2rem] hidden h-[1px] w-[100%] bg-gray-100 xl:block'}/>
181
+ </div>
182
+ </div>
183
+ <div>
184
+ {width < 1280 ? (<>
185
+ <div className="m-auto flex flex-col gap-[60px] max-4xl:w-[90%]">
186
+ <div className={'relative w-full lg:mb-20'}>
187
+ <SeoStrength initialData={initialData}/>
188
+ </div>
189
+ <SeoConsulting tel={tel}/>
190
+ <LawInfoContentList contentsList={contentsList} template={template}/>
191
+ </div>
192
+ </>) : (<></>)}
193
+ {/*게시글 리스트*/}
194
+ <section className={'m-auto mt-[3rem] w-[90%] max-w-screen-2xl xl:mt-0 ' +
195
+ //1280px
196
+ 'max-xl:pb-[10px] max-xl:pr-0 '}>
197
+ <PostNavigation url={'/trend'} postNav={pnData[0]} preTxt={'이전글'} nextTxt={'다음글'} listTxt={'목록보기'}/>
198
+ <div className={'my-10 mt-20 w-[100%]'}></div>
199
+ </section>
200
+ </div>
201
+ </>);
202
+ };
203
+ export default TrendDetail;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import TrendDetail from './TrendDetail';
3
+ declare const meta: Meta<typeof TrendDetail>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Default: Story;