@daeryun/dr_components 0.5.33 → 0.5.35

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.
@@ -2,26 +2,31 @@ import Link from 'next/link';
2
2
  import Image from 'next/image';
3
3
  import React, { useState } from 'react';
4
4
  import { searchColorLawyerText } from '../../../common/integrate';
5
- const MobileSpeciality = ({ speciality, codeList, maxLines, integrateSearch }) => {
5
+ import { Wrapper } from '../../../index';
6
+ const MobileSpeciality = ({ speciality, codeList, maxLines, integrateSearch, isUseWrapper }) => {
6
7
  const [mobileCareerViewMore, setMobileCareerViewMore] = useState(false);
7
- return (<section className={'mx-auto mt-[80px] max-w-screen-2xl ' +
8
- //1024px
9
- 'max-lg:mt-[60px] ' +
10
- //640px
11
- 'overflow-hidden max-sm:mt-[40px]'}>
12
- <div className={'relative mx-auto w-[90%]'}>
13
- {/*모바일 전문분야*/}
14
- <div className={'m-auto w-full sm:w-full lg:hidden'}>
15
- {speciality && speciality.length > 1 ? (<div className={''}>
16
- <div className={'mb-[10px] text-[20px] font-[700] tracking-[-1px]'} id="fields">
17
- 관련 업무분야
18
- </div>
8
+ const Container = ({ isUseWrapper, children }) => {
9
+ return isUseWrapper ? (<Wrapper className={'mt-20 overflow-hidden max-lg:mt-[60px] max-sm:mt-10'}>{children}</Wrapper>) : (<section className={'mx-auto mt-[80px] max-w-screen-2xl ' +
10
+ //1024px
11
+ 'max-lg:mt-[60px] ' +
12
+ //640px
13
+ 'overflow-hidden max-sm:mt-[40px]'}>
14
+ <div className={'relative mx-auto w-[90%]'}>{children}</div>
15
+ </section>);
16
+ };
17
+ return (<Container isUseWrapper={isUseWrapper}>
18
+ {/*모바일 전문분야*/}
19
+ <div className={'m-auto w-full sm:w-full lg:hidden'}>
20
+ {speciality && speciality.length > 1 ? (<div className={''}>
21
+ <div className={'mb-[10px] text-[20px] font-[700] tracking-[-1px]'} id="fields">
22
+ 관련 업무분야
23
+ </div>
19
24
 
20
- <div className={'mb-[10px] !max-h-fit overflow-hidden'} style={{
25
+ <div className={'mb-[10px] !max-h-fit overflow-hidden'} style={{
21
26
  height: maxLines < 80 || mobileCareerViewMore ? maxLines + 'px' : '80px'
22
27
  }}>
23
- <ul className={'h-fit w-full'} id={'field_box'}>
24
- {speciality.map((item, index) => {
28
+ <ul className={'h-fit w-full'} id={'field_box'}>
29
+ {speciality.map((item, index) => {
25
30
  // prettier-ignore
26
31
  const url = codeList.filter(c => c.parent_code === 'center' && c.code_name.includes(item.career_txt)) && codeList.filter(c => c.parent_code === 'center' && c.code_name.includes(item.career_txt)).length > 0
27
32
  ? codeList.filter(c => c.parent_code === 'center' && c.code_name.includes(item.career_txt))[0].etc2
@@ -30,28 +35,27 @@ const MobileSpeciality = ({ speciality, codeList, maxLines, integrateSearch }) =
30
35
  ? item.career_txt.replace('일반소송', '민사').replace('중재', '손해배상')
31
36
  : '';
32
37
  return (<li className={'mr-[5px] mt-[5px] inline-block basis-[100%] flex-wrap rounded-[20px] border-[1px] border-solid border-[#dfdfdf] px-[10px] py-[4px] text-[16px] font-[700] tracking-[-0.9px] text-[#555] '} key={`li_key_${item}_${index}`}>
33
- <Link href={url} target={'_blank'} key={`a_key_${item}_${index}`}>
34
- <span className={'flex items-center gap-[2px]'}>
35
- <Image src={'https://d1tgonli21s4df.cloudfront.net/lawyer/hover_off.webp'} alt={careerTxt + '전문변호사'} width={6} height={6}/>
36
- {searchColorLawyerText(careerTxt, integrateSearch)}
37
- </span>
38
- </Link>
39
- </li>);
38
+ <Link href={url} target={'_blank'} key={`a_key_${item}_${index}`}>
39
+ <span className={'flex items-center gap-[2px]'}>
40
+ <Image src={'https://d1tgonli21s4df.cloudfront.net/lawyer/hover_off.webp'} alt={careerTxt + '전문변호사'} width={6} height={6}/>
41
+ {searchColorLawyerText(careerTxt, integrateSearch)}
42
+ </span>
43
+ </Link>
44
+ </li>);
40
45
  })}
41
- </ul>
42
- </div>
43
- <span className={'mb-[10px] block w-full'}>
44
- <button onClick={() => {
46
+ </ul>
47
+ </div>
48
+ <span className={'mb-[10px] block w-full'}>
49
+ <button onClick={() => {
45
50
  setMobileCareerViewMore(true);
46
51
  }} className={`${mobileCareerViewMore || maxLines <= 80 ? 'hidden ' : 'block '}` +
47
52
  'mx-auto mt-[20px] w-fit rounded-[20px] border-[1px] border-solid border-[#767676] bg-[#767676] px-[20px] py-[4px] text-[16px] font-[700] tracking-[-0.9px] text-[#fff] ' +
48
53
  'before:absolute before:bottom-[17px] before:left-[-50px] before:-z-10 before:block before:h-[1px] before:w-[1100px] before:bg-[#ddd] before:content-[""]'}>
49
- 더보기 +
50
- </button>
51
- </span>
52
- </div>) : ('')}
53
- </div>
54
+ 더보기 +
55
+ </button>
56
+ </span>
57
+ </div>) : ('')}
54
58
  </div>
55
- </section>);
59
+ </Container>);
56
60
  };
57
61
  export default MobileSpeciality;
@@ -4,108 +4,120 @@ import React, { useState } from 'react';
4
4
 
5
5
  import { ILawyerCareer } from '../ILawyerDetailTypes';
6
6
  import { searchColorLawyerText } from '../../../common/integrate';
7
+ import { Wrapper } from '../../../index';
7
8
 
8
9
  const MobileSpeciality = ({
9
10
  speciality,
10
11
  codeList,
11
12
  maxLines,
12
- integrateSearch
13
+ integrateSearch,
14
+ isUseWrapper
13
15
  }: {
16
+ isUseWrapper?: boolean;
14
17
  speciality: ILawyerCareer[];
15
18
  maxLines: number;
16
19
  codeList: any[];
17
20
  integrateSearch: string;
18
21
  }) => {
19
22
  const [mobileCareerViewMore, setMobileCareerViewMore] = useState<boolean>(false);
23
+
24
+ const Container = ({ isUseWrapper, children }: { isUseWrapper?: boolean; children: React.ReactNode }) => {
25
+ return isUseWrapper ? (
26
+ <Wrapper className={'mt-20 overflow-hidden max-lg:mt-[60px] max-sm:mt-10'}>{children}</Wrapper>
27
+ ) : (
28
+ <section
29
+ className={
30
+ 'mx-auto mt-[80px] max-w-screen-2xl ' +
31
+ //1024px
32
+ 'max-lg:mt-[60px] ' +
33
+ //640px
34
+ 'overflow-hidden max-sm:mt-[40px]'
35
+ }
36
+ >
37
+ <div className={'relative mx-auto w-[90%]'}>{children}</div>
38
+ </section>
39
+ );
40
+ };
41
+
20
42
  return (
21
- <section
22
- className={
23
- 'mx-auto mt-[80px] max-w-screen-2xl ' +
24
- //1024px
25
- 'max-lg:mt-[60px] ' +
26
- //640px
27
- 'overflow-hidden max-sm:mt-[40px]'
28
- }
29
- >
30
- <div className={'relative mx-auto w-[90%]'}>
31
- {/*모바일 전문분야*/}
32
- <div className={'m-auto w-full sm:w-full lg:hidden'}>
33
- {speciality && speciality.length > 1 ? (
34
- <div className={''}>
35
- <div className={'mb-[10px] text-[20px] font-[700] tracking-[-1px]'} id="fields">
36
- 관련 업무분야
37
- </div>
43
+ <Container isUseWrapper={isUseWrapper}>
44
+ {/*모바일 전문분야*/}
45
+ <div className={'m-auto w-full sm:w-full lg:hidden'}>
46
+ {speciality && speciality.length > 1 ? (
47
+ <div className={''}>
48
+ <div className={'mb-[10px] text-[20px] font-[700] tracking-[-1px]'} id="fields">
49
+ 관련 업무분야
50
+ </div>
38
51
 
39
- <div
40
- className={'mb-[10px] !max-h-fit overflow-hidden'}
41
- style={{
42
- height: maxLines < 80 || mobileCareerViewMore ? maxLines + 'px' : '80px'
43
- }}
44
- >
45
- <ul className={'h-fit w-full'} id={'field_box'}>
46
- {speciality.map((item, index: number) => {
47
- // prettier-ignore
48
- const url = codeList.filter(c => c.parent_code === 'center' && c.code_name.includes(item.career_txt)) && codeList.filter(c => c.parent_code === 'center' && c.code_name.includes(item.career_txt)).length > 0
52
+ <div
53
+ className={'mb-[10px] !max-h-fit overflow-hidden'}
54
+ style={{
55
+ height: maxLines < 80 || mobileCareerViewMore ? maxLines + 'px' : '80px'
56
+ }}
57
+ >
58
+ <ul className={'h-fit w-full'} id={'field_box'}>
59
+ {speciality.map((item, index: number) => {
60
+ // prettier-ignore
61
+ const url = codeList.filter(c => c.parent_code === 'center' && c.code_name.includes(item.career_txt)) && codeList.filter(c => c.parent_code === 'center' && c.code_name.includes(item.career_txt)).length > 0
49
62
  ? codeList.filter(c => c.parent_code === 'center' && c.code_name.includes(item.career_txt))[0].etc2
50
63
  : 'https://www.daeryunlaw.com/';
51
64
 
52
- const careerTxt = item.career_txt
53
- ? item.career_txt.replace('일반소송', '민사').replace('중재', '손해배상')
54
- : '';
65
+ const careerTxt = item.career_txt
66
+ ? item.career_txt.replace('일반소송', '민사').replace('중재', '손해배상')
67
+ : '';
55
68
 
56
- return (
57
- <li
58
- className={
59
- 'mr-[5px] mt-[5px] inline-block basis-[100%] flex-wrap rounded-[20px] border-[1px] border-solid border-[#dfdfdf] px-[10px] py-[4px] text-[16px] font-[700] tracking-[-0.9px] text-[#555] '
60
- }
61
- key={`li_key_${item}_${index}`}
69
+ return (
70
+ <li
71
+ className={
72
+ 'mr-[5px] mt-[5px] inline-block basis-[100%] flex-wrap rounded-[20px] border-[1px] border-solid border-[#dfdfdf] px-[10px] py-[4px] text-[16px] font-[700] tracking-[-0.9px] text-[#555] '
73
+ }
74
+ key={`li_key_${item}_${index}`}
75
+ >
76
+ <Link
77
+ href={url}
78
+ target={'_blank'}
79
+ key={`a_key_${item}_${index}`}
80
+ // className={
81
+ // 'mr-[5px] mt-[5px] inline-block basis-[100%] flex-wrap rounded-[20px] border-[1px] border-solid border-[#dfdfdf] px-[10px] py-[4px] text-[16px] font-[700] tracking-[-0.9px] text-[#555] '
82
+ // }
62
83
  >
63
- <Link
64
- href={url}
65
- target={'_blank'}
66
- key={`a_key_${item}_${index}`}
67
- // className={
68
- // 'mr-[5px] mt-[5px] inline-block basis-[100%] flex-wrap rounded-[20px] border-[1px] border-solid border-[#dfdfdf] px-[10px] py-[4px] text-[16px] font-[700] tracking-[-0.9px] text-[#555] '
69
- // }
70
- >
71
- <span className={'flex items-center gap-[2px]'}>
72
- <Image
73
- src={
74
- 'https://d1tgonli21s4df.cloudfront.net/lawyer/hover_off.webp'
75
- }
76
- alt={careerTxt + '전문변호사'}
77
- width={6}
78
- height={6}
79
- />
80
- {searchColorLawyerText(careerTxt, integrateSearch)}
81
- </span>
82
- </Link>
83
- </li>
84
- );
85
- })}
86
- </ul>
87
- </div>
88
- <span className={'mb-[10px] block w-full'}>
89
- <button
90
- onClick={() => {
91
- setMobileCareerViewMore(true);
92
- }}
93
- className={
94
- `${mobileCareerViewMore || maxLines <= 80 ? 'hidden ' : 'block '}` +
95
- 'mx-auto mt-[20px] w-fit rounded-[20px] border-[1px] border-solid border-[#767676] bg-[#767676] px-[20px] py-[4px] text-[16px] font-[700] tracking-[-0.9px] text-[#fff] ' +
96
- 'before:absolute before:bottom-[17px] before:left-[-50px] before:-z-10 before:block before:h-[1px] before:w-[1100px] before:bg-[#ddd] before:content-[""]'
97
- }
98
- >
99
- 더보기 +
100
- </button>
101
- </span>
84
+ <span className={'flex items-center gap-[2px]'}>
85
+ <Image
86
+ src={
87
+ 'https://d1tgonli21s4df.cloudfront.net/lawyer/hover_off.webp'
88
+ }
89
+ alt={careerTxt + '전문변호사'}
90
+ width={6}
91
+ height={6}
92
+ />
93
+ {searchColorLawyerText(careerTxt, integrateSearch)}
94
+ </span>
95
+ </Link>
96
+ </li>
97
+ );
98
+ })}
99
+ </ul>
102
100
  </div>
103
- ) : (
104
- ''
105
- )}
106
- </div>
101
+ <span className={'mb-[10px] block w-full'}>
102
+ <button
103
+ onClick={() => {
104
+ setMobileCareerViewMore(true);
105
+ }}
106
+ className={
107
+ `${mobileCareerViewMore || maxLines <= 80 ? 'hidden ' : 'block '}` +
108
+ 'mx-auto mt-[20px] w-fit rounded-[20px] border-[1px] border-solid border-[#767676] bg-[#767676] px-[20px] py-[4px] text-[16px] font-[700] tracking-[-0.9px] text-[#fff] ' +
109
+ 'before:absolute before:bottom-[17px] before:left-[-50px] before:-z-10 before:block before:h-[1px] before:w-[1100px] before:bg-[#ddd] before:content-[""]'
110
+ }
111
+ >
112
+ 더보기 +
113
+ </button>
114
+ </span>
115
+ </div>
116
+ ) : (
117
+ ''
118
+ )}
107
119
  </div>
108
- </section>
120
+ </Container>
109
121
  );
110
122
  };
111
123
 
@@ -9508,6 +9508,11 @@ body {
9508
9508
  padding-right: 35px;
9509
9509
  }
9510
9510
 
9511
+ .max-md\:py-10 {
9512
+ padding-top: 2.5rem;
9513
+ padding-bottom: 2.5rem;
9514
+ }
9515
+
9511
9516
  .max-md\:py-\[100px\] {
9512
9517
  padding-top: 100px;
9513
9518
  padding-bottom: 100px;
@@ -9836,6 +9841,10 @@ body {
9836
9841
  margin-left: 26px;
9837
9842
  }
9838
9843
 
9844
+ .max-sm\:mt-10 {
9845
+ margin-top: 2.5rem;
9846
+ }
9847
+
9839
9848
  .max-sm\:mt-\[100px\] {
9840
9849
  margin-top: 100px;
9841
9850
  }