@daeryun/dr_components 0.4.54 → 0.4.56
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 +1 -1
- package/dist/components/page/Integrate/Broadcast.d.ts +1 -0
- package/dist/components/page/Integrate/Broadcast.jsx +81 -48
- package/dist/components/page/Integrate/Broadcast.tsx +153 -114
- package/dist/components/page/Integrate/Field.d.ts +1 -0
- package/dist/components/page/Integrate/Field.jsx +40 -16
- package/dist/components/page/Integrate/Field.tsx +66 -32
- package/dist/components/page/Integrate/LawInfo.d.ts +1 -0
- package/dist/components/page/Integrate/LawInfo.jsx +37 -4
- package/dist/components/page/Integrate/LawInfo.tsx +51 -5
- package/dist/components/page/Integrate/Lawyer.d.ts +1 -0
- package/dist/components/page/Integrate/Lawyer.jsx +36 -11
- package/dist/components/page/Integrate/Lawyer.tsx +60 -25
- package/dist/components/page/Integrate/Map.d.ts +1 -0
- package/dist/components/page/Integrate/Map.jsx +41 -26
- package/dist/components/page/Integrate/Map.tsx +53 -34
- package/dist/components/page/Integrate/Reply.d.ts +1 -0
- package/dist/components/page/Integrate/Reply.jsx +55 -22
- package/dist/components/page/Integrate/Reply.tsx +102 -60
- package/dist/components/page/Integrate/SearchData.jsx +21 -7
- package/dist/components/page/Integrate/SearchData.tsx +22 -0
- package/dist/components/page/Integrate/Success.d.ts +1 -0
- package/dist/components/page/Integrate/Success.jsx +61 -28
- package/dist/components/page/Integrate/Success.tsx +106 -62
- package/dist/components/page/Integrate/ViewMore.d.ts +1 -1
- package/dist/components/page/Integrate/ViewMore.tsx +1 -1
- package/dist/styles/globals.css +177 -177
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import React, { useRef, useState } from 'react';
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import Link from 'next/link';
|
|
3
3
|
import { NoResult } from './NoResult';
|
|
4
4
|
import uuid from 'react-uuid';
|
|
5
|
-
import { IListPagesType, IListTypes } from './integrateType';
|
|
5
|
+
import { IListPagesType, IListTypes, ISuccessTypes } from './integrateType';
|
|
6
6
|
import { Title } from './Title';
|
|
7
7
|
import { ViewMore } from './ViewMore';
|
|
8
8
|
import { useTranslation } from 'next-i18next';
|
|
9
9
|
import { searchColorText } from '../../common/integrate';
|
|
10
10
|
|
|
11
11
|
const Success = (props: {
|
|
12
|
+
isMobileSize: boolean | null;
|
|
12
13
|
tab: string;
|
|
13
14
|
onMoreViewText: (str: string) => void;
|
|
14
15
|
onMoreView: () => void;
|
|
@@ -26,10 +27,44 @@ const Success = (props: {
|
|
|
26
27
|
map: number;
|
|
27
28
|
};
|
|
28
29
|
}) => {
|
|
29
|
-
const { tab, onMoreViewText, list, pages, onMoreView, search, listCount } = props;
|
|
30
|
+
const { tab, onMoreViewText, list, pages, onMoreView, search, listCount, isMobileSize } = props;
|
|
30
31
|
|
|
31
32
|
const [loading, setLoading] = useState<boolean>(false);
|
|
32
33
|
|
|
34
|
+
const [allTabPage, setAllTabPage] = useState<number>(0);
|
|
35
|
+
const [allTabList, setAllTabList] = useState<ISuccessTypes[]>([]);
|
|
36
|
+
|
|
37
|
+
const getAllPage = () => {
|
|
38
|
+
const itemsToAdd = 4;
|
|
39
|
+
|
|
40
|
+
// successList에서 잘라낼 시작 인덱스 계산
|
|
41
|
+
const startIndex = 2 + allTabPage * 4;
|
|
42
|
+
const endIndex = startIndex + itemsToAdd;
|
|
43
|
+
const newItems = list.successList.slice(startIndex, endIndex);
|
|
44
|
+
const updatedList = [...allTabList, ...newItems];
|
|
45
|
+
setAllTabList(updatedList);
|
|
46
|
+
|
|
47
|
+
// 다음 호출 후 예상 총 개수
|
|
48
|
+
const nextTotalCount = updatedList.length + itemsToAdd;
|
|
49
|
+
// 현재 successList의 길이
|
|
50
|
+
const currentListLength = list.successList.length;
|
|
51
|
+
|
|
52
|
+
// 다음 총 개수가 successList 길이를 초과하면 api 호출
|
|
53
|
+
// 예: successList가 24일 때, 22 -> 26이 되면 호출
|
|
54
|
+
if (nextTotalCount > currentListLength) {
|
|
55
|
+
onMoreView();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 페이지 상태 증가
|
|
59
|
+
setAllTabPage(allTabPage + 1);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (allTabList.length === 0) {
|
|
64
|
+
setAllTabList(list.successList.slice(0, 2));
|
|
65
|
+
}
|
|
66
|
+
}, [list.successList]);
|
|
67
|
+
|
|
33
68
|
return (
|
|
34
69
|
<>
|
|
35
70
|
{tab === '전체' || tab === 'success' ? (
|
|
@@ -46,81 +81,81 @@ const Success = (props: {
|
|
|
46
81
|
onClick={str => onMoreViewText(str)}
|
|
47
82
|
count={listCount.success}
|
|
48
83
|
/>
|
|
49
|
-
|
|
50
84
|
{list.successList?.length !== 0 && (
|
|
51
85
|
<div className={'mb-9 mt-9 grid gap-[30px] sm:grid-cols-2'}>
|
|
52
|
-
{(tab === '전체'
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
86
|
+
{(tab === '전체'
|
|
87
|
+
? isMobileSize === true
|
|
88
|
+
? allTabList
|
|
89
|
+
: list.successList.slice(0, 4)
|
|
90
|
+
: list.successList
|
|
91
|
+
).map((item, index) => {
|
|
92
|
+
return (
|
|
93
|
+
<Link
|
|
94
|
+
href={
|
|
95
|
+
!item.center_code.includes('OF')
|
|
96
|
+
? item.pathname + 'success_new/' + item.id
|
|
97
|
+
: `https://${item.office_pathname}/success_new/${item.id}`
|
|
98
|
+
}
|
|
99
|
+
target={item.center_code === props.center_code ? '' : '_blank'}
|
|
100
|
+
className={
|
|
101
|
+
' overflow-hidden border-[2px] border-solid border-[#ebebebcc]'
|
|
102
|
+
}
|
|
103
|
+
key={item.id + item.center_code}
|
|
104
|
+
>
|
|
105
|
+
<p
|
|
106
|
+
className={`ml-8 inline-block w-auto max-w-[70%] bg-[#2960A7] p-2 px-7 text-center text-[18px] font-[800] text-[#fff] max-lg:text-[16px] max-sm:text-[15px] max-2xs:text-[14px]`}
|
|
66
107
|
>
|
|
67
|
-
<
|
|
68
|
-
|
|
108
|
+
<span className={'line-clamp-1'}>{item.sub}</span>
|
|
109
|
+
</p>
|
|
110
|
+
<div className={'flex flex-col gap-4 p-8 max-sm:pt-6'}>
|
|
111
|
+
<div
|
|
112
|
+
className={
|
|
113
|
+
'block flex-col items-center gap-[10px] sm:flex sm:flex-row'
|
|
114
|
+
}
|
|
69
115
|
>
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
'block flex-col items-center gap-[10px] sm:flex sm:flex-row'
|
|
76
|
-
}
|
|
77
|
-
>
|
|
78
|
-
<div className={'max-sm:mb-4'}>
|
|
79
|
-
<p
|
|
80
|
-
className={` mb-3 flex h-[35px] w-[100px] flex-col items-center justify-center overflow-hidden rounded-[30px] bg-[#F2F6FA] text-center text-[16px] font-[800] leading-[18px] text-[#285FA7] max-sm:hidden max-sm:text-[15px] max-2xs:text-[14px] sm:mb-0 sm:h-[80px] sm:w-[80px] sm:rounded-full`}
|
|
81
|
-
>
|
|
82
|
-
<span
|
|
83
|
-
className={
|
|
84
|
-
'line-clamp-2 break-keep px-3 text-center'
|
|
85
|
-
}
|
|
86
|
-
>
|
|
87
|
-
{item.result}
|
|
88
|
-
</span>
|
|
89
|
-
</p>
|
|
90
|
-
|
|
91
|
-
<data
|
|
116
|
+
<div className={'max-sm:mb-4'}>
|
|
117
|
+
<p
|
|
118
|
+
className={` mb-3 flex h-[35px] w-[100px] flex-col items-center justify-center overflow-hidden rounded-[30px] bg-[#F2F6FA] text-center text-[16px] font-[800] leading-[18px] text-[#285FA7] max-sm:hidden max-sm:text-[15px] max-2xs:text-[14px] sm:mb-0 sm:h-[80px] sm:w-[80px] sm:rounded-full`}
|
|
119
|
+
>
|
|
120
|
+
<span
|
|
92
121
|
className={
|
|
93
|
-
'
|
|
122
|
+
'line-clamp-2 break-keep px-3 text-center'
|
|
94
123
|
}
|
|
95
124
|
>
|
|
96
|
-
{item.
|
|
97
|
-
|
|
98
|
-
.replaceAll('-', '.')}
|
|
99
|
-
</data>
|
|
100
|
-
</div>
|
|
101
|
-
|
|
102
|
-
<p
|
|
103
|
-
className={
|
|
104
|
-
'mb-8 ml-1 text-[20px] max-xl:mb-4 max-lg:mb-2 max-lg:text-[18px] max-md:text-[15px] max-sm:mb-0 max-sm:text-[17px] sm:ml-4 '
|
|
105
|
-
}
|
|
106
|
-
>
|
|
107
|
-
{searchColorText(item.title, search)}
|
|
125
|
+
{item.result}
|
|
126
|
+
</span>
|
|
108
127
|
</p>
|
|
109
|
-
|
|
128
|
+
|
|
129
|
+
<data
|
|
110
130
|
className={
|
|
111
|
-
'mt-
|
|
131
|
+
'mt-3 block text-[#666666] max-sm:hidden max-sm:text-[14px]'
|
|
112
132
|
}
|
|
113
133
|
>
|
|
114
134
|
{item.created_at
|
|
115
135
|
?.split('T')[0]
|
|
116
136
|
.replaceAll('-', '.')}
|
|
117
|
-
</
|
|
137
|
+
</data>
|
|
118
138
|
</div>
|
|
139
|
+
|
|
140
|
+
<p
|
|
141
|
+
className={
|
|
142
|
+
'mb-8 ml-1 text-[20px] max-xl:mb-4 max-lg:mb-2 max-lg:text-[18px] max-md:text-[15px] max-sm:mb-0 max-sm:text-[17px] sm:ml-4 '
|
|
143
|
+
}
|
|
144
|
+
>
|
|
145
|
+
{searchColorText(item.title, search)}
|
|
146
|
+
</p>
|
|
147
|
+
<p
|
|
148
|
+
className={
|
|
149
|
+
'mt-6 text-[#666666] max-sm:text-[14px] sm:hidden'
|
|
150
|
+
}
|
|
151
|
+
>
|
|
152
|
+
{item.created_at?.split('T')[0].replaceAll('-', '.')}
|
|
153
|
+
</p>
|
|
119
154
|
</div>
|
|
120
|
-
</
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)}
|
|
155
|
+
</div>
|
|
156
|
+
</Link>
|
|
157
|
+
);
|
|
158
|
+
})}
|
|
124
159
|
</div>
|
|
125
160
|
)}
|
|
126
161
|
{tab != '전체' && (
|
|
@@ -135,6 +170,15 @@ const Success = (props: {
|
|
|
135
170
|
setLoading(false);
|
|
136
171
|
}}
|
|
137
172
|
/>
|
|
173
|
+
)}{' '}
|
|
174
|
+
{tab === '전체' && isMobileSize === true && (
|
|
175
|
+
<ViewMore
|
|
176
|
+
flag={allTabList.length != listCount.success}
|
|
177
|
+
func={() => {
|
|
178
|
+
getAllPage();
|
|
179
|
+
}}
|
|
180
|
+
loading={loading}
|
|
181
|
+
/>
|
|
138
182
|
)}
|
|
139
183
|
</div>
|
|
140
184
|
) : (
|