@daeryun/dr_components 0.4.43 → 0.4.45

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,7 +1,7 @@
1
1
  import React, { RefObject, useEffect, useRef, useState } from 'react';
2
2
  import { NoResult } from './NoResult';
3
3
  import { Title } from './Title';
4
- import { IListPagesType, IListTypes } from './integrateType';
4
+ import { ILawyerTypes, IListPagesType, IListTypes } from './integrateType';
5
5
  import { ViewMore } from './ViewMore';
6
6
 
7
7
  import * as gtag from '../../../lib/gtag';
@@ -12,23 +12,6 @@ import Image from 'next/image';
12
12
  import style from './index.module.css';
13
13
  import Mark from '../../Mark/Mark';
14
14
 
15
- export interface LawyerData {
16
- id: string;
17
- name: string;
18
- image: string;
19
- code: string;
20
- array_to_string: string;
21
- careers_summary?: string;
22
- ability: string;
23
- mark: string;
24
- tel: string | null;
25
- l_sort_center: string[] | null;
26
- exist_l_sort_center: string[] | null;
27
- l_position: string | null;
28
- email: string | null;
29
- group_career: string | null;
30
- }
31
-
32
15
  const Lawyer = (props: {
33
16
  tab: string;
34
17
  onMoreViewText: (str: string) => void;
@@ -83,31 +66,12 @@ const Lawyer = (props: {
83
66
  >
84
67
  {(tab === '전체' ? list.lawyerList.slice(0, 8) : list.lawyerList).map(
85
68
  (item, index: number) => {
86
- const newItem: ILawyerProData = {
87
- id: item.id,
88
- name: item.name,
89
- image: item.nukki ?? '',
90
- code: item.code,
91
- group_career: item.group_career,
92
- array_to_string: item.careers,
93
- careers_summary: item.careers_summary,
94
- ability: item.ability,
95
- mark: item.mark,
96
- tel: item.tel,
97
- l_position: item.position,
98
- email: item.email,
99
- l_sort_center: item.l_sort_center,
100
- exist_l_sort_center: item.exist_l_sort_center,
101
- thumbnail: item.image
102
- };
103
-
104
69
  return (
105
70
  <LawyerContainer
106
71
  key={item.id}
107
72
  center_code={props.center_code}
108
- item={newItem}
73
+ item={item}
109
74
  lawyerImagePath={lawyerImagePath}
110
- specialtyArr={item.l_sort_center ? item.l_sort_center : []}
111
75
  firstAddRef={
112
76
  index === 0 || (index > 12 && index === list.lawyerList.length - 12)
113
77
  ? firstAddRef
@@ -142,7 +106,7 @@ const Lawyer = (props: {
142
106
 
143
107
  export default Lawyer;
144
108
 
145
- interface ILawyerProData extends LawyerData {
109
+ interface ILawyerProData extends ILawyerTypes {
146
110
  thumbnail?: string;
147
111
  }
148
112
 
@@ -151,20 +115,11 @@ const LawyerContainer = (props: {
151
115
  lawyerImagePath: string;
152
116
  center_code: string;
153
117
  selectedFilter?: string; // 이미지 alt 용
154
- specialtyArr?: string[]; // 업무 분야
155
118
  onClickTel?: () => void; // 전화번호 클릭 이벤트
156
119
  isPro?: boolean; // true 일 시 특수분야 전문가
157
120
  firstAddRef?: RefObject<HTMLAnchorElement> | null; //통합검색용 접근성
158
121
  }) => {
159
- const {
160
- item,
161
- lawyerImagePath,
162
- selectedFilter = '',
163
- specialtyArr = [],
164
- onClickTel,
165
- isPro = false,
166
- firstAddRef = null
167
- } = props;
122
+ const { item, lawyerImagePath, selectedFilter = '', onClickTel, isPro = false, firstAddRef = null } = props;
168
123
  const router = useRouter();
169
124
 
170
125
  const MailClick = () => {
@@ -189,17 +144,17 @@ const LawyerContainer = (props: {
189
144
  <div className={'relative flex items-center justify-center bg-[#F8F8F8]'}>
190
145
  <Image
191
146
  loading={'lazy'}
192
- src={lawyerImagePath + '/' + item.image}
147
+ src={lawyerImagePath + '/' + item.nukki}
193
148
  alt={
194
- item.array_to_string &&
195
- item.array_to_string.indexOf(selectedFilter) > -1 &&
149
+ item.careers &&
150
+ item.careers.indexOf(selectedFilter) > -1 &&
196
151
  selectedFilter !== '전체'
197
152
  ? `${selectedFilter}전문변호사 ${item.name} ${item.code}`
198
153
  : `${item.name} ${item.code}`
199
154
  }
200
155
  title={
201
- item.array_to_string &&
202
- item.array_to_string.indexOf(selectedFilter) > -1 &&
156
+ item.careers &&
157
+ item.careers.indexOf(selectedFilter) > -1 &&
203
158
  selectedFilter !== '전체'
204
159
  ? `${selectedFilter}전문변호사 ${item.name} ${item.code}`
205
160
  : `${item.name} ${item.code}`
@@ -253,13 +208,13 @@ const LawyerContainer = (props: {
253
208
  {item.code}
254
209
  </p>
255
210
 
256
- {item.l_position ? (
211
+ {item.position ? (
257
212
  <p
258
213
  className={
259
214
  ' bg-[#F7FBFF] py-1 text-[14px] font-[600] tracking-[-1px] text-[#454545] lg:text-[18px]'
260
215
  }
261
216
  >
262
- {item.l_position}
217
+ {item.position}
263
218
  </p>
264
219
  ) : (
265
220
  <div className={'h-[35px] max-lg:hidden'}></div>
@@ -330,14 +285,18 @@ const LawyerContainer = (props: {
330
285
  <></>
331
286
  )}
332
287
  </span>
333
- {specialtyArr.length > 1 ? (
288
+ {item.careers && item.careers != '' ? (
334
289
  <div className={'relative mt-2 border-t border-solid border-[#D0D0D0]'}>
335
290
  <p
336
291
  className={
337
292
  'mt-3 line-clamp-1 text-ellipsis text-[14px] font-medium text-[#6e6e6e] lg:text-[18px]'
338
293
  }
339
294
  >
340
- {specialtyArr.join('·')} 전문
295
+ {item.careers
296
+ .replaceAll(',', '')
297
+ .replace('일반소송', '민사')
298
+ .replace('중재', '손해배상')}
299
+ 전문
341
300
  </p>
342
301
  </div>
343
302
  ) : (
@@ -62,7 +62,8 @@ export const Default = {
62
62
  mandate_cnt: 30505,
63
63
  consult_cnt_day: 175,
64
64
  mandate_cnt_day: 73,
65
- month_business_day: '2024년 11월 영업일 기준'
65
+ month_business_day: '2024년 11월 영업일 기준',
66
+ current_month: 3
66
67
  }
67
68
  }
68
69
  };
@@ -69,7 +69,8 @@ export const Default: Story = {
69
69
  mandate_cnt: 30505,
70
70
  consult_cnt_day: 175,
71
71
  mandate_cnt_day: 73,
72
- month_business_day: '2024년 11월 영업일 기준'
72
+ month_business_day: '2024년 11월 영업일 기준',
73
+ current_month: 3
73
74
  }
74
75
  }
75
76
  };
@@ -77,8 +77,8 @@ const ListSection = ({ initialData, item, index }) => {
77
77
  <div className={'relative flex min-h-[285px] flex-col gap-11 bg-[#F5F5F5] py-[40px] max-3xl:min-h-[210px] max-lg:min-h-[unset] max-md:gap-[23px] max-md:py-[30px]'}>
78
78
  {/*배경*/}
79
79
  <div className={'absolute top-0 h-full w-[300vw] translate-x-[-50%] bg-[#F5F5F5]'}></div>
80
- {item.list.map((list, index) => {
81
- return (<span key={index} className={'relative z-10 break-keep'}>
80
+ {item.list.map((list, idx) => {
81
+ return (<span key={idx} className={'relative z-10 break-keep'}>
82
82
  {list.liTitle.length > 0 ? (<h3 className={'mb-[22px] text-[24px] font-bold leading-tight tracking-[-0.96px] ' +
83
83
  'max-4xl:text-[22px] ' +
84
84
  'max-xxl:text-[20px] ' +
@@ -86,6 +86,10 @@ const ListSection = ({ initialData, item, index }) => {
86
86
  'max-md2:text-[20px] ' +
87
87
  'max-md:mb-[16px] max-md:tracking-[-1px]'}>
88
88
  {replaceInitialData(list.liTitle, initialData)}
89
+
90
+ <span className={'text-[13px] text-[#919191]'}>
91
+ <span>&nbsp; &nbsp; *2025년 {initialData.current_month}월 기준</span>
92
+ </span>
89
93
  </h3>) : (<></>)}
90
94
 
91
95
  <ul key={'ul_' + index} className={(isOdd ? 'w-[96.5%]' : '') + ' list-outside list-["-__"] pl-[22px]'}>
@@ -141,9 +141,9 @@ const ListSection = ({
141
141
  >
142
142
  {/*배경*/}
143
143
  <div className={'absolute top-0 h-full w-[300vw] translate-x-[-50%] bg-[#F5F5F5]'}></div>
144
- {item.list.map((list, index) => {
144
+ {item.list.map((list, idx) => {
145
145
  return (
146
- <span key={index} className={'relative z-10 break-keep'}>
146
+ <span key={idx} className={'relative z-10 break-keep'}>
147
147
  {list.liTitle.length > 0 ? (
148
148
  <h3
149
149
  className={
@@ -156,6 +156,10 @@ const ListSection = ({
156
156
  }
157
157
  >
158
158
  {replaceInitialData(list.liTitle, initialData)}
159
+
160
+ <span className={'text-[13px] text-[#919191]'}>
161
+ <span>&nbsp; &nbsp; *2025년 {initialData.current_month}월 기준</span>
162
+ </span>
159
163
  </h3>
160
164
  ) : (
161
165
  <></>