@daeryun/dr_components 1.2.11 → 1.2.13

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.
Files changed (32) hide show
  1. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  2. package/dist/components/common/integrate/index.d.ts +1 -1
  3. package/dist/components/page/Integrate/Broadcast.d.ts +1 -0
  4. package/dist/components/page/Integrate/Broadcast.jsx +1 -4
  5. package/dist/components/page/Integrate/Broadcast.tsx +2 -5
  6. package/dist/components/page/Integrate/Field.d.ts +1 -0
  7. package/dist/components/page/Integrate/Field.jsx +1 -4
  8. package/dist/components/page/Integrate/Field.tsx +2 -4
  9. package/dist/components/page/Integrate/LawInfo.d.ts +1 -0
  10. package/dist/components/page/Integrate/LawInfo.jsx +1 -4
  11. package/dist/components/page/Integrate/LawInfo.tsx +2 -4
  12. package/dist/components/page/Integrate/Lawyer.d.ts +1 -0
  13. package/dist/components/page/Integrate/Lawyer.jsx +1 -4
  14. package/dist/components/page/Integrate/Lawyer.tsx +2 -4
  15. package/dist/components/page/Integrate/Reply.d.ts +1 -0
  16. package/dist/components/page/Integrate/Reply.jsx +1 -4
  17. package/dist/components/page/Integrate/Reply.tsx +2 -4
  18. package/dist/components/page/Integrate/SearchData.jsx +27 -75
  19. package/dist/components/page/Integrate/SearchData.tsx +42 -106
  20. package/dist/components/page/Integrate/Success.d.ts +1 -0
  21. package/dist/components/page/Integrate/Success.jsx +1 -4
  22. package/dist/components/page/Integrate/Success.tsx +2 -5
  23. package/dist/components/page/Integrate/Trend.d.ts +1 -0
  24. package/dist/components/page/Integrate/Trend.jsx +1 -4
  25. package/dist/components/page/Integrate/Trend.tsx +2 -4
  26. package/dist/components/page/Integrate/ViewMore.jsx +11 -13
  27. package/dist/components/page/Integrate/ViewMore.tsx +30 -31
  28. package/dist/components/page/Integrate/integrateType.d.ts +9 -0
  29. package/dist/components/page/Integrate/integrateType.ts +10 -0
  30. package/dist/styles/globals.css +426 -409
  31. package/dist/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +1 -1
