@daeryun/dr_components 0.9.23 → 0.9.25

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.
@@ -12,6 +12,7 @@ import React, { useEffect, useRef, useState } from 'react';
12
12
  import Image from 'next/image';
13
13
  import { useMutation } from '@tanstack/react-query';
14
14
  import { getCookie } from '../../../lib';
15
+ import ConfirmModal from './LoginComp/Modal/ConfirmModal';
15
16
  const Box = ({ code, code_name, selected, selectedList, setSelectedList, activeTooltipId, setActiveTooltipId, tooltipTimeoutRef }) => {
16
17
  const [tooltipStyle, setTooltipStyle] = useState({});
17
18
  const buttonRef = useRef(null);
@@ -139,6 +140,11 @@ const StepOne = () => {
139
140
  const [selectedList, setSelectedList] = useState([]);
140
141
  const [activeTooltipId, setActiveTooltipId] = useState(null);
141
142
  const tooltipTimeoutRef = useRef(null);
143
+ const [isModal, setIsModal] = useState(false);
144
+ const [modalObj, setModalObj] = useState({
145
+ title: '',
146
+ subTitle: ''
147
+ });
142
148
  const categories = [
143
149
  { code: 'CT0004', code_name: '기업법무' },
144
150
  { code: 'CT0014', code_name: '지식재산권' },
@@ -189,6 +195,11 @@ const StepOne = () => {
189
195
  // 필요시 에러 처리 로직 추가
190
196
  }
191
197
  });
198
+ const modalHandleClose = () => {
199
+ setIsModal(false);
200
+ setModalObj({ title: '', subTitle: '' });
201
+ window.location.href = '/login/sign/step_two';
202
+ };
192
203
  // 다음 버튼 클릭 시 세션 스토리지에 category 값 저장
193
204
  const handleNext = () => __awaiter(void 0, void 0, void 0, function* () {
194
205
  const existingLogin = sessionStorage.getItem('login');
@@ -203,7 +214,9 @@ const StepOne = () => {
203
214
  }
204
215
  const updatedLoginData = Object.assign(Object.assign({}, loginData), { selectedCategories: selectedList });
205
216
  sessionStorage.setItem('login', JSON.stringify(updatedLoginData));
206
- window.location.href = '/login/sign/step_two';
217
+ setModalObj({ title: '회원가입이 완료되었습니다.', subTitle: '' });
218
+ setIsModal(true);
219
+ sessionStorage.removeItem('login');
207
220
  });
208
221
  const handleSkip = () => __awaiter(void 0, void 0, void 0, function* () {
209
222
  try {
@@ -283,6 +296,8 @@ const StepOne = () => {
283
296
  </button>
284
297
  </div>
285
298
  </div>
299
+
300
+ <ConfirmModal isOpen={isModal} handleClick={modalHandleClose} onClose={modalHandleClose} title={modalObj.title} subTitle={modalObj.subTitle}/>
286
301
  </>);
287
302
  };
288
303
  export default StepOne;
@@ -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
  code,
@@ -199,6 +200,12 @@ const StepOne = () => {
199
200
  const [selectedList, setSelectedList] = useState<string[]>([]);
200
201
  const [activeTooltipId, setActiveTooltipId] = useState<string | null>(null);
201
202
  const tooltipTimeoutRef = useRef<NodeJS.Timeout | null>(null);
203
+ const [isModal, setIsModal] = useState<boolean>(false);
204
+ const [modalObj, setModalObj] = useState<{ title: string; subTitle: string }>({
205
+ title: '',
206
+ subTitle: ''
207
+ });
208
+
202
209
  const categories = [
203
210
  { code: 'CT0004', code_name: '기업법무' },
204
211
  { code: 'CT0014', code_name: '지식재산권' },
@@ -253,6 +260,12 @@ const StepOne = () => {
253
260
  }
254
261
  });
255
262
 
263
+ const modalHandleClose = () => {
264
+ setIsModal(false);
265
+ setModalObj({ title: '', subTitle: '' });
266
+ window.location.href = '/login/sign/step_two';
267
+ };
268
+
256
269
  // 다음 버튼 클릭 시 세션 스토리지에 category 값 저장
257
270
  const handleNext = async () => {
258
271
  const existingLogin = sessionStorage.getItem('login');
@@ -273,7 +286,10 @@ const StepOne = () => {
273
286
 
274
287
  sessionStorage.setItem('login', JSON.stringify(updatedLoginData));
275
288
 
276
- window.location.href = '/login/sign/step_two';
289
+ setModalObj({ title: '회원가입이 완료되었습니다.', subTitle: '' });
290
+ setIsModal(true);
291
+
292
+ sessionStorage.removeItem('login');
277
293
  };
278
294
 
279
295
  const handleSkip = async () => {
@@ -389,6 +405,14 @@ const StepOne = () => {
389
405
  </button>
390
406
  </div>
391
407
  </div>
408
+
409
+ <ConfirmModal
410
+ isOpen={isModal}
411
+ handleClick={modalHandleClose}
412
+ onClose={modalHandleClose}
413
+ title={modalObj.title}
414
+ subTitle={modalObj.subTitle}
415
+ />
392
416
  </>
393
417
  );
394
418
  };
@@ -8,6 +8,8 @@ export { default as MyCasePage } from './MyCase/MyCasePage';
8
8
  export { default as MyCaseDetailPage } from './MyCase/[id]/MyCaseDetailPage';
9
9
  export { default as Login } from './Login/Login';
10
10
  export { default as Sign } from './Login/Sign';
11
+ export { default as StepOne } from './Login/StepOne';
12
+ export { default as StepTwo } from './Login/StepTwo';
11
13
  export { default as logout } from './Login/_api/logout';
12
14
  export { default as goToAIDaeryun } from './Login/_lib/goToAIDaeryun';
13
15
  export { default as FaqList } from './Faq/FaqList';
@@ -10,6 +10,8 @@ export { default as MyCasePage } from './MyCase/MyCasePage';
10
10
  export { default as MyCaseDetailPage } from './MyCase/[id]/MyCaseDetailPage';
11
11
  export { default as Login } from './Login/Login';
12
12
  export { default as Sign } from './Login/Sign';
13
+ export { default as StepOne } from './Login/StepOne';
14
+ export { default as StepTwo } from './Login/StepTwo';
13
15
  export { default as logout } from './Login/_api/logout';
14
16
  export { default as goToAIDaeryun } from './Login/_lib/goToAIDaeryun';
15
17
  export { default as FaqList } from './Faq/FaqList';
@@ -10,6 +10,8 @@ export { default as MyCasePage } from './MyCase/MyCasePage';
10
10
  export { default as MyCaseDetailPage } from './MyCase/[id]/MyCaseDetailPage';
11
11
  export { default as Login } from './Login/Login';
12
12
  export { default as Sign } from './Login/Sign';
13
+ export { default as StepOne } from './Login/StepOne';
14
+ export { default as StepTwo } from './Login/StepTwo';
13
15
  export { default as logout } from './Login/_api/logout';
14
16
  export { default as goToAIDaeryun } from './Login/_lib/goToAIDaeryun';
15
17
  export { default as FaqList } from './Faq/FaqList';