@daeryun/dr_components 0.5.30 → 0.5.32

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.
@@ -6,6 +6,7 @@ interface IDetailProps {
6
6
  speciality: ILawyerCareer[];
7
7
  certiList: ILawyerCerti[];
8
8
  codeList: ICommonCode[];
9
+ centerCode: string;
9
10
  }
10
- declare const Detail: ({ lawyerInfo, careerList, certiList, codeList, speciality }: IDetailProps) => React.JSX.Element | null;
11
+ declare const Detail: ({ lawyerInfo, careerList, certiList, codeList, speciality, centerCode }: IDetailProps) => React.JSX.Element | null;
11
12
  export default Detail;
@@ -20,7 +20,7 @@ import MobileSpeciality from './component/MobileSpeciality';
20
20
  import Introduce from './component/Introduce';
21
21
  import MobileRelatedPage from './component/MobileRelatedPage';
22
22
  import { bodyFetch, lawyerCode } from '../../../lib';
23
- const Detail = ({ lawyerInfo, careerList, certiList, codeList, speciality }) => {
23
+ const Detail = ({ lawyerInfo, careerList, certiList, codeList, speciality, centerCode }) => {
24
24
  const searchParams = useSearchParams();
25
25
  const targetRefs = {
26
26
  career: useRef(null),
@@ -96,7 +96,7 @@ const Detail = ({ lawyerInfo, careerList, certiList, codeList, speciality }) =>
96
96
  setIntegrateSearch(integrate_search ? String(integrate_search) : '');
97
97
  }, [searchParams]);
98
98
  return lawyerInfo ? (<section id={'sub_contents'} className={'pt-[200px] max-lg:pt-[180px] max-md:pt-[120px] max-sm:pt-[68px]'}>
99
- <BasicInfo codeList={codeList} lawyerInfo={lawyerInfo} integrateSearch={integrateSearch}/>
99
+ <BasicInfo centerCode={centerCode} codeList={codeList} lawyerInfo={lawyerInfo} integrateSearch={integrateSearch}/>
100
100
 
101
101
  {/*변호사 설명*/}
102
102
  <Introduce lawyerInfo={lawyerInfo} integrateSearch={integrateSearch}/>
@@ -19,6 +19,7 @@ export const Example1 = {
19
19
  }
20
20
  };
21
21
  const lawyerData = {
22
+ centerCode: 'CT0001',
22
23
  lawyerInfo: {
23
24
  l_id: 'tmp_20230405030258',
24
25
  l_name: '김국일',
@@ -2492,6 +2493,7 @@ const lawyerData = {
2492
2493
  ]
2493
2494
  };
2494
2495
  const lawyerData2 = {
2496
+ centerCode: 'CT0001',
2495
2497
  lawyerInfo: {
2496
2498
  l_id: 'tmp_20250305050552',
2497
2499
  l_name: '송진성',
@@ -31,6 +31,7 @@ export const Example1: Story = {
31
31
  };
32
32
 
33
33
  const lawyerData = {
34
+ centerCode: 'CT0001',
34
35
  lawyerInfo: {
35
36
  l_id: 'tmp_20230405030258',
36
37
  l_name: '김국일',
@@ -2506,6 +2507,7 @@ const lawyerData = {
2506
2507
  };
2507
2508
 
2508
2509
  const lawyerData2 = {
2510
+ centerCode: 'CT0001',
2509
2511
  lawyerInfo: {
2510
2512
  l_id: 'tmp_20250305050552',
2511
2513
  l_name: '송진성',
@@ -20,9 +20,10 @@ interface IDetailProps {
20
20
  speciality: ILawyerCareer[];
21
21
  certiList: ILawyerCerti[];
22
22
  codeList: ICommonCode[];
23
+ centerCode: string;
23
24
  }
24
25
 
25
- const Detail = ({ lawyerInfo, careerList, certiList, codeList, speciality }: IDetailProps) => {
26
+ const Detail = ({ lawyerInfo, careerList, certiList, codeList, speciality, centerCode }: IDetailProps) => {
26
27
  const searchParams = useSearchParams();
27
28
  const targetRefs = {
28
29
  career: useRef(null),
@@ -111,7 +112,12 @@ const Detail = ({ lawyerInfo, careerList, certiList, codeList, speciality }: IDe
111
112
 
112
113
  return lawyerInfo ? (
113
114
  <section id={'sub_contents'} className={'pt-[200px] max-lg:pt-[180px] max-md:pt-[120px] max-sm:pt-[68px]'}>
114
- <BasicInfo codeList={codeList} lawyerInfo={lawyerInfo} integrateSearch={integrateSearch} />
115
+ <BasicInfo
116
+ centerCode={centerCode}
117
+ codeList={codeList}
118
+ lawyerInfo={lawyerInfo}
119
+ integrateSearch={integrateSearch}
120
+ />
115
121
 
116
122
  {/*변호사 설명*/}
117
123
  <Introduce lawyerInfo={lawyerInfo} integrateSearch={integrateSearch} />
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
2
  import { ILawyer } from '../ILawyerDetailTypes';
3
- declare const BasicInfo: ({ lawyerInfo, codeList, integrateSearch }: {
3
+ declare const BasicInfo: ({ lawyerInfo, codeList, centerCode, integrateSearch }: {
4
4
  lawyerInfo: ILawyer;
5
5
  codeList: any[];
6
6
  integrateSearch: string;
7
+ centerCode: string;
7
8
  }) => React.JSX.Element;
8
9
  export default BasicInfo;
@@ -5,7 +5,8 @@ import { insert } from '../../../../lib/conversion';
5
5
  import * as gtag from '../../../../lib/gtag';
6
6
  import mobile from 'is-mobile';
7
7
  import { searchColorLawyerText } from '../../../common/integrate';
8
- const BasicInfo = ({ lawyerInfo, codeList, integrateSearch }) => {
8
+ const BasicInfo = ({ lawyerInfo, codeList, centerCode, integrateSearch }) => {
9
+ var _a, _b;
9
10
  const imagePath = process.env.NEXT_PUBLIC_S3_URL + '';
10
11
  const lawyerImagePath = imagePath + '/upload/lawyer';
11
12
  const [isMobile, setIsMobile] = useState(false);
@@ -32,7 +33,10 @@ const BasicInfo = ({ lawyerInfo, codeList, integrateSearch }) => {
32
33
  setIsMobile(is_mobile);
33
34
  }, []);
34
35
  useEffect(() => {
35
- const data = lawyerInfo.careers_summary ? lawyerInfo.careers_summary : lawyerInfo.l_ability;
36
+ var _a;
37
+ const data = ((_a = lawyerInfo.l_sort_center) === null || _a === void 0 ? void 0 : _a.includes(centerCode)) && lawyerInfo.careers_summary
38
+ ? lawyerInfo.careers_summary
39
+ : lawyerInfo.l_ability;
36
40
  if (data) {
37
41
  const flag1 = data.length > 30;
38
42
  const flag2 = (data === null || data === void 0 ? void 0 : data.split('\n').length) > 1 && (data === null || data === void 0 ? void 0 : data.split('\n')[0].length) > 14;
@@ -61,12 +65,12 @@ const BasicInfo = ({ lawyerInfo, codeList, integrateSearch }) => {
61
65
  <span className={'mb-1 block text-[70px] font-[800] leading-[1.14] tracking-[-0.9px] max-xl:text-[64px] max-lg:text-[60px] max-md2:mb-0 max-md2:text-[54px] max-xs:text-[40px] '}>
62
66
  {searchColorLawyerText(lawyerInfo.l_name, integrateSearch)}
63
67
  </span>
64
- {lawyerInfo.l_position || lawyerInfo.careers_summary ? (<span className={'text-[28px] font-[500] leading-[1.42] tracking-[-0.7px] ' +
68
+ {lawyerInfo.l_position ? (<span className={'text-[28px] font-[500] leading-[1.42] tracking-[-0.7px] ' +
65
69
  'max-xl:text-[26px] ' +
66
70
  'max-lg:text-[24px] ' +
67
71
  'max-md2:text-[22px] '}>
68
72
  &nbsp;
69
- {lawyerInfo.careers_summary ? lawyerInfo.careers_summary : lawyerInfo.l_position}
73
+ {searchColorLawyerText(lawyerInfo.l_position, integrateSearch)}
70
74
  </span>) : (<></>)}
71
75
  </p>
72
76
  {/*lawyer_code, l_ability, tel pc*/}
@@ -86,7 +90,9 @@ const BasicInfo = ({ lawyerInfo, codeList, integrateSearch }) => {
86
90
  </p>
87
91
  <h2 className={(cssFlag ? 'break-keep px-1 ' : 'whitespace-pre-wrap break-keep px-3 ') +
88
92
  'relative w-full font-[500]'}>
89
- {searchColorLawyerText(lawyerInfo.l_ability, integrateSearch)}
93
+ {searchColorLawyerText(((_a = lawyerInfo.l_sort_center) === null || _a === void 0 ? void 0 : _a.includes(centerCode)) && lawyerInfo.careers_summary
94
+ ? lawyerInfo.careers_summary
95
+ : lawyerInfo.l_ability, integrateSearch)}
90
96
 
91
97
  <span className={'absolute right-0 top-1/2 block h-[50px] w-[2px] -translate-y-1/2 bg-white bg-opacity-20'}></span>
92
98
  </h2>
@@ -107,9 +113,9 @@ const BasicInfo = ({ lawyerInfo, codeList, integrateSearch }) => {
107
113
  <span className={'text-[50px] font-[800] leading-[1.14] tracking-[-0.9px] max-md:text-[46px] max-xs:text-[40px] '}>
108
114
  {searchColorLawyerText(lawyerInfo.l_name, integrateSearch)}
109
115
  </span>
110
- {lawyerInfo.l_position || lawyerInfo.careers_summary ? (<span className={'text-[22px] font-[600] leading-[1.42] tracking-[-0.7px] max-xs:text-[20px] '}>
116
+ {lawyerInfo.l_position ? (<span className={'text-[22px] font-[600] leading-[1.42] tracking-[-0.7px] max-xs:text-[20px] '}>
111
117
  &nbsp;
112
- {lawyerInfo.careers_summary ? lawyerInfo.careers_summary : lawyerInfo.l_position}
118
+ {searchColorLawyerText(lawyerInfo.l_position, integrateSearch)}
113
119
  </span>) : (<></>)}
114
120
  </p>
115
121
 
@@ -118,7 +124,11 @@ const BasicInfo = ({ lawyerInfo, codeList, integrateSearch }) => {
118
124
  <p className={'font-[800]'}>
119
125
  {searchColorLawyerText(codeList.filter((item) => item.code === lawyerInfo.lawyer_code)[0].code_name, integrateSearch)}
120
126
  </p>
121
- <p className={'font-[500] max-2sm:whitespace-pre-wrap'}>{lawyerInfo.l_ability}</p>
127
+ <p className={'font-[500] max-2sm:whitespace-pre-wrap'}>
128
+ {searchColorLawyerText(((_b = lawyerInfo.l_sort_center) === null || _b === void 0 ? void 0 : _b.includes(centerCode)) && lawyerInfo.careers_summary
129
+ ? lawyerInfo.careers_summary
130
+ : lawyerInfo.l_ability, integrateSearch)}
131
+ </p>
122
132
  <p className={'flex items-center gap-2'}>
123
133
  {lawyerInfo.l_tel && (<Link href={'tel:' + lawyerInfo.l_tel} onClick={handleOnClickLawyerTel} className={'text-[16px] '} aria-label={lawyerInfo.l_name + '변호사에게 전화하기 ' + lawyerInfo.l_tel}>
124
134
  T.{' '}
@@ -10,11 +10,13 @@ import { searchColorLawyerText } from '../../../common/integrate';
10
10
  const BasicInfo = ({
11
11
  lawyerInfo,
12
12
  codeList,
13
+ centerCode,
13
14
  integrateSearch
14
15
  }: {
15
16
  lawyerInfo: ILawyer;
16
17
  codeList: any[];
17
18
  integrateSearch: string;
19
+ centerCode: string;
18
20
  }) => {
19
21
  const imagePath: string = process.env.NEXT_PUBLIC_S3_URL + '';
20
22
  const lawyerImagePath: string = imagePath + '/upload/lawyer';
@@ -46,7 +48,10 @@ const BasicInfo = ({
46
48
  }, []);
47
49
 
48
50
  useEffect(() => {
49
- const data = lawyerInfo.careers_summary ? lawyerInfo.careers_summary : lawyerInfo.l_ability;
51
+ const data =
52
+ lawyerInfo.l_sort_center?.includes(centerCode) && lawyerInfo.careers_summary
53
+ ? lawyerInfo.careers_summary
54
+ : lawyerInfo.l_ability;
50
55
  if (data) {
51
56
  const flag1: boolean = data.length > 30;
52
57
  const flag2: boolean = data?.split('\n').length > 1 && data?.split('\n')[0].length > 14;
@@ -113,7 +118,7 @@ const BasicInfo = ({
113
118
  >
114
119
  {searchColorLawyerText(lawyerInfo.l_name, integrateSearch)}
115
120
  </span>
116
- {lawyerInfo.l_position || lawyerInfo.careers_summary ? (
121
+ {lawyerInfo.l_position ? (
117
122
  <span
118
123
  className={
119
124
  'text-[28px] font-[500] leading-[1.42] tracking-[-0.7px] ' +
@@ -123,7 +128,7 @@ const BasicInfo = ({
123
128
  }
124
129
  >
125
130
  &nbsp;
126
- {lawyerInfo.careers_summary ? lawyerInfo.careers_summary : lawyerInfo.l_position}
131
+ {searchColorLawyerText(lawyerInfo.l_position, integrateSearch)}
127
132
  </span>
128
133
  ) : (
129
134
  <></>
@@ -161,7 +166,12 @@ const BasicInfo = ({
161
166
  'relative w-full font-[500]'
162
167
  }
163
168
  >
164
- {searchColorLawyerText(lawyerInfo.l_ability, integrateSearch)}
169
+ {searchColorLawyerText(
170
+ lawyerInfo.l_sort_center?.includes(centerCode) && lawyerInfo.careers_summary
171
+ ? lawyerInfo.careers_summary
172
+ : lawyerInfo.l_ability,
173
+ integrateSearch
174
+ )}
165
175
 
166
176
  <span
167
177
  className={
@@ -211,10 +221,10 @@ const BasicInfo = ({
211
221
  >
212
222
  {searchColorLawyerText(lawyerInfo.l_name, integrateSearch)}
213
223
  </span>
214
- {lawyerInfo.l_position || lawyerInfo.careers_summary ? (
224
+ {lawyerInfo.l_position ? (
215
225
  <span className={'text-[22px] font-[600] leading-[1.42] tracking-[-0.7px] max-xs:text-[20px] '}>
216
226
  &nbsp;
217
- {lawyerInfo.careers_summary ? lawyerInfo.careers_summary : lawyerInfo.l_position}
227
+ {searchColorLawyerText(lawyerInfo.l_position, integrateSearch)}
218
228
  </span>
219
229
  ) : (
220
230
  <></>
@@ -233,7 +243,14 @@ const BasicInfo = ({
233
243
  integrateSearch
234
244
  )}
235
245
  </p>
236
- <p className={'font-[500] max-2sm:whitespace-pre-wrap'}>{lawyerInfo.l_ability}</p>
246
+ <p className={'font-[500] max-2sm:whitespace-pre-wrap'}>
247
+ {searchColorLawyerText(
248
+ lawyerInfo.l_sort_center?.includes(centerCode) && lawyerInfo.careers_summary
249
+ ? lawyerInfo.careers_summary
250
+ : lawyerInfo.l_ability,
251
+ integrateSearch
252
+ )}
253
+ </p>
237
254
  <p className={'flex items-center gap-2'}>
238
255
  {lawyerInfo.l_tel && (
239
256
  <Link