@@ -26,10 +26,10 @@ const Reply = (props: {
26
26
  reply: number;
27
27
  trend: number;
28
28
  };
29
+ loading: boolean;
29
30
  }) => {
30
- const { tab, onMoreViewText, list, pages, isMobileSize, onMoreView, search, listCount } = props;
31
+ const { tab, onMoreViewText, list, pages, isMobileSize, onMoreView, search, listCount, loading } = props;
31
32
 
32
- const [loading, setLoading] = useState<boolean>(false);
33
33
  const [allTabPage, setAllTabPage] = useState<number>(0);
34
34
  const [allTabList, setAllTabList] = useState<IReplyTypes[]>([]);
35
35
 
@@ -146,9 +146,7 @@ const Reply = (props: {
146
146
  totalPage={Math.ceil(listCount.reply / 12)}
147
147
  nowPage={pages.replyList}
148
148
  func={() => {
149
- setLoading(true);
150
149
  onMoreView();
151
- setLoading(false);
152
150
  }}
153
151
  />
154
152
  )}{' '}
@@ -28,6 +28,15 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
28
28
  const [list, setList] = useState(searchInit.list);
29
29
  const [pages, setPages] = useState(searchInit.pages);
30
30
  const [isMobileSize, setIsMobileSize] = useState(null);
31
+ const [loading, setLoading] = useState({
32
+ field: false,
33
+ success: false,
34
+ info: false,
35
+ lawyer: false,
36
+ broadcast: false,
37
+ reply: false,
38
+ trend: false
39
+ });
31
40
  const searchParams = useSearchParams();
32
41
  const querySearch = searchParams.get('search');
33
42
  const queryTab = searchParams.get('tab');
@@ -40,6 +49,17 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
40
49
  const handleMoreViewText = (tab) => __awaiter(void 0, void 0, void 0, function* () {
41
50
  yield router.push(`/integrate?search=${querySearch}&tab=${tab}`);
42
51
  });
52
+ const loadMore = (pageKey, type) => __awaiter(void 0, void 0, void 0, function* () {
53
+ setLoading(prev => (Object.assign(Object.assign({}, prev), { [type]: true })));
54
+ yield paramFetch('/api/integrate/list', {
55
+ page: pages[pageKey],
56
+ type,
57
+ search
58
+ }, (obj) => __awaiter(void 0, void 0, void 0, function* () {
59
+ handleMoreView(pageKey, obj.data.list[pageKey]);
60
+ setLoading(prev => (Object.assign(Object.assign({}, prev), { [type]: false })));
61
+ }));
62
+ });
43
63
  useEffect(() => {
44
64
  setList(propsList);
45
65
  }, [propsList]);
@@ -61,82 +81,14 @@ const SearchData = ({ list: propsList, totalCount, listCount, center_code, crime
61
81
  }, [width, isMobileSize]);
62
82
  return (<span id={'integrate-result'}>
63
83
  {tab === '전체' && totalCount < 1 ? (<NoResult />) : (<>
64
- <Field isMobileSize={isMobileSize} listCount={listCount} center_code={center_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
65
- paramFetch(`/api/integrate/list`, {
66
- page: pages.fieldList,
67
- type: 'field',
68
- search: search,
69
- center_code: center_code,
70
- crime_code: crime_code
71
- }, (obj) => {
72
- handleMoreView('fieldList', obj.data.list.fieldList);
73
- });
74
- }} search={search}/>
75
- <Success isMobileSize={isMobileSize} center_code={center_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
76
- paramFetch('/api/integrate/list', {
77
- page: pages.successList,
78
- type: 'success',
79
- search: search,
80
- center_code: center_code,
81
- crime_code: crime_code
82
- }, (obj) => {
83
- handleMoreView('successList', obj.data.list.successList);
84
- });
85
- }} search={search} listCount={listCount}/>
86
- <LawInfo isMobileSize={isMobileSize} center_code={center_code} tab={tab} list={list} pages={pages} listCount={listCount} onMoreViewText={handleMoreViewText} onMoreView={() => {
87
- paramFetch('/api/integrate/list', {
88
- page: pages.infoList,
89
- type: 'info',
90
- search: search,
91
- center_code: center_code,
92
- crime_code: crime_code
93
- }, (obj) => {
94
- handleMoreView('infoList', obj.data.list.infoList);
95
- });
96
- }} search={search}/>
97
- <Lawyer isMobileSize={isMobileSize} tab={tab} listCount={listCount} list={list} pages={pages} center_code={center_code} onMoreViewText={handleMoreViewText} onMoreView={() => {
98
- paramFetch(`api/integrate/list`, {
99
- page: pages.lawyerList,
100
- type: 'lawyer',
101
- search: search,
102
- center_code: center_code,
103
- crime_code: crime_code
104
- }, (obj) => {
105
- handleMoreView('lawyerList', obj.data.list.lawyerList);
106
- });
107
- }}/>
108
- <Reply isMobileSize={isMobileSize} crime_code={crime_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
109
- paramFetch('/api/integrate/list', {
110
- page: pages.replyList,
111
- type: 'reply',
112
- search: search,
113
- center_code: center_code,
114
- crime_code: crime_code
115
- }, (obj) => {
116
- handleMoreView('replyList', obj.data.list.replyList);
117
- });
118
- }} listCount={listCount} search={search}/>
119
- <Broadcast isMobileSize={isMobileSize} listCount={listCount} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
120
- paramFetch('/api/integrate/list', {
121
- page: pages.broadcastList,
122
- type: 'broadcast',
123
- search: search,
124
- center_code: center_code,
125
- crime_code: crime_code
126
- }, (obj) => {
127
- handleMoreView('broadcastList', obj.data.list.broadcastList);
128
- });
129
- }} search={search}/>
84
+ <Field isMobileSize={isMobileSize} listCount={listCount} center_code={center_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => loadMore('fieldList', 'field')} search={search} loading={loading.field}/>
85
+ <Success isMobileSize={isMobileSize} center_code={center_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => loadMore('successList', 'success')} search={search} loading={loading.success} listCount={listCount}/>
86
+ <LawInfo isMobileSize={isMobileSize} center_code={center_code} tab={tab} list={list} pages={pages} listCount={listCount} onMoreViewText={handleMoreViewText} onMoreView={() => loadMore('infoList', 'info')} search={search} loading={loading.info}/>
87
+ <Lawyer isMobileSize={isMobileSize} tab={tab} listCount={listCount} list={list} pages={pages} center_code={center_code} onMoreViewText={handleMoreViewText} onMoreView={() => loadMore('lawyerList', 'lawyer')} loading={loading.lawyer}/>
88
+ <Reply isMobileSize={isMobileSize} crime_code={crime_code} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => loadMore('replyList', 'reply')} search={search} loading={loading.reply} listCount={listCount}/>
89
+ <Broadcast isMobileSize={isMobileSize} listCount={listCount} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => loadMore('broadcastList', 'broadcast')} search={search} loading={loading.broadcast}/>
130
90
 
