@daeryun/dr_components 1.3.17 → 1.3.19
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/categoryView/CategoryView.jsx +4 -14
- package/dist/components/categoryView/CategoryView.tsx +5 -13
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/components/common/types/trend/index.d.ts +18 -0
- package/dist/components/common/types/trend/index.js +1 -0
- package/dist/components/common/types/trend/index.ts +18 -0
- package/dist/components/page/Trend/TrendList.d.ts +11 -0
- package/dist/components/page/Trend/TrendList.jsx +123 -0
- package/dist/components/page/Trend/TrendList.stories.d.ts +6 -0
- package/dist/components/page/Trend/TrendList.stories.jsx +231 -0
- package/dist/components/page/Trend/TrendList.stories.tsx +275 -0
- package/dist/components/page/Trend/TrendList.tsx +181 -0
- package/dist/styles/globals.css +438 -414
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import PageTitleBox from '../../PageTitleBox/PageTitleBox';
|
|
4
|
+
import { ImgTypes } from '../../PageTitleBox/ImgTypes';
|
|
5
|
+
import PageWrapper from '../../Layout/PageWrapper';
|
|
6
|
+
import SearchBar from '../../SearchBar/SearchBar';
|
|
7
|
+
import { ITrendTypes } from '../../common/types/trend';
|
|
8
|
+
import Link from 'next/link';
|
|
9
|
+
import { htmlTagRemove } from '../../../lib';
|
|
10
|
+
import { useState } from 'react';
|
|
11
|
+
import { useRouter } from 'next/navigation';
|
|
12
|
+
import { removeScrollPos } from '../../hook/useScrollRestoration';
|
|
13
|
+
import Image from 'next/image';
|
|
14
|
+
import PaginationComponent from '../MyCase/_component/_pagination/PaginationComponent';
|
|
15
|
+
import Pagination from '../../Pagination/Pagination';
|
|
16
|
+
import ListBottomKeywd from '../../ListBottomKeywd/ListBottomKeywd';
|
|
17
|
+
import { RouteType } from '../../ListBottomKeywd/RouteType';
|
|
18
|
+
|
|
19
|
+
interface ITrendListProps {
|
|
20
|
+
page: number;
|
|
21
|
+
size: number;
|
|
22
|
+
search: string;
|
|
23
|
+
trend: ITrendTypes[];
|
|
24
|
+
count: number;
|
|
25
|
+
tel: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const TrendList = ({ trend, page, size, search, count, tel }: ITrendListProps) => {
|
|
29
|
+
const router = useRouter();
|
|
30
|
+
const [searchInput, setSearchInput] = useState<string>('');
|
|
31
|
+
|
|
32
|
+
const imagePath: string = process.env.NEXT_PUBLIC_S3_URL + '';
|
|
33
|
+
const lawyerImagePath: string = imagePath + '/upload/lawyer';
|
|
34
|
+
|
|
35
|
+
const onChange = (pageNum: number) => {
|
|
36
|
+
const params = new URLSearchParams();
|
|
37
|
+
params.set('page', String(pageNum));
|
|
38
|
+
|
|
39
|
+
if (search) {
|
|
40
|
+
params.set('search', search);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const url = `/trend?${params.toString()}`;
|
|
44
|
+
|
|
45
|
+
removeScrollPos(url);
|
|
46
|
+
router.push(url);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const handleClick = async () => {
|
|
50
|
+
const params = new URLSearchParams();
|
|
51
|
+
params.set('page', '1');
|
|
52
|
+
|
|
53
|
+
if (searchInput) {
|
|
54
|
+
params.set('search', searchInput);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const url = `/trend?${params.toString()}`;
|
|
58
|
+
|
|
59
|
+
removeScrollPos(url);
|
|
60
|
+
router.push(url);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<>
|
|
65
|
+
<PageTitleBox
|
|
66
|
+
titleTxt={'판결분석/최신동향'}
|
|
67
|
+
subTxt={
|
|
68
|
+
<>
|
|
69
|
+
분야별 전문성을 갖춘 법무법인(유한) 대륜의 <br /> 판결과 법적이슈에 대한 분석을 전해드립니다.
|
|
70
|
+
</>
|
|
71
|
+
}
|
|
72
|
+
imgType={ImgTypes.TREND}
|
|
73
|
+
/>
|
|
74
|
+
<PageWrapper>
|
|
75
|
+
<div className="sticky top-[100px] z-[45] mb-[20px] bg-white pb-[2px] pt-4 max-md:top-[60px]">
|
|
76
|
+
<SearchBar
|
|
77
|
+
label={'판결분석 검색창'}
|
|
78
|
+
onChange={e => {
|
|
79
|
+
setSearchInput(e.currentTarget.value);
|
|
80
|
+
}}
|
|
81
|
+
onClick={handleClick}
|
|
82
|
+
search={searchInput}
|
|
83
|
+
placeholder={'판결분석/최신동향을 검색해보세요'}
|
|
84
|
+
isKeyPress={true}
|
|
85
|
+
marginTop={[70, 50, 50]}
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
{trend.length > 0 ? (
|
|
89
|
+
<div className={'mb-[3.5em] grid w-full grid-cols-1 gap-10 sm:grid-cols-2 lg:grid-cols-3'}>
|
|
90
|
+
{trend.map((item, index) =>
|
|
91
|
+
!item.deleted_at ? (
|
|
92
|
+
<div key={item.id} className={'bg-[#FAFAFA] px-6 py-10'}>
|
|
93
|
+
<div>
|
|
94
|
+
<Link
|
|
95
|
+
href={{
|
|
96
|
+
pathname: item.pathname + item.id
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
<div className={'flex flex-col gap-5'}>
|
|
100
|
+
<div className={'text-[18px] font-[800] text-[#023059] underline'}>
|
|
101
|
+
{item.result}
|
|
102
|
+
</div>
|
|
103
|
+
<div className={'text-[19px] font-[700] leading-8'}>{item.title}</div>
|
|
104
|
+
<div className={'line-clamp-3 overflow-hidden text-ellipsis leading-8'}>
|
|
105
|
+
{htmlTagRemove(item.contents)}
|
|
106
|
+
</div>
|
|
107
|
+
<div>
|
|
108
|
+
<div className={'mt-2 flex'}>
|
|
109
|
+
{item.lawyer_name?.split('.', 3).map((l, index) => {
|
|
110
|
+
const isForeigner = item.is_foreigner?.[index] || false;
|
|
111
|
+
let displayName = l || '';
|
|
112
|
+
if (l) {
|
|
113
|
+
if (!isForeigner) {
|
|
114
|
+
const match = l.match(/^([^(]+)/);
|
|
115
|
+
displayName = match ? match[1].trim() : l;
|
|
116
|
+
} else {
|
|
117
|
+
const match = l.match(/\(([^)]+)\)/);
|
|
118
|
+
if (match) {
|
|
119
|
+
const englishName = match[1].trim();
|
|
120
|
+
displayName = englishName.split(' ')[0];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return (
|
|
126
|
+
<div
|
|
127
|
+
key={index}
|
|
128
|
+
className={
|
|
129
|
+
'flex flex-col items-center justify-center gap-2 ' +
|
|
130
|
+
(index < 3 ? 'mr-2' : '')
|
|
131
|
+
}
|
|
132
|
+
>
|
|
133
|
+
<div
|
|
134
|
+
className={
|
|
135
|
+
'max-h-[80px] w-[80px] max-w-[80px] overflow-hidden rounded-[80px] bg-white'
|
|
136
|
+
}
|
|
137
|
+
>
|
|
138
|
+
{item.lawyer_img.split(',', 3)[index] ? (
|
|
139
|
+
<Image
|
|
140
|
+
src={
|
|
141
|
+
lawyerImagePath +
|
|
142
|
+
'/' +
|
|
143
|
+
item.lawyer_img.split(',', 3)[index]
|
|
144
|
+
}
|
|
145
|
+
width={100}
|
|
146
|
+
height={100}
|
|
147
|
+
alt={'사건담당변호사 ' + displayName}
|
|
148
|
+
/>
|
|
149
|
+
) : null}
|
|
150
|
+
</div>
|
|
151
|
+
<p>{displayName}</p>
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
})}
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
<div></div>
|
|
159
|
+
</Link>
|
|
160
|
+
</div>
|
|
161
|
+
</div>
|
|
162
|
+
) : (
|
|
163
|
+
<div key={item.id} className={''}>
|
|
164
|
+
<p>검색 결과가 없습니다.</p>
|
|
165
|
+
</div>
|
|
166
|
+
)
|
|
167
|
+
)}
|
|
168
|
+
</div>
|
|
169
|
+
) : (
|
|
170
|
+
<div className={'flex w-full items-center justify-center py-32 max-xs:py-24'}>
|
|
171
|
+
<p className={'w-fit'}>검색 결과가 없습니다.</p>
|
|
172
|
+
</div>
|
|
173
|
+
)}
|
|
174
|
+
|
|
175
|
+
<Pagination currentPage={page} totalPages={count / size} onPageChange={onChange} />
|
|
176
|
+
</PageWrapper>
|
|
177
|
+
<ListBottomKeywd routeType={RouteType.SUCCESS} tel={tel} />
|
|
178
|
+
</>
|
|
179
|
+
);
|
|
180
|
+
};
|
|
181
|
+
export default TrendList;
|