@daeryun/dr_components 0.9.45 → 0.9.47

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.
@@ -202,7 +202,6 @@ const StepOne = () => {
202
202
  // 필요시 에러 처리 로직 추가
203
203
  }
204
204
  });
205
- // 다음 버튼 클릭 시 세션 스토리지에 category 값 저장
206
205
  const handleNext = () => __awaiter(void 0, void 0, void 0, function* () {
207
206
  if (selectedList.length === 0) {
208
207
  return;
@@ -217,7 +216,8 @@ const StepOne = () => {
217
216
  console.error('Session storage parsing error:', e);
218
217
  }
219
218
  }
220
- const updatedLoginData = Object.assign(Object.assign({}, loginData), { selectedCategories: selectedList });
219
+ const updatedLoginData = Object.assign(Object.assign({}, loginData), { selectedCategories: selectedList, selectedFields: [] // 새로운 카테고리 선택 시 필드 초기화
220
+ });
221
221
  sessionStorage.setItem('login', JSON.stringify(updatedLoginData));
222
222
  window.location.href = '/login/sign/step_two';
223
223
  });
@@ -270,7 +270,6 @@ const StepOne = () => {
270
270
  }
271
271
  });
272
272
 
273
- // 다음 버튼 클릭 시 세션 스토리지에 category 값 저장
274
273
  const handleNext = async () => {
275
274
  if (selectedList.length === 0) {
276
275
  return;
@@ -289,14 +288,14 @@ const StepOne = () => {
289
288
 
290
289
  const updatedLoginData = {
291
290
  ...loginData,
292
- selectedCategories: selectedList
291
+ selectedCategories: selectedList,
292
+ selectedFields: [] // 새로운 카테고리 선택 시 필드 초기화
293
293
  };
294
294
 
295
295
  sessionStorage.setItem('login', JSON.stringify(updatedLoginData));
296
296
 
297
297
  window.location.href = '/login/sign/step_two';
298
298
  };
299
-
300
299
  const handleSkip = async () => {
301
300
  try {
302
301
  // session storage에서 login 정보 가져오기
@@ -13,6 +13,7 @@ import Image from 'next/image';
13
13
  import { useMutation } from '@tanstack/react-query';
14
14
  import { getCookie } from '../../../lib';
15
15
  import ConfirmModal from './LoginComp/Modal/ConfirmModal';
16
+ import Loader from '../../../components/Loader/Loader';
16
17
  const Box = ({ type_idx, tag_title, selected, selectedList, setSelectedList, activeTooltipId, setActiveTooltipId, tooltipTimeoutRef }) => {
17
18
  const [tooltipStyle, setTooltipStyle] = useState({});
18
19
  const buttonRef = useRef(null);
@@ -163,9 +164,7 @@ const StepTwo = () => {
163
164
  });
164
165
  const [centerCodes, setCenterCodes] = useState([]);
165
166
  const [fieldData, setFieldData] = useState({});
166
- console.log('centerCodes :', centerCodes);
167
- const center_code = 'CT0001';
168
- const center_code2 = 'CT0025';
167
+ const [isLoading, setIsLoading] = useState(false);
169
168
  const categories = [
170
169
  { code: 'CT0004', code_name: '기업법무' },
171
170
  { code: 'CT0014', code_name: '지식재산권' },
@@ -208,288 +207,6 @@ const StepTwo = () => {
208
207
  return { result: false, data: [] };
209
208
  }
210
209
  });
211
- const data1 = {
212
- result: true,
213
- data: [
214
- {
215
- type_idx: 1713,
216
- tag_title: '뇌물수수'
217
- },
218
- {
219
- type_idx: 1937,
220
- tag_title: '업무상과실치사상'
221
- },
222
- {
223
- type_idx: 1914,
224
- tag_title: '데이트폭력처벌'
225
- },
226
- {
227
- type_idx: 6662,
228
- tag_title: '명의도용죄'
229
- },
230
- {
231
- type_idx: 2131,
232
- tag_title: '횡령·횡령죄'
233
- },
234
- {
235
- type_idx: 1967,
236
- tag_title: '음주운전범죄'
237
- },
238
- {
239
- type_idx: 1873,
240
- tag_title: '유사수신행위'
241
- },
242
- {
243
- type_idx: 1649,
244
- tag_title: '강도죄'
245
- },
246
- {
247
- type_idx: 1836,
248
- tag_title: '보이스피싱'
249
- },
250
- {
251
- type_idx: 8947,
252
- tag_title: '주민등록법위반'
253
- },
254
- {
255
- type_idx: 1954,
256
- tag_title: '영업비밀보호법'
257
- },
258
- {
259
- type_idx: 1694,
260
- tag_title: '공직선거법위반'
261
- },
262
- {
263
- type_idx: 2809,
264
- tag_title: '통신비밀보호법위반'
265
- },
266
- {
267
- type_idx: 2594,
268
- tag_title: '위증죄/증거인멸죄'
269
- },
270
- {
271
- type_idx: 1858,
272
- tag_title: '사기죄'
273
- },
274
- {
275
- type_idx: 6664,
276
- tag_title: '아동복지법위반'
277
- },
278
- {
279
- type_idx: 6600,
280
- tag_title: '감금죄'
281
- },
282
- {
283
- type_idx: 1746,
284
- tag_title: '도박죄'
285
- },
286
- {
287
- type_idx: 1927,
288
- tag_title: '업무방해죄'
289
- },
290
- {
291
- type_idx: 1684,
292
- tag_title: '교통사고범죄'
293
- },
294
- {
295
- type_idx: 2801,
296
- tag_title: '장애인복지법위반'
297
- },
298
- {
299
- type_idx: 6623,
300
- tag_title: '경찰사칭죄 '
301
- },
302
- {
303
- type_idx: 2138,
304
- tag_title: '학교폭력'
305
- },
306
- {
307
- type_idx: 3398,
308
- tag_title: '대부업법위반'
309
- },
310
- {
311
- type_idx: 8199,
312
- tag_title: '배임·배임죄'
313
- },
314
- {
315
- type_idx: 1829,
316
- tag_title: '보복운전/난폭운전'
317
- },
318
- {
319
- type_idx: 7547,
320
- tag_title: '가상화폐사기'
321
- },
322
- {
323
- type_idx: 1753,
324
- tag_title: '마약류관리법위반'
325
- },
326
- {
327
- type_idx: 6627,
328
- tag_title: '공무상비밀누설죄'
329
- },
330
- {
331
- type_idx: 2077,
332
- tag_title: '정치자금법위반'
333
- },
334
- {
335
- type_idx: 6630,
336
- tag_title: '공중위생관리법'
337
- },
338
- {
339
- type_idx: 6659,
340
- tag_title: '기물파손죄'
341
- },
342
- {
343
- type_idx: 6602,
344
- tag_title: '강제집행면탈죄'
345
- },
346
- {
347
- type_idx: 2125,
348
- tag_title: '강요죄'
349
- },
350
- {
351
- type_idx: 2815,
352
- tag_title: '보험사기죄'
353
- },
354
- {
355
- type_idx: 8204,
356
- tag_title: '상해'
357
- },
358
- {
359
- type_idx: 1983,
360
- tag_title: '절도죄'
361
- },
362
- {
363
- type_idx: 6633,
364
- tag_title: '국민체육진흥법위반 '
365
- },
366
- {
367
- type_idx: 1771,
368
- tag_title: '명예훼손/허위사실유포'
369
- },
370
- {
371
- type_idx: 1825,
372
- tag_title: '방화죄'
373
- },
374
- {
375
- type_idx: 1902,
376
- tag_title: '스토킹처벌법'
377
- },
378
- {
379
- type_idx: 2101,
380
- tag_title: '폭행·폭행죄'
381
- },
382
- {
383
- type_idx: 1804,
384
- tag_title: '무고죄'
385
- },
386
- {
387
- type_idx: 1971,
388
- tag_title: '재물손괴죄'
389
- },
390
- {
391
- type_idx: 1706,
392
- tag_title: '교육감선거'
393
- },
394
- {
395
- type_idx: 1997,
396
- tag_title: '주거침입죄'
397
- },
398
- {
399
- type_idx: 1817,
400
- tag_title: '문서위조/변조'
401
- },
402
- {
403
- type_idx: 1779,
404
- tag_title: '사이버명예훼손'
405
- },
406
- {
407
- type_idx: 2931,
408
- tag_title: '특경법'
409
- },
410
- {
411
- type_idx: 1992,
412
- tag_title: '특정범죄가중처벌법'
413
- },
414
- {
415
- type_idx: 1918,
416
- tag_title: '아동학대'
417
- },
418
- {
419
- type_idx: 1961,
420
- tag_title: '음주운전동승자처벌'
421
- },
422
- {
423
- type_idx: 2116,
424
- tag_title: '협박죄'
425
- },
426
- {
427
- type_idx: 1661,
428
- tag_title: '개인정보보호법위반'
429
- },
430
- {
431
- type_idx: 1786,
432
- tag_title: '모욕죄'
433
- },
434
- {
435
- type_idx: 1729,
436
- tag_title: '뇌물알선수재죄'
437
- },
438
- {
439
- type_idx: 1680,
440
- tag_title: '공갈죄'
441
- },
442
- {
443
- type_idx: 2094,
444
- tag_title: '부정청탁금지법'
445
- },
446
- {
447
- type_idx: 1843,
448
- tag_title: '전자금융거래법위반'
449
- },
450
- {
451
- type_idx: 1886,
452
- tag_title: '살인죄'
453
- },
454
- {
455
- type_idx: 1690,
456
- tag_title: '공무집행방해죄'
457
- }
458
- ]
459
- };
460
- const data2 = {
461
- result: true,
462
- data: [
463
- {
464
- type_idx: 2615,
465
- tag_title: '엔터테인먼트'
466
- },
467
- {
468
- type_idx: 2634,
469
- tag_title: '게임산업'
470
- },
471
- {
472
- type_idx: 2649,
473
- tag_title: '저작권'
474
- },
475
- {
476
- type_idx: 2717,
477
- tag_title: '상표/디자인'
478
- },
479
- {
480
- type_idx: 2662,
481
- tag_title: '전속계약'
482
- },
483
- {
484
- type_idx: 2620,
485
- tag_title: '스포츠산업'
486
- },
487
- {
488
- type_idx: 2693,
489
- tag_title: '특허/실용신안'
490
- }
491
- ]
492
- };
493
210
  const modalHandleClose = () => {
494
211
  setIsModal(false);
495
212
  setModalObj({ title: '', subTitle: '' });
@@ -538,9 +255,21 @@ const StepTwo = () => {
538
255
  }
539
256
  });
540
257
  const handlePrev = () => {
258
+ try {
259
+ const existingLogin = sessionStorage.getItem('login');
260
+ if (existingLogin) {
261
+ const loginData = JSON.parse(existingLogin);
262
+ delete loginData.selectedFields; // selectedFields 제거
263
+ sessionStorage.setItem('login', JSON.stringify(loginData));
264
+ }
265
+ }
266
+ catch (error) {
267
+ console.error('SessionStorage 업데이트 실패:', error);
268
+ }
541
269
  window.location.href = '/login/sign/step_one';
542
270
  };
543
271
  const handleDone = () => __awaiter(void 0, void 0, void 0, function* () {
272
+ setIsLoading(true);
544
273
  if (selectedList.length === 0) {
545
274
  return;
546
275
  }
@@ -571,6 +300,9 @@ const StepTwo = () => {
571
300
  catch (error) {
572
301
  console.error('Session storage parsing error:', error);
573
302
  }
303
+ finally {
304
+ setIsLoading(false);
305
+ }
574
306
  });
575
307
  // 페이지 로드 시 sessionStorage에서 선택된 카테고리를 읽어서 API 호출
576
308
  useEffect(() => {
@@ -610,6 +342,8 @@ const StepTwo = () => {
610
342
  initializeData();
611
343
  }, []);
612
344
  return (<>
345
+ {isLoading && <Loader fullScreen/>}
346
+
613
347
  <div className="relative mx-[200px] mt-[150px] max-[1498px]:mx-[120px] max-lg:mx-[60px] max-sm:mx-[20px] sm:mt-[240px] lg:mt-[200px] ">
614
348
  <div className="">
615
349
  <p className="title_large_mo sm:title_large_tb lg:title_large">STEP 2</p>
@@ -632,7 +366,7 @@ const StepTwo = () => {
632
366
  </div>
633
367
  </div>
634
368
 
635
- <div className="mt-[28px] flex flex-col gap-[40px] sm:mt-[61px] lg:mt-[66px] ">
369
+ <div className="mt-[28px] flex flex-col gap-[40px] sm:mt-[61px] lg:mt-[66px] ">
636
370
  {/* {data1?.data?.length > 0 && (
637
371
  <div className="sm:flex sm:flex-row sm:rounded-[16px] sm:border sm:border-solid sm:border-grayScale5 sm:p-[40px] lg:rounded-[20px]">
638
372
  <p className="body_large1_mo sm:body_large1_tb lg:body_large1 sm:w-[150px] sm:sm:flex-shrink-0">