131
- <Trend isMobileSize={isMobileSize} listCount={listCount} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => {
132
- paramFetch('/api/integrate/list', {
133
- page: pages.trendList,
134
- type: 'trend',
135
- search: search
136
- }, (obj) => {
137
- handleMoreView('trendList', obj.data.list.trendList);
138
- });
139
- }} search={search}/>
91
+ <Trend isMobileSize={isMobileSize} listCount={listCount} tab={tab} list={list} pages={pages} onMoreViewText={handleMoreViewText} onMoreView={() => loadMore('trendList', 'trend')} search={search} loading={loading.trend}/>
140
92
 
141
93
  {/*<Map*/}
142
94
  {/* isMobileSize={isMobileSize}*/}
@@ -2,7 +2,7 @@
2
2
 
3
3
  import React, { useState, useEffect } from 'react';
4
4
  import { NoResult } from './NoResult';
5
- import { IListPagesType, IListTypes, searchInit } from './integrateType';
5
+ import { IListPagesType, IListTypes, ILoadingTypes, searchInit } from './integrateType';
6
6
  import { useRouter, useSearchParams } from 'next/navigation';
7
7
  import Field from './Field';
8
8
  import Success from './Success';
@@ -42,6 +42,15 @@ const SearchData = ({
42
42
  const [list, setList] = useState<IListTypes>(searchInit.list);
43
43
  const [pages, setPages] = useState<IListPagesType>(searchInit.pages);
44
44
  const [isMobileSize, setIsMobileSize] = useState<boolean | null>(null);
45
+ const [loading, setLoading] = useState<ILoadingTypes>({
46
+ field: false,
47
+ success: false,
48
+ info: false,
49
+ lawyer: false,
50
+ broadcast: false,
51
+ reply: false,
52
+ trend: false
53
+ });
45
54
 
46
55
  const searchParams = useSearchParams();
47
56
  const querySearch = searchParams.get('search');
@@ -57,6 +66,23 @@ const SearchData = ({
57
66
  await router.push(`/integrate?search=${querySearch}&tab=${tab}`);
58
67
  };
59
68
 
69
+ const loadMore = async (pageKey: keyof IListPagesType, type: string) => {
70
+ setLoading(prev => ({ ...prev, [type]: true }));
71
+
72
+ await paramFetch(
73
+ '/api/integrate/list',
74
+ {
75
+ page: pages[pageKey],
76
+ type,
77
+ search
78
+ },
79
+ async (obj: any) => {
80
+ handleMoreView(pageKey, obj.data.list[pageKey]);
81
+ setLoading(prev => ({ ...prev, [type]: false }));
82
+ }
83
+ );
84
+ };
85
+
60
86
  useEffect(() => {
61
87
  setList(propsList);
62
88
  }, [propsList]);
@@ -93,23 +119,9 @@ const SearchData = ({
93
119
  list={list}
94
120
  pages={pages}
95
121
  onMoreViewText={handleMoreViewText}
96
- onMoreView={() => {
97
- paramFetch(
98
- `/api/integrate/list`,
99
- {
100
- page: pages.fieldList,
101
- type: 'field',
102
- search: search,
103
- center_code: center_code,
104
- crime_code: crime_code
105
- },
106
-
107
- (obj: any) => {
108
- handleMoreView('fieldList', obj.data.list.fieldList);
109
- }
110
- );
111
- }}
122
+ onMoreView={() => loadMore('fieldList', 'field')}
112
123
  search={search}
124
+ loading={loading.field}
113
125
  />
114
126
  <Success
115
127
  isMobileSize={isMobileSize}
@@ -118,22 +130,9 @@ const SearchData = ({
118
130
  list={list}
119
131
  pages={pages}
120
132
  onMoreViewText={handleMoreViewText}
121
- onMoreView={() => {
122
- paramFetch(
123
- '/api/integrate/list',
124
- {
125
- page: pages.successList,
126
- type: 'success',
127
- search: search,
128
- center_code: center_code,
129
- crime_code: crime_code
130
- },
131
- (obj: any) => {
132
- handleMoreView('successList', obj.data.list.successList);
133
- }
134
- );
135
- }}
133
+ onMoreView={() => loadMore('successList', 'success')}
136
134
  search={search}
135
+ loading={loading.success}
137
136
  listCount={listCount}
138
137
  />
139
138
  <LawInfo
@@ -144,22 +143,9 @@ const SearchData = ({
144
143
  pages={pages}
145
144
  listCount={listCount}
146
145
  onMoreViewText={handleMoreViewText}
147
- onMoreView={() => {
148
- paramFetch(
149
- '/api/integrate/list',
150
- {
151
- page: pages.infoList,
152
- type: 'info',
153
- search: search,
154
- center_code: center_code,
155
- crime_code: crime_code
156
- },
157
- (obj: any) => {
158
- handleMoreView('infoList', obj.data.list.infoList);
159
- }
160
- );
161
- }}
146
+ onMoreView={() => loadMore('infoList', 'info')}
162
147
  search={search}
148
+ loading={loading.info}
163
149
  />
164
150
  <Lawyer
165
151
  isMobileSize={isMobileSize}
@@ -169,21 +155,8 @@ const SearchData = ({
169
155
  pages={pages}
170
156
  center_code={center_code}
171
157
  onMoreViewText={handleMoreViewText}
172
- onMoreView={() => {
173
- paramFetch(
174
- `api/integrate/list`,
175
- {
176
- page: pages.lawyerList,
177
- type: 'lawyer',
178
- search: search,
179
- center_code: center_code,
180
- crime_code: crime_code
181
- },
182
- (obj: any) => {
183
- handleMoreView('lawyerList', obj.data.list.lawyerList);
184
- }
185
- );
186
- }}
158
+ onMoreView={() => loadMore('lawyerList', 'lawyer')}
159
+ loading={loading.lawyer}
187
160
  />
188
161
  <Reply
189
162
  isMobileSize={isMobileSize}
@@ -192,23 +165,10 @@ const SearchData = ({
192
165
  list={list}
193
166
  pages={pages}
194
167
  onMoreViewText={handleMoreViewText}
195
- onMoreView={() => {
196
- paramFetch(
197
- '/api/integrate/list',
198
- {
199
- page: pages.replyList,
200
- type: 'reply',
201
- search: search,
202
- center_code: center_code,
203
- crime_code: crime_code
204
- },
205
- (obj: any) => {
206
- handleMoreView('replyList', obj.data.list.replyList);
207
- }
208
- );
209
- }}
210
- listCount={listCount}
168
+ onMoreView={() => loadMore('replyList', 'reply')}
211
169
  search={search}
170
+ loading={loading.reply}
171
+ listCount={listCount}
212
172
  />
213
173
  <Broadcast
214
174
  isMobileSize={isMobileSize}
@@ -217,22 +177,9 @@ const SearchData = ({
217
177
  list={list}
218
178
  pages={pages}
219
179
  onMoreViewText={handleMoreViewText}
220
- onMoreView={() => {
221
- paramFetch(
222
- '/api/integrate/list',
223
- {
224
- page: pages.broadcastList,
225
- type: 'broadcast',
226
- search: search,
227
- center_code: center_code,
228
- crime_code: crime_code
229
- },
230
- (obj: any) => {
231
- handleMoreView('broadcastList', obj.data.list.broadcastList);
232
- }
233
- );
234
- }}
180
+ onMoreView={() => loadMore('broadcastList', 'broadcast')}
235
181
  search={search}
182
+ loading={loading.broadcast}
236
183
  />
237
184
 
238
185
  <Trend
@@ -242,20 +189,9 @@ const SearchData = ({
242
189
  list={list}
243
190
  pages={pages}
244
191
  onMoreViewText={handleMoreViewText}
245
- onMoreView={() => {
246
- paramFetch(
247
- '/api/integrate/list',
248
- {
249
- page: pages.trendList,
250
- type: 'trend',
251
- search: search
252
- },
253
- (obj: any) => {
254
- handleMoreView('trendList', obj.data.list.trendList);
255
- }
256
- );
257
- }}
192
+ onMoreView={() => loadMore('trendList', 'trend')}
258
193
  search={search}
194
+ loading={loading.trend}
259
195
  />
260
196
 
261
197
  {/*<Map*/}
@@ -18,5 +18,6 @@ declare const Success: (props: {
18
18
  reply: number;
19
19
  trend: number;
20
20
  };
21
+ loading: boolean;
21
22
  }) => React.JSX.Element;
22
23
  export default Success;
@@ -6,8 +6,7 @@ import { ViewMore } from './ViewMore';
6
6
  import { searchColorText } from '../../common/integrate';
7
7
  const Success = (props) => {
8
8
  var _a;
9
- const { tab, onMoreViewText, list, pages, onMoreView, search, listCount, isMobileSize } = props;
10
- const [loading, setLoading] = useState(false);
9
+ const { tab, onMoreViewText, list, pages, onMoreView, search, listCount, isMobileSize, loading } = props;
11
10
  const [allTabPage, setAllTabPage] = useState(0);
12
11
  const [allTabList, setAllTabList] = useState([]);
13
12
  const getAllPage = () => {
@@ -74,9 +73,7 @@ const Success = (props) => {
74
73
  })}
75
74
  </div>)}
76
75
  {tab != '전체' && (<ViewMore flag={list.successList.length != listCount.success} loading={loading} totalPage={Math.ceil(listCount.success / 12)} nowPage={pages.successList} func={() => {
77
- setLoading(true);
78
76
  onMoreView();
79
- setLoading(false);
80
77
  }}/>)}{' '}
81
78
  {tab === '전체' && (<ViewMore flag={allTabList.length != listCount.success} func={() => {
82
79
  getAllPage();
@@ -25,10 +25,9 @@ const Success = (props: {
25
25
  reply: number;
26
26
  trend: number;
27
27
  };
28
+ loading: boolean;
28
29
  }) => {
29
- const { tab, onMoreViewText, list, pages, onMoreView, search, listCount, isMobileSize } = props;
30
-
31
- const [loading, setLoading] = useState<boolean>(false);
30
+ const { tab, onMoreViewText, list, pages, onMoreView, search, listCount, isMobileSize, loading } = props;
32
31
 
33
32
  const [allTabPage, setAllTabPage] = useState<number>(0);
34
33
  const [allTabList, setAllTabList] = useState<ISuccessTypes[]>([]);
@@ -159,9 +158,7 @@ const Success = (props: {
159
158
  totalPage={Math.ceil(listCount.success / 12)}
160
159
  nowPage={pages.successList}
161
160
  func={() => {
162
- setLoading(true);
163
161
  onMoreView();
164
- setLoading(false);
165
162
  }}
166
163
  />
167
164
  )}{' '}
@@ -17,5 +17,6 @@ declare const Trend: (props: {
17
17
  reply: number;
18
18
  trend: number;
19
19
  };
20
+ loading: boolean;
20
21
  }) => React.JSX.Element;
21
22
  export default Trend;
@@ -6,8 +6,7 @@ import { Title } from './Title';
6
6
  import { ViewMore } from './ViewMore';
7
7
  import { searchColorText } from '../../common/integrate';
8
8
  const Trend = (props) => {
9
- const { tab, onMoreViewText, list, pages, onMoreView, search, isMobileSize, listCount } = props;
10
- const [loading, setLoading] = useState(false);
9
+ const { tab, onMoreViewText, list, pages, onMoreView, search, isMobileSize, listCount, loading } = props;
11
10
  const [allTabPage, setAllTabPage] = useState(0);
12
11
  const [allTabList, setAllTabList] = useState([]);
13
12
  const getAllPage = () => {
@@ -64,9 +63,7 @@ const Trend = (props) => {
64
63
  })}
65
64
  </div>
66
65
  {tab != '전체' && (<ViewMore flag={list.trendList.length != listCount.trend} loading={loading} totalPage={Math.ceil(listCount.trend / 12)} nowPage={pages.trendList} func={() => {
67
- setLoading(true);
68
66
  onMoreView();
69
- setLoading(false);
70
67
  }}/>)}
71
68
  {tab === '전체' && (<ViewMore flag={allTabList.length != listCount.trend} func={() => {
72
69
  getAllPage();
@@ -24,10 +24,10 @@ const Trend = (props: {
24
24
  reply: number;
25
25
  trend: number;
26
26
  };
27
+ loading: boolean;
27
28
  }) => {
28
- const { tab, onMoreViewText, list, pages, onMoreView, search, isMobileSize, listCount } = props;
29
+ const { tab, onMoreViewText, list, pages, onMoreView, search, isMobileSize, listCount, loading } = props;
29
30
 
30
- const [loading, setLoading] = useState<boolean>(false);
31
31
  const [allTabPage, setAllTabPage] = useState<number>(0);
32
32
  const [allTabList, setAllTabList] = useState<ITrendTypes[]>([]);
33
33
 
@@ -145,9 +145,7 @@ const Trend = (props: {
145
145
  totalPage={Math.ceil(listCount.trend / 12)}
146
146
  nowPage={pages.trendList}
147
147
  func={() => {
148
- setLoading(true);
149
148
  onMoreView();
150
- setLoading(false);
151
149
  }}
152
150
  />
153
151
  )}
@@ -1,28 +1,26 @@
1
1
  import Image from 'next/image';
2
2
  import React from 'react';
3
- import Loader from '../../Loader/Loader';
4
3
  export const ViewMore = (props) => {
5
4
  const { func, loading, flag, totalPage, nowPage, label = '' } = props;
6
5
  const labelTxt = `${label} 글 더보기${nowPage && totalPage ? ` ${totalPage}페이지 중 ${nowPage - 1}페이지` : ''}`;
7
6
  return (<>
8
- {flag ? (loading ? (<b className={'mb-20 text-center'}>
9
- <Loader />
10
- </b>) : (<button aria-label={labelTxt} className={(nowPage && totalPage ? ' px-5 ' : ' px-10 ') +
11
- 'relative m-auto mb-20 mt-20 flex w-[10em] cursor-pointer items-center justify-between border-[1px] border-solid border-[#707070] py-4 text-[#666666] '} onKeyDown={(e) => {
7
+ {flag ? (<button aria-label={labelTxt} className={(loading ? 'pointer-events-none ' : '') +
8
+ (nowPage && totalPage ? ' px-4 ' : ' px-10 ') +
9
+ 'relative m-auto mb-20 mt-20 flex h-[52px] w-[10em] cursor-pointer items-center justify-between border-[1px] border-solid border-[#707070] py-4 text-[#666666] '} onKeyDown={(e) => {
12
10
  if (e.key === 'Enter') {
13
11
  func();
14
12
  }
15
13
  }} onClick={() => {
16
14
  func();
17
15
  }}>
18
- <p className={'pt-[2px] leading-[15px] text-[#666666] '}>
19
- 더보기{' '}
20
- {nowPage && totalPage ? (<span>
21
- {nowPage - 1}/{totalPage}{' '}
22
- </span>) : (<></>)}
23
- </p>
16
+ <p className={'pt-[2px] leading-[15px] text-[#666666] '}>
17
+ 더보기{' '}
18
+ {nowPage && totalPage ? (<span>
19
+ {nowPage - 1}/{totalPage}{' '}
20
+ </span>) : (<></>)}
21
+ </p>
24
22
 
25
- <Image src={'/images/plus_g.webp'} alt={''} width={44} height={44} className={'h-auto w-[18px] max-lg:w-[16px] max-sm:w-[15px] max-2xs:w-[13px]'}/>
26
- </button>)) : null}
23
+ {loading ? (<div className="h-[25px] w-[25px] animate-spin rounded-full border-[3px] border-solid border-primary border-t-transparent"/>) : (<Image src={'/images/plus_g.webp'} alt={''} width={44} height={44} className={'h-auto w-[18px] max-lg:w-[16px] max-sm:w-[15px] max-2xs:w-[13px]'}/>)}
24
+ </button>) : null}
27
25
  </>);
28
26
  };
@@ -17,37 +17,36 @@ export const ViewMore = (props: {
17
17
  return (
18
18
  <>
19
19
  {flag ? (
20
- loading ? (
21
- <b className={'mb-20 text-center'}>
22
- <Loader />
23
- </b>
24
- ) : (
25
- <button
26
- aria-label={labelTxt}
27
- className={
28
- (nowPage && totalPage ? ' px-5 ' : ' px-10 ') +
29
- 'relative m-auto mb-20 mt-20 flex w-[10em] cursor-pointer items-center justify-between border-[1px] border-solid border-[#707070] py-4 text-[#666666] '
30
- }
31
- onKeyDown={(e: any) => {
32
- if (e.key === 'Enter') {
33
- func();
34
- }
35
- }}
36
- onClick={() => {
20
+ <button
21
+ aria-label={labelTxt}
22
+ className={
23
+ (loading ? 'pointer-events-none ' : '') +
24
+ (nowPage && totalPage ? ' px-4 ' : ' px-10 ') +
25
+ 'relative m-auto mb-20 mt-20 flex h-[52px] w-[10em] cursor-pointer items-center justify-between border-[1px] border-solid border-[#707070] py-4 text-[#666666] '
26
+ }
27
+ onKeyDown={(e: any) => {
28
+ if (e.key === 'Enter') {
37
29
  func();
38
- }}
39
- >
40
- <p className={'pt-[2px] leading-[15px] text-[#666666] '}>
41
- 더보기{' '}
42
- {nowPage && totalPage ? (
43
- <span>
44
- {nowPage - 1}/{totalPage}{' '}
45
- </span>
46
- ) : (
47
- <></>
48
- )}
49
- </p>
30
+ }
31
+ }}
32
+ onClick={() => {
33
+ func();
34
+ }}
35
+ >
36
+ <p className={'pt-[2px] leading-[15px] text-[#666666] '}>
37
+ 더보기{' '}
38
+ {nowPage && totalPage ? (
39
+ <span>
40
+ {nowPage - 1}/{totalPage}{' '}
41
+ </span>
42
+ ) : (
43
+ <></>
44
+ )}
45
+ </p>
50
46
 
47
+ {loading ? (
48
+ <div className="h-[25px] w-[25px] animate-spin rounded-full border-[3px] border-solid border-primary border-t-transparent" />
49
+ ) : (
51
50
  <Image
52
51
  src={'/images/plus_g.webp'}
53
52
  alt={''}
@@ -55,8 +54,8 @@ export const ViewMore = (props: {
55
54
  height={44}
56
55
  className={'h-auto w-[18px] max-lg:w-[16px] max-sm:w-[15px] max-2xs:w-[13px]'}
57
56
  />
58
- </button>
59
- )
57
+ )}
58
+ </button>
60
59
  ) : null}
61
60
  </>
62
61
  );
@@ -58,6 +58,15 @@ export declare const searchInit: {
58
58
  trend: number;
59
59
  };
60
60
  };
61
+ export interface ILoadingTypes {
62
+ field: boolean;
63
+ success: boolean;
64
+ info: boolean;
65
+ lawyer: boolean;
66
+ broadcast: boolean;
67
+ reply: boolean;
68
+ trend: boolean;
69
+ }
61
70
  export interface IBroadCastTypes {
62
71
  id: number;
63
72
  title: string;
@@ -61,6 +61,16 @@ export const searchInit = {
61
61
  }
62
62
  };
63
63
 
64
+ export interface ILoadingTypes {
65
+ field: boolean;
66
+ success: boolean;
67
+ info: boolean;
68
+ lawyer: boolean;
69
+ broadcast: boolean;
70
+ reply: boolean;
71
+ trend: boolean;
72
+ }
73
+
64
74
  export interface IBroadCastTypes {
65
75
  id: number;
66
76
  title: string;