@daeryun/dr_components 0.4.38 → 0.4.40
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/Lawyer.d.ts +36 -0
- package/dist/components/page/Integrate/Lawyer.jsx +175 -0
- package/dist/components/page/Integrate/Lawyer.tsx +394 -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/index.module.css +915 -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 +1072 -161
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import { IListPagesType, IListTypes } from './integrateType';
|
|
2
|
+
import React, { useRef, useState } from 'react';
|
|
3
|
+
import Image from 'next/image';
|
|
4
|
+
import { useTranslation } from 'next-i18next';
|
|
5
|
+
import { NoResult } from './NoResult';
|
|
6
|
+
import { Title } from './Title';
|
|
7
|
+
import { ViewMore } from './ViewMore';
|
|
8
|
+
import { useRouter } from 'next/router';
|
|
9
|
+
import { searchColorText } from '../../common/integrate';
|
|
10
|
+
|
|
11
|
+
const Map = (props: {
|
|
12
|
+
tab: string;
|
|
13
|
+
onMoreViewText: (str: string) => void;
|
|
14
|
+
onMoreView: () => void;
|
|
15
|
+
list: IListTypes;
|
|
16
|
+
pages: IListPagesType;
|
|
17
|
+
search: string;
|
|
18
|
+
listCount: {
|
|
19
|
+
lawyer: number;
|
|
20
|
+
field: number;
|
|
21
|
+
success: number;
|
|
22
|
+
info: number;
|
|
23
|
+
broadcast: number;
|
|
24
|
+
reply: number;
|
|
25
|
+
map: number;
|
|
26
|
+
};
|
|
27
|
+
}) => {
|
|
28
|
+
const router = useRouter();
|
|
29
|
+
const { tab, onMoreViewText, list, pages } = props;
|
|
30
|
+
|
|
31
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
32
|
+
|
|
33
|
+
const firstAddRef = useRef<HTMLButtonElement>(null);
|
|
34
|
+
|
|
35
|
+
return props.tab === '전체' || props.tab === 'map' ? (
|
|
36
|
+
//구성원 탭에서는 결과 없음
|
|
37
|
+
tab === 'map' && props.listCount.map < 1 ? (
|
|
38
|
+
<NoResult />
|
|
39
|
+
) : (
|
|
40
|
+
<>
|
|
41
|
+
{/*전체 탭에서는 없게*/}
|
|
42
|
+
{props.listCount.map > 0 ? (
|
|
43
|
+
<div className={'mb-[180px] max-sm:mb-[100px] max-xs:mb-[50px]'}>
|
|
44
|
+
<Title
|
|
45
|
+
title={'오시는길'}
|
|
46
|
+
tab={tab}
|
|
47
|
+
type={'map'}
|
|
48
|
+
count={props.listCount.map}
|
|
49
|
+
onClick={async () => {
|
|
50
|
+
await router.push('/map');
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
|
|
54
|
+
<div className={'mt-[-1.5rem] w-full'}>
|
|
55
|
+
{(tab === '전체' && !props.search && list.mainMapList
|
|
56
|
+
? list.mainMapList.slice(0, 5)
|
|
57
|
+
: tab === '전체' && props.search
|
|
58
|
+
? list.mapList.slice(0, 5)
|
|
59
|
+
: list.mapList
|
|
60
|
+
).map((item, index: number) => {
|
|
61
|
+
return (
|
|
62
|
+
<div
|
|
63
|
+
key={'integrate_' + item.key}
|
|
64
|
+
className={
|
|
65
|
+
'group/mapBox flex gap-[60px] border-b-[1px] border-solid border-[#DDDDDD] hover:bg-[#FCFCFC] ' +
|
|
66
|
+
//1280px
|
|
67
|
+
'max-xl:gap-[0] ' +
|
|
68
|
+
//1024px
|
|
69
|
+
'max-lg:flex-col max-lg:px-[40px] ' +
|
|
70
|
+
//768px
|
|
71
|
+
'max-md:px-[25px] '
|
|
72
|
+
}
|
|
73
|
+
>
|
|
74
|
+
<span
|
|
75
|
+
className={
|
|
76
|
+
'relative w-[450px] shrink-0 px-[40px] py-[45px] ' +
|
|
77
|
+
//1024px
|
|
78
|
+
'max-lg:w-full max-lg:border-b-[1px] max-lg:border-solid max-lg:border-[#DDDDDD] max-lg:px-0 max-lg:py-[40px] ' +
|
|
79
|
+
//768px
|
|
80
|
+
'max-md:py-[30px] ' +
|
|
81
|
+
//640px
|
|
82
|
+
'max-sm:border-0'
|
|
83
|
+
}
|
|
84
|
+
>
|
|
85
|
+
<p
|
|
86
|
+
className={
|
|
87
|
+
'text-[22px] font-normal leading-none tracking-[-1.2px] ' +
|
|
88
|
+
//768px
|
|
89
|
+
'max-md:text-[20px]'
|
|
90
|
+
}
|
|
91
|
+
>
|
|
92
|
+
{item.lawyer_text}
|
|
93
|
+
</p>
|
|
94
|
+
<p
|
|
95
|
+
className={
|
|
96
|
+
'mt-[12px] text-[26px] font-bold leading-none tracking-[-1.4px] ' +
|
|
97
|
+
//768px
|
|
98
|
+
'max-md:mt-[8px] max-md:text-[24px]'
|
|
99
|
+
}
|
|
100
|
+
>
|
|
101
|
+
{searchColorText(item.title, props.search)}
|
|
102
|
+
</p>
|
|
103
|
+
<button
|
|
104
|
+
className={
|
|
105
|
+
'mt-[40px] flex w-[250px] items-center justify-between border-[1px] border-solid border-[#0F0F0F] bg-white p-[20px] ' +
|
|
106
|
+
//1024px
|
|
107
|
+
'max-lg:absolute max-lg:right-0 max-lg:top-[50%] max-lg:m-0 max-lg:w-[200px] max-lg:translate-y-[-50%] max-lg:p-[16px] ' +
|
|
108
|
+
//768px
|
|
109
|
+
'max-md:w-[160px] max-md:p-[14px] ' +
|
|
110
|
+
//640px
|
|
111
|
+
'max-sm:relative max-sm:mx-auto max-sm:mt-[30px] max-sm:w-[85%] max-sm:translate-y-0'
|
|
112
|
+
}
|
|
113
|
+
onClick={() => {
|
|
114
|
+
void router.push('/map/' + item.key);
|
|
115
|
+
}}
|
|
116
|
+
aria-label={item.title + ' 자세히 보기'}
|
|
117
|
+
ref={
|
|
118
|
+
index === 0 || (index > 12 && index === list.mapList.length - 12)
|
|
119
|
+
? firstAddRef
|
|
120
|
+
: null
|
|
121
|
+
}
|
|
122
|
+
>
|
|
123
|
+
<span
|
|
124
|
+
className={
|
|
125
|
+
'text-[18px] font-[600] leading-none tracking-[-1px] ' +
|
|
126
|
+
//1024px
|
|
127
|
+
'max-lg:text-[16px] '
|
|
128
|
+
}
|
|
129
|
+
>
|
|
130
|
+
자세히보기
|
|
131
|
+
</span>
|
|
132
|
+
<Image
|
|
133
|
+
src={'/images/integrate/window.webp'}
|
|
134
|
+
alt={''}
|
|
135
|
+
width={30}
|
|
136
|
+
height={30}
|
|
137
|
+
objectFit={'cover'}
|
|
138
|
+
className={
|
|
139
|
+
'aspect-square w-[16px] ' +
|
|
140
|
+
//1024px
|
|
141
|
+
'max-lg:w-[14px]'
|
|
142
|
+
}
|
|
143
|
+
/>
|
|
144
|
+
</button>
|
|
145
|
+
</span>
|
|
146
|
+
<span
|
|
147
|
+
className={
|
|
148
|
+
'grow ' +
|
|
149
|
+
//640px
|
|
150
|
+
'max-sm:hidden'
|
|
151
|
+
}
|
|
152
|
+
>
|
|
153
|
+
<MapInfoCon
|
|
154
|
+
locale={router.locale ?? ''}
|
|
155
|
+
title={'주소'}
|
|
156
|
+
text={
|
|
157
|
+
<>
|
|
158
|
+
{item.address
|
|
159
|
+
.replaceAll('법무법인(유한)대륜', '')
|
|
160
|
+
.replaceAll('법무법인(유한) 대륜', '')}
|
|
161
|
+
</>
|
|
162
|
+
}
|
|
163
|
+
/>
|
|
164
|
+
<MapInfoCon
|
|
165
|
+
locale={router.locale ?? ''}
|
|
166
|
+
title={'업무시간'}
|
|
167
|
+
text={
|
|
168
|
+
<>
|
|
169
|
+
{item.worktime.split(' | ').map((i, index) => (
|
|
170
|
+
<span
|
|
171
|
+
key={item.key + '_work_time_' + index}
|
|
172
|
+
className={'block'}
|
|
173
|
+
>
|
|
174
|
+
{i}
|
|
175
|
+
</span>
|
|
176
|
+
))}
|
|
177
|
+
</>
|
|
178
|
+
}
|
|
179
|
+
/>
|
|
180
|
+
<MapInfoCon
|
|
181
|
+
locale={router.locale ?? ''}
|
|
182
|
+
title={'대표번호'}
|
|
183
|
+
text={<>{item.tel}</>}
|
|
184
|
+
/>
|
|
185
|
+
</span>
|
|
186
|
+
</div>
|
|
187
|
+
);
|
|
188
|
+
})}
|
|
189
|
+
</div>
|
|
190
|
+
{tab != '전체' ? (
|
|
191
|
+
<ViewMore
|
|
192
|
+
flag={list.mapList.length != props.listCount.map}
|
|
193
|
+
func={() => {
|
|
194
|
+
setLoading(true);
|
|
195
|
+
props.onMoreView();
|
|
196
|
+
setLoading(false);
|
|
197
|
+
}}
|
|
198
|
+
loading={loading}
|
|
199
|
+
totalPage={Math.ceil(props.listCount.map / 12)}
|
|
200
|
+
nowPage={pages.mapList}
|
|
201
|
+
/>
|
|
202
|
+
) : (
|
|
203
|
+
<button
|
|
204
|
+
className={
|
|
205
|
+
'relative m-auto mb-20 mt-20 flex w-[10em] cursor-pointer items-center justify-between border-[1px] border-solid border-[#707070] px-5 py-4 text-[#666666]'
|
|
206
|
+
}
|
|
207
|
+
onClick={str => onMoreViewText('map')}
|
|
208
|
+
aria-label={'오시는길 더보기'}
|
|
209
|
+
>
|
|
210
|
+
<span className={'pt-[2px] leading-[15px] text-[#666666] '}>더보기</span>
|
|
211
|
+
<Image
|
|
212
|
+
src={'/images/plus_g.webp'}
|
|
213
|
+
alt={'+'}
|
|
214
|
+
title={'+'}
|
|
215
|
+
width={30}
|
|
216
|
+
height={30}
|
|
217
|
+
className={
|
|
218
|
+
'aspect-square w-[18px] max-lg:w-[16px] max-sm:w-[15px] max-2xs:w-[13px]'
|
|
219
|
+
}
|
|
220
|
+
/>
|
|
221
|
+
</button>
|
|
222
|
+
)}
|
|
223
|
+
</div>
|
|
224
|
+
) : (
|
|
225
|
+
<></>
|
|
226
|
+
)}
|
|
227
|
+
</>
|
|
228
|
+
)
|
|
229
|
+
) : null;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
export default Map;
|
|
233
|
+
|
|
234
|
+
const MapInfoCon = (props: { title: string; text: React.ReactNode; locale: string }) => {
|
|
235
|
+
return (
|
|
236
|
+
<div
|
|
237
|
+
className={
|
|
238
|
+
'flex items-start gap-[30px] border-b-[1px] border-solid border-[#DDDDDD] py-[35px] last:border-0 ' +
|
|
239
|
+
//1024px
|
|
240
|
+
'max-lg:py-[25px] ' +
|
|
241
|
+
//768px
|
|
242
|
+
'max-md:py-[20px]'
|
|
243
|
+
}
|
|
244
|
+
>
|
|
245
|
+
<p
|
|
246
|
+
className={
|
|
247
|
+
'block shrink-0 text-[18px] font-[600] leading-[30px] tracking-[-1px] ' +
|
|
248
|
+
//768px
|
|
249
|
+
'max-md:text-[16px] max-md:leading-[27px] ' +
|
|
250
|
+
`${props.locale === 'en' ? ' w-[110px] max-md:w-[100px]' : ' w-[75px] max-md:w-[60px]'}`
|
|
251
|
+
}
|
|
252
|
+
>
|
|
253
|
+
{props.title}
|
|
254
|
+
</p>
|
|
255
|
+
<p
|
|
256
|
+
className={
|
|
257
|
+
'text-[20px] font-[300] leading-[1.5] tracking-[-1.2px] ' +
|
|
258
|
+
//768px
|
|
259
|
+
'max-md:text-[18px] '
|
|
260
|
+
}
|
|
261
|
+
>
|
|
262
|
+
{props.text}
|
|
263
|
+
</p>
|
|
264
|
+
</div>
|
|
265
|
+
);
|
|
266
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { RefObject } from 'react';
|
|
2
|
+
interface TabProps {
|
|
3
|
+
search: string | null;
|
|
4
|
+
searchDoneRef: RefObject<HTMLAnchorElement>;
|
|
5
|
+
setChoiceTabValue?: React.Dispatch<React.SetStateAction<string>>;
|
|
6
|
+
count: {
|
|
7
|
+
lawyer: number;
|
|
8
|
+
field: number;
|
|
9
|
+
success: number;
|
|
10
|
+
info: number;
|
|
11
|
+
broadcast: number;
|
|
12
|
+
reply: number;
|
|
13
|
+
map: number;
|
|
14
|
+
};
|
|
15
|
+
totalCount: number;
|
|
16
|
+
}
|
|
17
|
+
declare const MenuTab: ({ search, searchDoneRef, setChoiceTabValue, totalCount, count }: TabProps) => React.JSX.Element;
|
|
18
|
+
export default MenuTab;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import React, { useEffect, useState } from 'react';
|
|
12
|
+
import { useRouter } from 'next/navigation';
|
|
13
|
+
import { useSearchParams } from 'next/navigation';
|
|
14
|
+
import Link from 'next/link';
|
|
15
|
+
import { tabTypes } from '../../common/integrate';
|
|
16
|
+
const MenuTab = ({ search, searchDoneRef, setChoiceTabValue, totalCount, count }) => {
|
|
17
|
+
const router = useRouter();
|
|
18
|
+
const [tab, setTab] = useState('');
|
|
19
|
+
const searchParams = useSearchParams();
|
|
20
|
+
const querySearch = searchParams.get('search');
|
|
21
|
+
const queryTab = searchParams.get('tab');
|
|
22
|
+
const handleChange = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
+
yield router.push(`/integrate?search=${querySearch}&tab=${event.target.value}`);
|
|
24
|
+
});
|
|
25
|
+
const onClickEvent = (tab, search) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
+
yield router.push(`/integrate?search=${querySearch}&tab=${tab}`);
|
|
27
|
+
});
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setTab(String(queryTab));
|
|
30
|
+
setChoiceTabValue === null || setChoiceTabValue === void 0 ? void 0 : setChoiceTabValue(queryTab ? String(queryTab) : '전체'); // 부모에게 tab button value 넘겨주는 setState
|
|
31
|
+
}, [searchParams]);
|
|
32
|
+
return (<>
|
|
33
|
+
<div className={'mx-auto w-full max-sm:hidden '}>
|
|
34
|
+
<Link href={tab !== '전체'
|
|
35
|
+
? `/integrate?search=${querySearch}&tab=전체`
|
|
36
|
+
: `/integrate?search=${querySearch}&tab=${tab}`} ref={searchDoneRef} className={`
|
|
37
|
+
${totalCount < 1 ? 'hidden' : ''}
|
|
38
|
+
${tab === '전체' ? ' bg-[#285FA7] text-[#fff] ' : 'bg-[#F8F8F8] '}
|
|
39
|
+
mt-12 flex h-[56px] cursor-pointer items-center justify-center rounded-[30px] text-center font-semibold sm:h-[50px] sm:w-[155px]
|
|
40
|
+
sm:text-[16px] lg:w-[165px] lg:text-[17px] `} onKeyDown={e => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
if (e.key === 'Enter') {
|
|
43
|
+
if (tab === '전체') {
|
|
44
|
+
(_b = (_a = document.getElementById('integrate-result')) === null || _a === void 0 ? void 0 : _a.querySelector('a')) === null || _b === void 0 ? void 0 : _b.focus();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}} aria-label={'전체 ' +
|
|
48
|
+
totalCount.toLocaleString() +
|
|
49
|
+
'개의 검색결과 보기 ' +
|
|
50
|
+
`${tab === '전체' ? '선택된 메뉴입니다.' : ''}`}>
|
|
51
|
+
전체 ({totalCount.toLocaleString()})
|
|
52
|
+
</Link>
|
|
53
|
+
<div className={'mb-16 mt-3 flex-col flex-wrap gap-2 sm:flex sm:w-auto sm:flex-row'}>
|
|
54
|
+
{tabTypes.map(item => {
|
|
55
|
+
return (<TabButton key={item.value} tab={tab} count={
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
count[String(item.value)]} title={item.tab} type={item.value} onClickEvent={onClickEvent} search={search}/>);
|
|
58
|
+
})}
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
{/*모바일*/}
|
|
62
|
+
<div className={"relative after:absolute after:right-[2em] after:top-[1.2em] after:h-[10px] after:w-[10px] after:rotate-[135deg] after:border-r-[2px] after:border-t-[2px] after:border-[#fff] after:content-[''] sm:hidden"}>
|
|
63
|
+
<select onChange={handleChange} aria-label={'search-tab'} className="z-9 relative my-10 block w-full appearance-none rounded-[30px] border border-gray-400 bg-[#285FA7] px-6 py-3 text-[18px] font-[800] text-[#fff] hover:border-gray-500 sm:hidden">
|
|
64
|
+
<option value="전체">
|
|
65
|
+
전체
|
|
66
|
+
{`(${totalCount.toLocaleString()})`}
|
|
67
|
+
</option>
|
|
68
|
+
|
|
69
|
+
{tabTypes.map(t => {
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
const tabNum = count[t.value];
|
|
72
|
+
return (tabNum > 0 && (<option value={t.value} key={t.value}>
|
|
73
|
+
{t.tab} {`(${tabNum.toLocaleString()})`}
|
|
74
|
+
</option>));
|
|
75
|
+
})}
|
|
76
|
+
</select>
|
|
77
|
+
</div>
|
|
78
|
+
</>);
|
|
79
|
+
};
|
|
80
|
+
const TabButton = (props) => {
|
|
81
|
+
const searchParams = useSearchParams();
|
|
82
|
+
const buttonClass = 'block flex items-center justify-center sm:w-[155px] sm:text-[16px] lg:w-[165px] lg:text-[17px] text-center cursor-pointer font-semibold rounded-[30px] h-[56px] ';
|
|
83
|
+
const { tab, count, type, title, onClickEvent, search } = props;
|
|
84
|
+
const querySearch = searchParams.get('search');
|
|
85
|
+
return (<Link href={`/integrate?search=${querySearch}&tab=${type}`} className={`${tab === type ? ' bg-[#285FA7] text-[#fff] ' : ' bg-[#F8F8F8] '} ${buttonClass} ${count < 1 ? 'hidden' : ''}`}>
|
|
86
|
+
{`${title}`}
|
|
87
|
+
{` (${count.toLocaleString()})`}
|
|
88
|
+
</Link>);
|
|
89
|
+
};
|
|
90
|
+
export default MenuTab;
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import React, { RefObject, useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { useRouter } from 'next/navigation';
|
|
5
|
+
import { useSearchParams } from 'next/navigation';
|
|
6
|
+
import Link from 'next/link';
|
|
7
|
+
import { tabTypes } from '../../common/integrate';
|
|
8
|
+
import Strength from '../Strength/Strength';
|
|
9
|
+
|
|
10
|
+
interface TabProps {
|
|
11
|
+
search: string | null;
|
|
12
|
+
searchDoneRef: RefObject<HTMLAnchorElement>;
|
|
13
|
+
setChoiceTabValue?: React.Dispatch<React.SetStateAction<string>>;
|
|
14
|
+
count: {
|
|
15
|
+
lawyer: number;
|
|
16
|
+
field: number;
|
|
17
|
+
success: number;
|
|
18
|
+
info: number;
|
|
19
|
+
broadcast: number;
|
|
20
|
+
reply: number;
|
|
21
|
+
map: number;
|
|
22
|
+
};
|
|
23
|
+
totalCount: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const MenuTab = ({ search, searchDoneRef, setChoiceTabValue, totalCount, count }: TabProps) => {
|
|
27
|
+
const router = useRouter();
|
|
28
|
+
const [tab, setTab] = useState<string>('');
|
|
29
|
+
const searchParams = useSearchParams();
|
|
30
|
+
const querySearch = searchParams.get('search');
|
|
31
|
+
const queryTab = searchParams.get('tab');
|
|
32
|
+
|
|
33
|
+
const handleChange = async (event: React.ChangeEvent<HTMLSelectElement>) => {
|
|
34
|
+
await router.push(`/integrate?search=${querySearch}&tab=${event.target.value}`);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const onClickEvent = async (tab: any, search: any) => {
|
|
38
|
+
await router.push(`/integrate?search=${querySearch}&tab=${tab}`);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
setTab(String(queryTab));
|
|
43
|
+
|
|
44
|
+
setChoiceTabValue?.(queryTab ? String(queryTab) : '전체'); // 부모에게 tab button value 넘겨주는 setState
|
|
45
|
+
}, [searchParams]);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<>
|
|
49
|
+
<div className={'mx-auto w-full max-sm:hidden '}>
|
|
50
|
+
<Link
|
|
51
|
+
href={
|
|
52
|
+
tab !== '전체'
|
|
53
|
+
? `/integrate?search=${querySearch}&tab=전체`
|
|
54
|
+
: `/integrate?search=${querySearch}&tab=${tab}`
|
|
55
|
+
}
|
|
56
|
+
ref={searchDoneRef}
|
|
57
|
+
className={`
|
|
58
|
+
${totalCount < 1 ? 'hidden' : ''}
|
|
59
|
+
${tab === '전체' ? ' bg-[#285FA7] text-[#fff] ' : 'bg-[#F8F8F8] '}
|
|
60
|
+
mt-12 flex h-[56px] cursor-pointer items-center justify-center rounded-[30px] text-center font-semibold sm:h-[50px] sm:w-[155px]
|
|
61
|
+
sm:text-[16px] lg:w-[165px] lg:text-[17px] `}
|
|
62
|
+
onKeyDown={e => {
|
|
63
|
+
if (e.key === 'Enter') {
|
|
64
|
+
if (tab === '전체') {
|
|
65
|
+
document.getElementById('integrate-result')?.querySelector('a')?.focus();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}}
|
|
69
|
+
aria-label={
|
|
70
|
+
'전체 ' +
|
|
71
|
+
totalCount.toLocaleString() +
|
|
72
|
+
'개의 검색결과 보기 ' +
|
|
73
|
+
`${tab === '전체' ? '선택된 메뉴입니다.' : ''}`
|
|
74
|
+
}
|
|
75
|
+
>
|
|
76
|
+
전체 ({totalCount.toLocaleString()})
|
|
77
|
+
</Link>
|
|
78
|
+
<div className={'mb-16 mt-3 flex-col flex-wrap gap-2 sm:flex sm:w-auto sm:flex-row'}>
|
|
79
|
+
{tabTypes.map(item => {
|
|
80
|
+
return (
|
|
81
|
+
<TabButton
|
|
82
|
+
key={item.value}
|
|
83
|
+
tab={tab}
|
|
84
|
+
count={
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
count[String(item.value)]
|
|
87
|
+
}
|
|
88
|
+
title={item.tab}
|
|
89
|
+
type={item.value}
|
|
90
|
+
onClickEvent={onClickEvent}
|
|
91
|
+
search={search}
|
|
92
|
+
/>
|
|
93
|
+
);
|
|
94
|
+
})}
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
{/*모바일*/}
|
|
98
|
+
<div
|
|
99
|
+
className={
|
|
100
|
+
"relative after:absolute after:right-[2em] after:top-[1.2em] after:h-[10px] after:w-[10px] after:rotate-[135deg] after:border-r-[2px] after:border-t-[2px] after:border-[#fff] after:content-[''] sm:hidden"
|
|
101
|
+
}
|
|
102
|
+
>
|
|
103
|
+
<select
|
|
104
|
+
onChange={handleChange}
|
|
105
|
+
aria-label={'search-tab'}
|
|
106
|
+
className="z-9 relative my-10 block w-full appearance-none rounded-[30px] border border-gray-400 bg-[#285FA7] px-6 py-3 text-[18px] font-[800] text-[#fff] hover:border-gray-500 sm:hidden"
|
|
107
|
+
>
|
|
108
|
+
<option value="전체">
|
|
109
|
+
전체
|
|
110
|
+
{`(${totalCount.toLocaleString()})`}
|
|
111
|
+
</option>
|
|
112
|
+
|
|
113
|
+
{tabTypes.map(t => {
|
|
114
|
+
// @ts-ignore
|
|
115
|
+
const tabNum = count[t.value];
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
tabNum > 0 && (
|
|
119
|
+
<option value={t.value} key={t.value}>
|
|
120
|
+
{t.tab} {`(${tabNum.toLocaleString()})`}
|
|
121
|
+
</option>
|
|
122
|
+
)
|
|
123
|
+
);
|
|
124
|
+
})}
|
|
125
|
+
</select>
|
|
126
|
+
</div>
|
|
127
|
+
</>
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
interface ITabButtonTypes {
|
|
132
|
+
tab: string;
|
|
133
|
+
count: number;
|
|
134
|
+
type: string;
|
|
135
|
+
title: string;
|
|
136
|
+
onClickEvent: (type: string, search: any) => Promise<void>;
|
|
137
|
+
search: any;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const TabButton = (props: ITabButtonTypes) => {
|
|
141
|
+
const searchParams = useSearchParams();
|
|
142
|
+
const buttonClass =
|
|
143
|
+
'block flex items-center justify-center sm:w-[155px] sm:text-[16px] lg:w-[165px] lg:text-[17px] text-center cursor-pointer font-semibold rounded-[30px] h-[56px] ';
|
|
144
|
+
const { tab, count, type, title, onClickEvent, search } = props;
|
|
145
|
+
const querySearch = searchParams.get('search');
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<Link
|
|
149
|
+
href={`/integrate?search=${querySearch}&tab=${type}`}
|
|
150
|
+
className={`${tab === type ? ' bg-[#285FA7] text-[#fff] ' : ' bg-[#F8F8F8] '} ${buttonClass} ${
|
|
151
|
+
count < 1 ? 'hidden' : ''
|
|
152
|
+
}`}
|
|
153
|
+
>
|
|
154
|
+
{`${title}`}
|
|
155
|
+
{` (${count.toLocaleString()})`}
|
|
156
|
+
</Link>
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export default MenuTab;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import { useTranslation } from 'next-i18next';
|
|
4
|
+
export const NoResult = () => {
|
|
5
|
+
const { t } = useTranslation('common');
|
|
6
|
+
return (<section>
|
|
7
|
+
<div className={'m-auto mb-72 mt-40 flex flex-col items-center font-[SUIT] max-sm:mb-40'}>
|
|
8
|
+
<div className={'relative h-[80px] w-[80px] rounded-full border-[2px] border-solid border-[#3669AC]'}>
|
|
9
|
+
<Image src={'/images/integrate/no.webp'} alt={''} width={50} height={80} className={'absolute right-[35px] top-[25px] h-[30px] w-[6px]'}/>
|
|
10
|
+
</div>
|
|
11
|
+
<p className={'mt-4 text-[26px] font-[800] text-[#3669AC] max-sm:text-[22px]'}>검색 결과가 없습니다.</p>
|
|
12
|
+
</div>
|
|
13
|
+
</section>);
|
|
14
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import Image from 'next/image';
|
|
3
|
+
import { useTranslation } from 'next-i18next';
|
|
4
|
+
|
|
5
|
+
export const NoResult = () => {
|
|
6
|
+
const { t } = useTranslation('common');
|
|
7
|
+
return (
|
|
8
|
+
<section>
|
|
9
|
+
<div className={'m-auto mb-72 mt-40 flex flex-col items-center font-[SUIT] max-sm:mb-40'}>
|
|
10
|
+
<div className={'relative h-[80px] w-[80px] rounded-full border-[2px] border-solid border-[#3669AC]'}>
|
|
11
|
+
<Image
|
|
12
|
+
src={'/images/integrate/no.webp'}
|
|
13
|
+
alt={''}
|
|
14
|
+
width={50}
|
|
15
|
+
height={80}
|
|
16
|
+
className={'absolute right-[35px] top-[25px] h-[30px] w-[6px]'}
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<p className={'mt-4 text-[26px] font-[800] text-[#3669AC] max-sm:text-[22px]'}>검색 결과가 없습니다.</p>
|
|
20
|
+
</div>
|
|
21
|
+
</section>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IListPagesType, IListTypes } from './integrateType';
|
|
3
|
+
declare const Reply: (props: {
|
|
4
|
+
tab: string;
|
|
5
|
+
onMoreViewText: (str: string) => void;
|
|
6
|
+
onMoreView: () => void;
|
|
7
|
+
list: IListTypes;
|
|
8
|
+
pages: IListPagesType;
|
|
9
|
+
crime_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 Reply;
|