@daeryun/dr_components 0.4.38 → 0.4.39
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.
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/common/integrate/index.d.ts +12 -0
- package/dist/components/common/integrate/index.jsx +71 -0
- package/dist/components/common/integrate/index.tsx +79 -0
- package/dist/components/page/Integrate/Broadcast.d.ts +20 -0
- package/dist/components/page/Integrate/Broadcast.jsx +107 -0
- package/dist/components/page/Integrate/Broadcast.tsx +246 -0
- package/dist/components/page/Integrate/Field.d.ts +21 -0
- package/dist/components/page/Integrate/Field.jsx +53 -0
- package/dist/components/page/Integrate/Field.tsx +119 -0
- package/dist/components/page/Integrate/LawInfo.d.ts +21 -0
- package/dist/components/page/Integrate/LawInfo.jsx +40 -0
- package/dist/components/page/Integrate/LawInfo.tsx +116 -0
- package/dist/components/page/Integrate/Map.d.ts +20 -0
- package/dist/components/page/Integrate/Map.jsx +131 -0
- package/dist/components/page/Integrate/Map.tsx +266 -0
- package/dist/components/page/Integrate/MenuTab.d.ts +18 -0
- package/dist/components/page/Integrate/MenuTab.jsx +90 -0
- package/dist/components/page/Integrate/MenuTab.tsx +160 -0
- package/dist/components/page/Integrate/NoResult.d.ts +2 -0
- package/dist/components/page/Integrate/NoResult.jsx +14 -0
- package/dist/components/page/Integrate/NoResult.tsx +23 -0
- package/dist/components/page/Integrate/Reply.d.ts +21 -0
- package/dist/components/page/Integrate/Reply.jsx +68 -0
- package/dist/components/page/Integrate/Reply.tsx +162 -0
- package/dist/components/page/Integrate/SearchData.d.ts +19 -0
- package/dist/components/page/Integrate/SearchData.jsx +166 -0
- package/dist/components/page/Integrate/SearchData.tsx +273 -0
- package/dist/components/page/Integrate/Success.d.ts +21 -0
- package/dist/components/page/Integrate/Success.jsx +74 -0
- package/dist/components/page/Integrate/Success.tsx +167 -0
- package/dist/components/page/Integrate/Title.d.ts +10 -0
- package/dist/components/page/Integrate/Title.jsx +27 -0
- package/dist/components/page/Integrate/Title.tsx +62 -0
- package/dist/components/page/Integrate/ViewMore.d.ts +9 -0
- package/dist/components/page/Integrate/ViewMore.jsx +28 -0
- package/dist/components/page/Integrate/ViewMore.tsx +66 -0
- package/dist/components/page/Integrate/integrateType.d.ts +159 -0
- package/dist/components/page/Integrate/integrateType.js +30 -0
- package/dist/components/page/Integrate/integrateType.ts +171 -0
- package/dist/components/page/index.d.ts +2 -0
- package/dist/components/page/index.js +2 -0
- package/dist/components/page/index.ts +2 -0
- package/dist/styles/globals.css +938 -158
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import { NoResult } from './NoResult';
|
|
5
|
+
import dayjs from 'dayjs';
|
|
6
|
+
import { Title } from './Title';
|
|
7
|
+
import { ViewMore } from './ViewMore';
|
|
8
|
+
import { useTranslation } from 'next-i18next';
|
|
9
|
+
import { searchColorText } from '../../common/integrate';
|
|
10
|
+
import { htmlTagRemove } from '../../../lib';
|
|
11
|
+
const Broadcast = (props) => {
|
|
12
|
+
const { tab, onMoreViewText, list, pages, onMoreView, search, listCount } = props;
|
|
13
|
+
const [loading, setLoading] = useState(false);
|
|
14
|
+
const firstAddRef = useRef(null);
|
|
15
|
+
const { t } = useTranslation('common');
|
|
16
|
+
//
|
|
17
|
+
// useEffect(() => {
|
|
18
|
+
// if (list.broadcastList.length > 12) firstAddRef.current?.focus();
|
|
19
|
+
// }, [list.broadcastList]);
|
|
20
|
+
//
|
|
21
|
+
// useEffect(() => {
|
|
22
|
+
// if (tab === 'broadcast') firstAddRef.current?.focus();
|
|
23
|
+
// }, [tab]);
|
|
24
|
+
return (<>
|
|
25
|
+
{tab === '전체' || tab === 'broadcast' ? (tab === 'broadcast' && listCount.broadcast < 1 ? (<NoResult />) : (<>
|
|
26
|
+
{listCount.broadcast > 0 ? (<div className={'mb-[180px] max-sm:mb-[100px] max-xs:mb-[50px]'}>
|
|
27
|
+
<Title title={'언론보도'} tab={tab} type={'broadcast'} onClick={str => onMoreViewText(str)} count={listCount.broadcast}/>
|
|
28
|
+
|
|
29
|
+
<div className={'m-auto grid w-full grid-cols-2 gap-10 max-lg:flex max-lg:flex-col max-lg:gap-0'}>
|
|
30
|
+
{(tab === '전체' ? list.broadcastList.slice(0, 4) : list.broadcastList).map((item, index) => {
|
|
31
|
+
return (<div key={item.id} className={'w-full lg:flex lg:flex-row lg:flex-wrap lg:justify-between'}>
|
|
32
|
+
{/*mobile*/}
|
|
33
|
+
<Link href={{
|
|
34
|
+
pathname: '/broadcast/' + item.id
|
|
35
|
+
}} className={'mx-auto flex flex-col items-center justify-center lg:hidden' +
|
|
36
|
+
(tab === '전체' && index === 3
|
|
37
|
+
? ''
|
|
38
|
+
: ' mb-10 max-sm:mb-5 sm:mt-8 ')}>
|
|
39
|
+
<div className={'flex w-[100%] items-center justify-center'}>
|
|
40
|
+
<Image
|
|
41
|
+
// src={imagePath + item.img}
|
|
42
|
+
src={'https://d1tgonli21s4df.cloudfront.net' + item.img} alt={item.alt} width={400} height={508}/>
|
|
43
|
+
</div>
|
|
44
|
+
<div className={'mt-4 flex w-[100%] flex-row items-center gap-4 leading-none sm:flex '}>
|
|
45
|
+
<div className={'text-[18px] font-medium text-[#285EA7] lg:text-[19px]'}>
|
|
46
|
+
{item.broadcast}
|
|
47
|
+
</div>
|
|
48
|
+
<div className={'text-[14px] text-[#666666] max-sm:pt-[1px] xs:text-[13px] sm:text-[14px] lg:text-[16px]'}>
|
|
49
|
+
{dayjs(item.timestamp).format('YYYY-MM-DD')}
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
<p className={'my-4 w-[100%] break-keep text-left text-[18px] font-[800] xs:my-8 xs:text-[20px] sm:mb-6 sm:mt-8 sm:text-[22px]'}>
|
|
53
|
+
{searchColorText(item.title, search)}
|
|
54
|
+
</p>
|
|
55
|
+
<div className={'mb-6 line-clamp-2 w-[100%] overflow-hidden text-ellipsis text-[#666666] sm:line-clamp-5'}>
|
|
56
|
+
{htmlTagRemove(item.summary)}
|
|
57
|
+
</div>
|
|
58
|
+
</Link>
|
|
59
|
+
|
|
60
|
+
{/*웹환경*/}
|
|
61
|
+
<Link href={{
|
|
62
|
+
pathname: '/broadcast/' + item.id
|
|
63
|
+
}} className={'h-[250px] w-full items-center justify-center max-lg:hidden lg:flex lg:flex-col '} key={item.id} ref={index === list.broadcastList.length - 12
|
|
64
|
+
? firstAddRef
|
|
65
|
+
: null}>
|
|
66
|
+
<div className={'my-4 flex w-full flex-row items-center justify-start gap-4'}>
|
|
67
|
+
<div className={'text-[14px] font-medium text-[#285EA7] lg:text-[19px]'}>
|
|
68
|
+
{item.broadcast}
|
|
69
|
+
</div>
|
|
70
|
+
<data className={'text-[14px] text-[#666666] lg:text-[16px]'}>
|
|
71
|
+
{dayjs(item.timestamp).format('YYYY-MM-DD')}
|
|
72
|
+
</data>
|
|
73
|
+
</div>
|
|
74
|
+
<div className={'relative flex w-full items-center justify-between'}>
|
|
75
|
+
<div className={'flex h-full w-[36%] max-xl:w-[50%]'}>
|
|
76
|
+
<span className={'relative flex h-[189px] w-full items-center justify-center overflow-hidden '}>
|
|
77
|
+
<Image
|
|
78
|
+
// src={imagePath + item.img}
|
|
79
|
+
src={'https://d1tgonli21s4df.cloudfront.net' +
|
|
80
|
+
item.img} alt={item.alt} className={'object-contain'} fill sizes="256px"/>
|
|
81
|
+
</span>
|
|
82
|
+
</div>
|
|
83
|
+
<div className={'flex h-full w-[60%] flex-col justify-center overflow-hidden max-xl:w-[46%]'}>
|
|
84
|
+
<div className={'line-clamp-3 w-full text-left text-[18px] font-semibold lg:text-[19px] xl:text-[22px] xxl:text-[24px] '}>
|
|
85
|
+
{searchColorText(item.title, search)}
|
|
86
|
+
</div>
|
|
87
|
+
<div className={'line-clamp-3 w-full overflow-hidden text-ellipsis py-3 text-[#666666] lg:text-[14px] xl:text-[16px]'}>
|
|
88
|
+
<span className={'line-clamp-3'}>
|
|
89
|
+
{htmlTagRemove(item.summary).replaceAll(' ', ' ')}
|
|
90
|
+
</span>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
</Link>
|
|
95
|
+
</div>);
|
|
96
|
+
})}
|
|
97
|
+
</div>
|
|
98
|
+
{tab != '전체' && (<ViewMore flag={list.broadcastList.length != listCount.broadcast} loading={loading} totalPage={Math.ceil(listCount.broadcast / 12)} nowPage={pages.broadcastList} func={() => {
|
|
99
|
+
setLoading(true);
|
|
100
|
+
onMoreView();
|
|
101
|
+
setLoading(false);
|
|
102
|
+
}}/>)}
|
|
103
|
+
</div>) : (<></>)}
|
|
104
|
+
</>)) : null}
|
|
105
|
+
</>);
|
|
106
|
+
};
|
|
107
|
+
export default Broadcast;
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import Link from 'next/link';
|
|
4
|
+
import Image from 'next/image';
|
|
5
|
+
import { NoResult } from './NoResult';
|
|
6
|
+
import dayjs from 'dayjs';
|
|
7
|
+
import { IListPagesType, IListTypes } from './integrateType';
|
|
8
|
+
import { Title } from './Title';
|
|
9
|
+
import { ViewMore } from './ViewMore';
|
|
10
|
+
import { useTranslation } from 'next-i18next';
|
|
11
|
+
import { searchColorText } from '../../common/integrate';
|
|
12
|
+
import { htmlTagRemove } from '../../../lib';
|
|
13
|
+
|
|
14
|
+
const Broadcast = (props: {
|
|
15
|
+
tab: string;
|
|
16
|
+
onMoreViewText: (str: string) => void;
|
|
17
|
+
onMoreView: () => void;
|
|
18
|
+
list: IListTypes;
|
|
19
|
+
pages: IListPagesType;
|
|
20
|
+
search: string;
|
|
21
|
+
listCount: {
|
|
22
|
+
lawyer: number;
|
|
23
|
+
field: number;
|
|
24
|
+
success: number;
|
|
25
|
+
info: number;
|
|
26
|
+
broadcast: number;
|
|
27
|
+
reply: number;
|
|
28
|
+
map: number;
|
|
29
|
+
};
|
|
30
|
+
}) => {
|
|
31
|
+
const { tab, onMoreViewText, list, pages, onMoreView, search, listCount } = props;
|
|
32
|
+
|
|
33
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
34
|
+
const firstAddRef = useRef<HTMLAnchorElement>(null);
|
|
35
|
+
|
|
36
|
+
const { t } = useTranslation('common');
|
|
37
|
+
//
|
|
38
|
+
// useEffect(() => {
|
|
39
|
+
// if (list.broadcastList.length > 12) firstAddRef.current?.focus();
|
|
40
|
+
// }, [list.broadcastList]);
|
|
41
|
+
//
|
|
42
|
+
// useEffect(() => {
|
|
43
|
+
// if (tab === 'broadcast') firstAddRef.current?.focus();
|
|
44
|
+
// }, [tab]);
|
|
45
|
+
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
{tab === '전체' || tab === 'broadcast' ? (
|
|
49
|
+
tab === 'broadcast' && listCount.broadcast < 1 ? (
|
|
50
|
+
<NoResult />
|
|
51
|
+
) : (
|
|
52
|
+
<>
|
|
53
|
+
{listCount.broadcast > 0 ? (
|
|
54
|
+
<div className={'mb-[180px] max-sm:mb-[100px] max-xs:mb-[50px]'}>
|
|
55
|
+
<Title
|
|
56
|
+
title={'언론보도'}
|
|
57
|
+
tab={tab}
|
|
58
|
+
type={'broadcast'}
|
|
59
|
+
onClick={str => onMoreViewText(str)}
|
|
60
|
+
count={listCount.broadcast}
|
|
61
|
+
/>
|
|
62
|
+
|
|
63
|
+
<div
|
|
64
|
+
className={
|
|
65
|
+
'm-auto grid w-full grid-cols-2 gap-10 max-lg:flex max-lg:flex-col max-lg:gap-0'
|
|
66
|
+
}
|
|
67
|
+
>
|
|
68
|
+
{(tab === '전체' ? list.broadcastList.slice(0, 4) : list.broadcastList).map(
|
|
69
|
+
(item, index: number) => {
|
|
70
|
+
return (
|
|
71
|
+
<div
|
|
72
|
+
key={item.id}
|
|
73
|
+
className={
|
|
74
|
+
'w-full lg:flex lg:flex-row lg:flex-wrap lg:justify-between'
|
|
75
|
+
}
|
|
76
|
+
>
|
|
77
|
+
{/*mobile*/}
|
|
78
|
+
<Link
|
|
79
|
+
href={{
|
|
80
|
+
pathname: '/broadcast/' + item.id
|
|
81
|
+
}}
|
|
82
|
+
className={
|
|
83
|
+
'mx-auto flex flex-col items-center justify-center lg:hidden' +
|
|
84
|
+
(tab === '전체' && index === 3
|
|
85
|
+
? ''
|
|
86
|
+
: ' mb-10 max-sm:mb-5 sm:mt-8 ')
|
|
87
|
+
}
|
|
88
|
+
>
|
|
89
|
+
<div className={'flex w-[100%] items-center justify-center'}>
|
|
90
|
+
<Image
|
|
91
|
+
// src={imagePath + item.img}
|
|
92
|
+
src={'https://d1tgonli21s4df.cloudfront.net' + item.img}
|
|
93
|
+
alt={item.alt}
|
|
94
|
+
width={400}
|
|
95
|
+
height={508}
|
|
96
|
+
/>
|
|
97
|
+
</div>
|
|
98
|
+
<div
|
|
99
|
+
className={
|
|
100
|
+
'mt-4 flex w-[100%] flex-row items-center gap-4 leading-none sm:flex '
|
|
101
|
+
}
|
|
102
|
+
>
|
|
103
|
+
<div
|
|
104
|
+
className={
|
|
105
|
+
'text-[18px] font-medium text-[#285EA7] lg:text-[19px]'
|
|
106
|
+
}
|
|
107
|
+
>
|
|
108
|
+
{item.broadcast}
|
|
109
|
+
</div>
|
|
110
|
+
<div
|
|
111
|
+
className={
|
|
112
|
+
'text-[14px] text-[#666666] max-sm:pt-[1px] xs:text-[13px] sm:text-[14px] lg:text-[16px]'
|
|
113
|
+
}
|
|
114
|
+
>
|
|
115
|
+
{dayjs(item.timestamp).format('YYYY-MM-DD')}
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
<p
|
|
119
|
+
className={
|
|
120
|
+
'my-4 w-[100%] break-keep text-left text-[18px] font-[800] xs:my-8 xs:text-[20px] sm:mb-6 sm:mt-8 sm:text-[22px]'
|
|
121
|
+
}
|
|
122
|
+
>
|
|
123
|
+
{searchColorText(item.title, search)}
|
|
124
|
+
</p>
|
|
125
|
+
<div
|
|
126
|
+
className={
|
|
127
|
+
'mb-6 line-clamp-2 w-[100%] overflow-hidden text-ellipsis text-[#666666] sm:line-clamp-5'
|
|
128
|
+
}
|
|
129
|
+
>
|
|
130
|
+
{htmlTagRemove(item.summary)}
|
|
131
|
+
</div>
|
|
132
|
+
</Link>
|
|
133
|
+
|
|
134
|
+
{/*웹환경*/}
|
|
135
|
+
<Link
|
|
136
|
+
href={{
|
|
137
|
+
pathname: '/broadcast/' + item.id
|
|
138
|
+
}}
|
|
139
|
+
className={
|
|
140
|
+
'h-[250px] w-full items-center justify-center max-lg:hidden lg:flex lg:flex-col '
|
|
141
|
+
}
|
|
142
|
+
key={item.id}
|
|
143
|
+
ref={
|
|
144
|
+
index === list.broadcastList.length - 12
|
|
145
|
+
? firstAddRef
|
|
146
|
+
: null
|
|
147
|
+
}
|
|
148
|
+
>
|
|
149
|
+
<div
|
|
150
|
+
className={
|
|
151
|
+
'my-4 flex w-full flex-row items-center justify-start gap-4'
|
|
152
|
+
}
|
|
153
|
+
>
|
|
154
|
+
<div
|
|
155
|
+
className={
|
|
156
|
+
'text-[14px] font-medium text-[#285EA7] lg:text-[19px]'
|
|
157
|
+
}
|
|
158
|
+
>
|
|
159
|
+
{item.broadcast}
|
|
160
|
+
</div>
|
|
161
|
+
<data
|
|
162
|
+
className={'text-[14px] text-[#666666] lg:text-[16px]'}
|
|
163
|
+
>
|
|
164
|
+
{dayjs(item.timestamp).format('YYYY-MM-DD')}
|
|
165
|
+
</data>
|
|
166
|
+
</div>
|
|
167
|
+
<div
|
|
168
|
+
className={
|
|
169
|
+
'relative flex w-full items-center justify-between'
|
|
170
|
+
}
|
|
171
|
+
>
|
|
172
|
+
<div className={'flex h-full w-[36%] max-xl:w-[50%]'}>
|
|
173
|
+
<span
|
|
174
|
+
className={
|
|
175
|
+
'relative flex h-[189px] w-full items-center justify-center overflow-hidden '
|
|
176
|
+
}
|
|
177
|
+
>
|
|
178
|
+
<Image
|
|
179
|
+
// src={imagePath + item.img}
|
|
180
|
+
src={
|
|
181
|
+
'https://d1tgonli21s4df.cloudfront.net' +
|
|
182
|
+
item.img
|
|
183
|
+
}
|
|
184
|
+
alt={item.alt}
|
|
185
|
+
className={'object-contain'}
|
|
186
|
+
fill
|
|
187
|
+
sizes="256px"
|
|
188
|
+
/>
|
|
189
|
+
</span>
|
|
190
|
+
</div>
|
|
191
|
+
<div
|
|
192
|
+
className={
|
|
193
|
+
'flex h-full w-[60%] flex-col justify-center overflow-hidden max-xl:w-[46%]'
|
|
194
|
+
}
|
|
195
|
+
>
|
|
196
|
+
<div
|
|
197
|
+
className={
|
|
198
|
+
'line-clamp-3 w-full text-left text-[18px] font-semibold lg:text-[19px] xl:text-[22px] xxl:text-[24px] '
|
|
199
|
+
}
|
|
200
|
+
>
|
|
201
|
+
{searchColorText(item.title, search)}
|
|
202
|
+
</div>
|
|
203
|
+
<div
|
|
204
|
+
className={
|
|
205
|
+
'line-clamp-3 w-full overflow-hidden text-ellipsis py-3 text-[#666666] lg:text-[14px] xl:text-[16px]'
|
|
206
|
+
}
|
|
207
|
+
>
|
|
208
|
+
<span className={'line-clamp-3'}>
|
|
209
|
+
{htmlTagRemove(item.summary).replaceAll(
|
|
210
|
+
' ',
|
|
211
|
+
' '
|
|
212
|
+
)}
|
|
213
|
+
</span>
|
|
214
|
+
</div>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
</Link>
|
|
218
|
+
</div>
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
)}
|
|
222
|
+
</div>
|
|
223
|
+
{tab != '전체' && (
|
|
224
|
+
<ViewMore
|
|
225
|
+
flag={list.broadcastList.length != listCount.broadcast}
|
|
226
|
+
loading={loading}
|
|
227
|
+
totalPage={Math.ceil(listCount.broadcast / 12)}
|
|
228
|
+
nowPage={pages.broadcastList}
|
|
229
|
+
func={() => {
|
|
230
|
+
setLoading(true);
|
|
231
|
+
onMoreView();
|
|
232
|
+
setLoading(false);
|
|
233
|
+
}}
|
|
234
|
+
/>
|
|
235
|
+
)}
|
|
236
|
+
</div>
|
|
237
|
+
) : (
|
|
238
|
+
<></>
|
|
239
|
+
)}
|
|
240
|
+
</>
|
|
241
|
+
)
|
|
242
|
+
) : null}
|
|
243
|
+
</>
|
|
244
|
+
);
|
|
245
|
+
};
|
|
246
|
+
export default Broadcast;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IListPagesType, IListTypes } from './integrateType';
|
|
3
|
+
declare const Field: (props: {
|
|
4
|
+
tab: string;
|
|
5
|
+
onMoreViewText: (str: string) => void;
|
|
6
|
+
onMoreView: () => void;
|
|
7
|
+
list: IListTypes;
|
|
8
|
+
pages: IListPagesType;
|
|
9
|
+
center_code: string;
|
|
10
|
+
search: string;
|
|
11
|
+
listCount: {
|
|
12
|
+
lawyer: number;
|
|
13
|
+
field: number;
|
|
14
|
+
success: number;
|
|
15
|
+
info: number;
|
|
16
|
+
broadcast: number;
|
|
17
|
+
reply: number;
|
|
18
|
+
map: number;
|
|
19
|
+
};
|
|
20
|
+
}) => React.JSX.Element;
|
|
21
|
+
export default Field;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
import { NoResult } from './NoResult';
|
|
4
|
+
import uuid from 'react-uuid';
|
|
5
|
+
import { ViewMore } from './ViewMore';
|
|
6
|
+
import { Title } from './Title';
|
|
7
|
+
import { useTranslation } from 'next-i18next';
|
|
8
|
+
import { searchColorText } from '../../common/integrate';
|
|
9
|
+
const Field = (props) => {
|
|
10
|
+
const { tab, onMoreViewText, list, pages, search, onMoreView, listCount } = props;
|
|
11
|
+
const [loading, setLoading] = useState(false);
|
|
12
|
+
const { t } = useTranslation('common');
|
|
13
|
+
const firstAddRef = useRef(null);
|
|
14
|
+
// useEffect(() => {
|
|
15
|
+
// if (list.fieldList.length > 48) firstAddRef.current?.focus();
|
|
16
|
+
// }, [list.fieldList]);
|
|
17
|
+
//
|
|
18
|
+
// useEffect(() => {
|
|
19
|
+
// if (tab === 'field') firstAddRef.current?.focus();
|
|
20
|
+
// }, [tab]);
|
|
21
|
+
return (<>
|
|
22
|
+
{tab === '전체' || tab === 'field' ? (tab === 'field' && listCount.field < 1 ? (<NoResult />) : (<>
|
|
23
|
+
{listCount.field > 0 ? (<div className={'mb-[180px] max-sm:mb-[100px] max-xs:mb-[50px]'}>
|
|
24
|
+
<Title title={'업무분야'} tab={tab} type={'field'} onClick={str => onMoreViewText(str)} count={listCount.field}/>
|
|
25
|
+
|
|
26
|
+
<div className={'my-4 grid gap-[16px] sm:m-2 sm:grid-cols-2 lg:grid-cols-3'}>
|
|
27
|
+
{(tab === '전체' ? list.fieldList.slice(0, 6) : list.fieldList).map((item, index) => {
|
|
28
|
+
return (<Link href={`${item.pathname}field_new/[idx]`} target={item.center_code === props.center_code ? '' : '_blank'} as={`${item.pathname}field_new/${item.idx}`} key={uuid()} ref={index === 0 ||
|
|
29
|
+
(index > 48 && index === list.fieldList.length - 48)
|
|
30
|
+
? firstAddRef
|
|
31
|
+
: null}>
|
|
32
|
+
<p className={'text-[20px] text-[#555555] max-xl:text-[18px] max-sm:text-[16px] max-xs:text-[15px]'}>
|
|
33
|
+
<span className={'mr-2 text-[#99999]'}>•</span>
|
|
34
|
+
업무분야
|
|
35
|
+
<span className={'mx-4 inline-block font-semibold'}>
|
|
36
|
+
{' '}
|
|
37
|
+
>{' '}
|
|
38
|
+
</span>
|
|
39
|
+
{searchColorText(item.title, search)}
|
|
40
|
+
</p>
|
|
41
|
+
</Link>);
|
|
42
|
+
})}
|
|
43
|
+
</div>
|
|
44
|
+
{tab != '전체' && (<ViewMore flag={list.fieldList.length != listCount.field} loading={loading} totalPage={Math.ceil(listCount.field / 50)} nowPage={pages.fieldList} func={() => {
|
|
45
|
+
setLoading(true);
|
|
46
|
+
onMoreView();
|
|
47
|
+
setLoading(false);
|
|
48
|
+
}}/>)}
|
|
49
|
+
</div>) : (<></>)}
|
|
50
|
+
</>)) : null}
|
|
51
|
+
</>);
|
|
52
|
+
};
|
|
53
|
+
export default Field;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
import { NoResult } from './NoResult';
|
|
4
|
+
import uuid from 'react-uuid';
|
|
5
|
+
import { IListPagesType, IListTypes } from './integrateType';
|
|
6
|
+
|
|
7
|
+
import { ViewMore } from './ViewMore';
|
|
8
|
+
import { Title } from './Title';
|
|
9
|
+
import { useTranslation } from 'next-i18next';
|
|
10
|
+
import { searchColorText } from '../../common/integrate';
|
|
11
|
+
const Field = (props: {
|
|
12
|
+
tab: string;
|
|
13
|
+
onMoreViewText: (str: string) => void;
|
|
14
|
+
onMoreView: () => void;
|
|
15
|
+
list: IListTypes;
|
|
16
|
+
pages: IListPagesType;
|
|
17
|
+
center_code: string;
|
|
18
|
+
search: string;
|
|
19
|
+
listCount: {
|
|
20
|
+
lawyer: number;
|
|
21
|
+
field: number;
|
|
22
|
+
success: number;
|
|
23
|
+
info: number;
|
|
24
|
+
broadcast: number;
|
|
25
|
+
reply: number;
|
|
26
|
+
map: number;
|
|
27
|
+
};
|
|
28
|
+
}) => {
|
|
29
|
+
const { tab, onMoreViewText, list, pages, search, onMoreView, listCount } = props;
|
|
30
|
+
|
|
31
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
32
|
+
|
|
33
|
+
const { t } = useTranslation('common');
|
|
34
|
+
const firstAddRef = useRef<HTMLAnchorElement>(null);
|
|
35
|
+
|
|
36
|
+
// useEffect(() => {
|
|
37
|
+
// if (list.fieldList.length > 48) firstAddRef.current?.focus();
|
|
38
|
+
// }, [list.fieldList]);
|
|
39
|
+
//
|
|
40
|
+
// useEffect(() => {
|
|
41
|
+
// if (tab === 'field') firstAddRef.current?.focus();
|
|
42
|
+
// }, [tab]);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<>
|
|
46
|
+
{tab === '전체' || tab === 'field' ? (
|
|
47
|
+
tab === 'field' && listCount.field < 1 ? (
|
|
48
|
+
<NoResult />
|
|
49
|
+
) : (
|
|
50
|
+
<>
|
|
51
|
+
{listCount.field > 0 ? (
|
|
52
|
+
<div className={'mb-[180px] max-sm:mb-[100px] max-xs:mb-[50px]'}>
|
|
53
|
+
<Title
|
|
54
|
+
title={'업무분야'}
|
|
55
|
+
tab={tab}
|
|
56
|
+
type={'field'}
|
|
57
|
+
onClick={str => onMoreViewText(str)}
|
|
58
|
+
count={listCount.field}
|
|
59
|
+
/>
|
|
60
|
+
|
|
61
|
+
<div className={'my-4 grid gap-[16px] sm:m-2 sm:grid-cols-2 lg:grid-cols-3'}>
|
|
62
|
+
{(tab === '전체' ? list.fieldList.slice(0, 6) : list.fieldList).map(
|
|
63
|
+
(item, index) => {
|
|
64
|
+
return (
|
|
65
|
+
<Link
|
|
66
|
+
href={`${item.pathname}field_new/[idx]`}
|
|
67
|
+
target={item.center_code === props.center_code ? '' : '_blank'}
|
|
68
|
+
as={`${item.pathname}field_new/${item.idx}`}
|
|
69
|
+
key={uuid()}
|
|
70
|
+
ref={
|
|
71
|
+
index === 0 ||
|
|
72
|
+
(index > 48 && index === list.fieldList.length - 48)
|
|
73
|
+
? firstAddRef
|
|
74
|
+
: null
|
|
75
|
+
}
|
|
76
|
+
>
|
|
77
|
+
<p
|
|
78
|
+
className={
|
|
79
|
+
'text-[20px] text-[#555555] max-xl:text-[18px] max-sm:text-[16px] max-xs:text-[15px]'
|
|
80
|
+
}
|
|
81
|
+
>
|
|
82
|
+
<span className={'mr-2 text-[#99999]'}>•</span>
|
|
83
|
+
업무분야
|
|
84
|
+
<span className={'mx-4 inline-block font-semibold'}>
|
|
85
|
+
{' '}
|
|
86
|
+
>{' '}
|
|
87
|
+
</span>
|
|
88
|
+
{searchColorText(item.title, search)}
|
|
89
|
+
</p>
|
|
90
|
+
</Link>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
)}
|
|
94
|
+
</div>
|
|
95
|
+
{tab != '전체' && (
|
|
96
|
+
<ViewMore
|
|
97
|
+
flag={list.fieldList.length != listCount.field}
|
|
98
|
+
loading={loading}
|
|
99
|
+
totalPage={Math.ceil(listCount.field / 50)}
|
|
100
|
+
nowPage={pages.fieldList}
|
|
101
|
+
func={() => {
|
|
102
|
+
setLoading(true);
|
|
103
|
+
onMoreView();
|
|
104
|
+
setLoading(false);
|
|
105
|
+
}}
|
|
106
|
+
/>
|
|
107
|
+
)}
|
|
108
|
+
</div>
|
|
109
|
+
) : (
|
|
110
|
+
<></>
|
|
111
|
+
)}
|
|
112
|
+
</>
|
|
113
|
+
)
|
|
114
|
+
) : null}
|
|
115
|
+
</>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export default Field;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IListPagesType, IListTypes } from './integrateType';
|
|
3
|
+
declare const LawInfo: (props: {
|
|
4
|
+
tab: string;
|
|
5
|
+
onMoreViewText: (str: string) => void;
|
|
6
|
+
onMoreView: () => void;
|
|
7
|
+
list: IListTypes;
|
|
8
|
+
pages: IListPagesType;
|
|
9
|
+
center_code: string;
|
|
10
|
+
listCount: {
|
|
11
|
+
lawyer: number;
|
|
12
|
+
field: number;
|
|
13
|
+
success: number;
|
|
14
|
+
info: number;
|
|
15
|
+
broadcast: number;
|
|
16
|
+
reply: number;
|
|
17
|
+
map: number;
|
|
18
|
+
};
|
|
19
|
+
search: string;
|
|
20
|
+
}) => React.JSX.Element;
|
|
21
|
+
export default LawInfo;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import Link from 'next/link';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import { NoResult } from './NoResult';
|
|
5
|
+
import { Title } from './Title';
|
|
6
|
+
import { ViewMore } from './ViewMore';
|
|
7
|
+
import { searchColorText } from '../../common/integrate';
|
|
8
|
+
const LawInfo = (props) => {
|
|
9
|
+
const { tab, onMoreViewText, list, pages, onMoreView, search, listCount } = props;
|
|
10
|
+
const [loading, setLoading] = useState(false);
|
|
11
|
+
const firstAddRef = useRef(null);
|
|
12
|
+
return (<>
|
|
13
|
+
{tab === '전체' || tab === 'info' ? (tab === 'info' && listCount.info < 1 ? (<NoResult />) : (<>
|
|
14
|
+
{listCount.info > 0 ? (<div className={'mb-[180px] max-sm:mb-[100px] max-xs:mb-[50px]'}>
|
|
15
|
+
<Title title={'법률정보'} tab={tab} type={'info'} onClick={str => onMoreViewText(str)} count={listCount.info}/>
|
|
16
|
+
|
|
17
|
+
<div className={'grid w-full gap-[40px] sm:grid-cols-2 sm:gap-[30px] lg:grid-cols-4 lg:gap-[16px]'}>
|
|
18
|
+
{(tab === '전체' ? list.infoList.slice(0, 4) : list.infoList).map((item, index) => {
|
|
19
|
+
return (<Link key={item.pathname + 'lawinfo_new/' + item.idx} href={item.pathname + 'lawinfo_new/' + item.idx} target={item.center_code === props.center_code ? '' : '_blank'} className={'mb-3 flex flex-col gap-3 overflow-hidden'} ref={index === 0 || (index > 12 && index === list.infoList.length - 12)
|
|
20
|
+
? firstAddRef
|
|
21
|
+
: null}>
|
|
22
|
+
<div className={'relative aspect-[1.47] w-full overflow-hidden max-sm:h-full max-sm:w-full'}>
|
|
23
|
+
<Image src={'https://d1tgonli21s4df.cloudfront.net' + item.img} alt={item.alt} fill sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 25vw" className={'h-full w-full object-contain '}/>
|
|
24
|
+
</div>
|
|
25
|
+
<p className={'mt-1 w-full text-[19px] text-black max-xl:text-[18px] max-sm:text-[16px] '}>
|
|
26
|
+
{searchColorText(item.title, search)}
|
|
27
|
+
</p>
|
|
28
|
+
</Link>);
|
|
29
|
+
})}
|
|
30
|
+
</div>
|
|
31
|
+
{tab != '전체' && (<ViewMore flag={list.infoList.length != listCount.info} loading={loading} totalPage={Math.ceil(listCount.info / 12)} nowPage={pages.infoList} func={() => {
|
|
32
|
+
setLoading(true);
|
|
33
|
+
onMoreView();
|
|
34
|
+
setLoading(false);
|
|
35
|
+
}}/>)}
|
|
36
|
+
</div>) : (<></>)}
|
|
37
|
+
</>)) : null}
|
|
38
|
+
</>);
|
|
39
|
+
};
|
|
40
|
+
export default LawInfo;
|