@daeryun/dr_components 0.9.26 → 0.9.28

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.
@@ -4,6 +4,7 @@ import React, { useEffect, useRef, useState } from 'react';
4
4
  import Image from 'next/image';
5
5
  import { useMutation } from '@tanstack/react-query';
6
6
  import { getCookie } from '../../../lib';
7
+ import ConfirmModal from './LoginComp/Modal/ConfirmModal';
7
8
 
8
9
  const Box = ({
9
10
  type_idx,
@@ -203,6 +204,11 @@ const StepTwo = () => {
203
204
  const [activeTooltipId, setActiveTooltipId] = useState<number | null>(null);
204
205
  const tooltipTimeoutRef = useRef<NodeJS.Timeout | null>(null);
205
206
  // const { data: categories, isLoading: categoriesLoading } = actionGetDetailCategoryList('CT0001');
207
+ const [isModal, setIsModal] = useState<boolean>(false);
208
+ const [modalObj, setModalObj] = useState<{ title: string; subTitle: string }>({
209
+ title: '',
210
+ subTitle: ''
211
+ });
206
212
 
207
213
  const center_code = 'CT0001';
208
214
  const center_code2 = 'CT0025';
@@ -516,6 +522,14 @@ const StepTwo = () => {
516
522
  ]
517
523
  };
518
524
 
525
+ const modalHandleClose = () => {
526
+ setIsModal(false);
527
+ setModalObj({ title: '', subTitle: '' });
528
+
529
+ const redirect = decodeURIComponent(getCookie('redirect')) || '/';
530
+ window.location.href = redirect;
531
+ };
532
+
519
533
  const doneMutation = useMutation({
520
534
  mutationFn: async (bodyData: {
521
535
  name: string;
@@ -558,8 +572,10 @@ const StepTwo = () => {
558
572
  };
559
573
  },
560
574
  onSuccess: () => {
561
- const redirect = decodeURIComponent(getCookie('redirect')) || '/';
562
- window.location.href = redirect;
575
+ setModalObj({ title: '회원가입이 완료되었습니다.', subTitle: '' });
576
+ setIsModal(true);
577
+
578
+ sessionStorage.removeItem('login');
563
579
  },
564
580
  onError: error => {
565
581
  console.error('Skip API 호출 실패:', error);
@@ -622,8 +638,6 @@ const StepTwo = () => {
622
638
  }
623
639
  }, []);
624
640
 
625
- console.log('selectedList:', selectedList);
626
-
627
641
  return (
628
642
  <>
629
643
  <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] ">
@@ -733,6 +747,14 @@ const StepTwo = () => {
733
747
  </div>
734
748
  </div>
735
749
  </div>
750
+
751
+ <ConfirmModal
752
+ isOpen={isModal}
753
+ handleClick={modalHandleClose}
754
+ onClose={modalHandleClose}
755
+ title={modalObj.title}
756
+ subTitle={modalObj.subTitle}
757
+ />
736
758
  </>
737
759
  );
738
760
  };