@daeryun/dr_components 0.4.47 → 0.4.49

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.
@@ -11,7 +11,13 @@ import { useParams, usePathname, useRouter, useSearchParams } from 'next/navigat
11
11
  import { useQuery } from 'react-query';
12
12
  import getCase from '../../_fetchers/getCase';
13
13
  import { DetailList, FetchType, FileList, Question, TimeLineType } from '../../_type/type';
14
- import { useActionGetDetailList, useActionGetMyCaseQuestion, useActionGetTimeLine } from '../../_actions/action';
14
+ import {
15
+ useActionGetCourtFileList,
16
+ useActionGetDetailList,
17
+ useActionGetMyCaseQuestion,
18
+ useActionGetMyFileList,
19
+ useActionGetTimeLine
20
+ } from '../../_actions/action';
15
21
  import background from '../../../../../asset/images/myCase/background.webp';
16
22
  import backgroundTb from '../../../../../asset/images/myCase/background_tb.webp';
17
23
  import backgroundMo from '../../../../../asset/images/myCase/background_mo.webp';
@@ -20,6 +26,7 @@ import TimeLine from './../_component/TimeLine';
20
26
  import ContactInfo from './../_component/ContactInfo';
21
27
  import CaseInquiry from './../_component/_caseInquiry/CaseInquiry';
22
28
  import CaseTabSwiper from '../../_component/_table/CaseTabSwiper';
29
+ import Document from './_document/Document';
23
30
  const MyCaseDetailPageContainer = ({ jwt }: { jwt?: string }) => {
24
31
  const [selected, setSelected] = useState<string>('사건 정보');
25
32
  const router = useRouter();
@@ -33,8 +40,8 @@ const MyCaseDetailPageContainer = ({ jwt }: { jwt?: string }) => {
33
40
 
34
41
  const { data: detailList, isLoading: detailListLoading } = useActionGetDetailList(id as string, jwt);
35
42
  const { data: timeLine, isLoading: timeLineLoading } = useActionGetTimeLine(id as string, jwt);
36
- // const { data: courtFileList, isLoading: courtFileListLoading } = actionGetCourtFileList(id as string, jwt);
37
- // const { data: myFileList, isLoading: myFileListLoading } = actionGetMyFileList(id as string, jwt);
43
+ const { data: courtFileList, isLoading: courtFileListLoading } = useActionGetCourtFileList(id as string, jwt);
44
+ const { data: myFileList, isLoading: myFileListLoading } = useActionGetMyFileList(id as string, jwt);
38
45
  const {
39
46
  data: myCaseQuestion,
40
47
  isLoading: myCaseQuestionLoading,
@@ -71,11 +78,11 @@ const MyCaseDetailPageContainer = ({ jwt }: { jwt?: string }) => {
71
78
  isSelected={selected === '사건 타임라인'}
72
79
  onClick={() => setSelected('사건 타임라인')}
73
80
  />
74
- {/* <SubMenuButton
75
- title="문서함"
76
- isSelected={selected === '문서함'}
77
- onClick={() => setSelected('문서함')}
78
- /> */}
81
+ <SubMenuButton
82
+ title="문서함"
83
+ isSelected={selected === '문서함'}
84
+ onClick={() => setSelected('문서함')}
85
+ />
79
86
  <SubMenuButton
80
87
  title="계약정보"
81
88
  isSelected={selected === '계약정보'}
@@ -101,11 +108,11 @@ const MyCaseDetailPageContainer = ({ jwt }: { jwt?: string }) => {
101
108
  onClick={() => setSelected('사건 타임라인')}
102
109
  outerClassName=" swiper-slide"
103
110
  />
104
- {/* <SubMenuButton
105
- title="문서함"
106
- isSelected={selected === '문서함'}
107
- onClick={() => setSelected('문서함')}
108
- /> */}
111
+ <SubMenuButton
112
+ title="문서함"
113
+ isSelected={selected === '문서함'}
114
+ onClick={() => setSelected('문서함')}
115
+ />
109
116
  <SubMenuButton
110
117
  title="계약정보"
111
118
  isSelected={selected === '계약정보'}
@@ -130,12 +137,12 @@ const MyCaseDetailPageContainer = ({ jwt }: { jwt?: string }) => {
130
137
  isLoading={timeLineLoading}
131
138
  />
132
139
  )}
133
- {/* {selected === '문서함' && (
134
- <Document
135
- courtFileList={courtFileList?.data as FileList[]}
136
- myFileList={myFileList?.data as FileList[]}
137
- />
138
- )} */}
140
+ {selected === '문서함' && (
141
+ <Document
142
+ courtFileList={courtFileList?.data as FileList[]}
143
+ myFileList={myFileList?.data as FileList[]}
144
+ />
145
+ )}
139
146
  {selected === '계약정보' && <ContactInfo id={id as string} />}
140
147
  {selected === '사건문의' && (
141
148
  <CaseInquiry
@@ -19,10 +19,10 @@ const Document = ({ courtFileList, myFileList }) => {
19
19
  </p>
20
20
  </div>
21
21
  <div className="mt-[20px] flex flex-col lg:mt-[24px] ">
22
- {tap === 'my' && myFileList.length > 0
22
+ {tap === 'my' && (myFileList === null || myFileList === void 0 ? void 0 : myFileList.length) > 0
23
23
  ? myFileList.map((item, index) => <DocumentLine item={item} index={index} key={index}/>)
24
24
  : tap === 'my' && <EmptyTable tap="file" subTap={0}/>}
25
- {tap === 'court' && courtFileList.length > 0
25
+ {tap === 'court' && (courtFileList === null || courtFileList === void 0 ? void 0 : courtFileList.length) > 0
26
26
  ? courtFileList.map((item, index) => <DocumentLine item={item} index={index} key={index}/>)
27
27
  : tap === 'court' && <EmptyTable tap="file" subTap={0}/>}
28
28
  </div>
@@ -38,10 +38,10 @@ const Document = ({ courtFileList, myFileList }: { courtFileList: FileList[]; my
38
38
  </p>
39
39
  </div>
40
40
  <div className="mt-[20px] flex flex-col lg:mt-[24px] ">
41
- {tap === 'my' && myFileList.length > 0
41
+ {tap === 'my' && myFileList?.length > 0
42
42
  ? myFileList.map((item, index) => <DocumentLine item={item} index={index} key={index} />)
43
43
  : tap === 'my' && <EmptyTable tap="file" subTap={0} />}
44
- {tap === 'court' && courtFileList.length > 0
44
+ {tap === 'court' && courtFileList?.length > 0
45
45
  ? courtFileList.map((item, index) => <DocumentLine item={item} index={index} key={index} />)
46
46
  : tap === 'court' && <EmptyTable tap="file" subTap={0} />}
47
47
  </div>
@@ -6,7 +6,9 @@ export declare const buttonStyle: {
6
6
  소송진행: string;
7
7
  보류: string;
8
8
  사건종결: string;
9
- 환불: string;
9
+ 환불접수: string;
10
+ 환불진행중: string;
11
+ 환불완료: string;
10
12
  };
11
13
  declare const Badge: ({ title }: {
12
14
  title: keyof typeof buttonStyle;
@@ -6,10 +6,12 @@ export const buttonStyle = {
6
6
  소송진행: 'bg-[#C6F5CA] text-[#315B32]',
7
7
  보류: 'bg-[#FFF3DB] text-[#644F16]',
8
8
  사건종결: 'bg-[#3D3D3D] text-[#FFFFFF]',
9
- 환불: 'bg-[#DBDBDB] text-[#000000]'
9
+ 환불접수: 'bg-[#DBDBDB] text-[#000000]',
10
+ 환불진행중: 'bg-[#DBDBDB] text-[#000000]',
11
+ 환불완료: 'bg-[#DBDBDB] text-[#000000]'
10
12
  };
11
13
  const Badge = ({ title }) => {
12
- return (<div className={`sm-top:h-[39px] sm-top:px-[16px] sm-top:label_large2_tb flex h-[30px] flex-row items-center justify-center rounded-[20px] px-[12px] lg:h-[41px] lg:px-[20px] ${buttonStyle[title]} w-fit`}>
14
+ return (<div className={`sm-top:label_large2_tb flex h-[30px] flex-row items-center justify-center rounded-[20px] px-[12px] sm-top:h-[39px] sm-top:px-[16px] lg:h-[41px] lg:px-[20px] ${buttonStyle[title]} w-fit`}>
13
15
  <p className={`label_large2_mo sm-top:label_large2_tb lg:label_large2 `}>{title}</p>
14
16
  </div>);
15
17
  };
@@ -6,13 +6,15 @@ export const buttonStyle = {
6
6
  소송진행: 'bg-[#C6F5CA] text-[#315B32]',
7
7
  보류: 'bg-[#FFF3DB] text-[#644F16]',
8
8
  사건종결: 'bg-[#3D3D3D] text-[#FFFFFF]',
9
- 환불: 'bg-[#DBDBDB] text-[#000000]'
9
+ 환불접수: 'bg-[#DBDBDB] text-[#000000]',
10
+ 환불진행중: 'bg-[#DBDBDB] text-[#000000]',
11
+ 환불완료: 'bg-[#DBDBDB] text-[#000000]'
10
12
  };
11
13
 
12
14
  const Badge = ({ title }: { title: keyof typeof buttonStyle }) => {
13
15
  return (
14
16
  <div
15
- className={`sm-top:h-[39px] sm-top:px-[16px] sm-top:label_large2_tb flex h-[30px] flex-row items-center justify-center rounded-[20px] px-[12px] lg:h-[41px] lg:px-[20px] ${buttonStyle[title]} w-fit`}
17
+ className={`sm-top:label_large2_tb flex h-[30px] flex-row items-center justify-center rounded-[20px] px-[12px] sm-top:h-[39px] sm-top:px-[16px] lg:h-[41px] lg:px-[20px] ${buttonStyle[title]} w-fit`}
16
18
  >
17
19
  <p className={`label_large2_mo sm-top:label_large2_tb lg:label_large2 `}>{title}</p>
18
20
  </div>
@@ -2,15 +2,15 @@ import Image from 'next/image';
2
2
  import checkBoxGray from '../../../../../asset/images/myCase/icon/check_box_gray.webp';
3
3
  import checkBox from '../../../../../asset/images/myCase/icon/check_box.webp';
4
4
  const CheckCircle = ({ isRefund }) => {
5
- return isRefund ? (<Image src={checkBoxGray} alt="check" width={32} height={32} className="sm-top:h-[24px] sm-top:w-[24px] h-[16px] w-[16px] flex-shrink-0 lg:h-[32px] lg:w-[32px]"/>) : (<Image src={checkBox} alt="check" width={32} height={32} className="sm-top:h-[24px] sm-top:w-[24px] h-[16px] w-[16px] flex-shrink-0 lg:h-[32px] lg:w-[32px]"/>);
5
+ return isRefund ? (<Image src={checkBoxGray} alt="check" width={32} height={32} className="h-[16px] w-[16px] flex-shrink-0 sm-top:h-[24px] sm-top:w-[24px] lg:h-[32px] lg:w-[32px]"/>) : (<Image src={checkBox} alt="check" width={32} height={32} className="h-[16px] w-[16px] flex-shrink-0 sm-top:h-[24px] sm-top:w-[24px] lg:h-[32px] lg:w-[32px]"/>);
6
6
  };
7
7
  const ProcessCircle = ({ isRefund }) => {
8
8
  return (<div className={`flex h-[16px] w-[16px] flex-shrink-0 items-center justify-center rounded-full border border-solid ${isRefund ? 'border-grayScale4' : 'border-subColor01'} sm-top:h-[24px] sm-top:w-[24px] lg:h-[32px] lg:w-[32px]`}>
9
- <div className={`sm-top:h-[12px] sm-top:w-[12px] h-[8px] w-[8px] rounded-full lg:h-[16px] lg:w-[16px] ${isRefund ? 'bg-grayScale4' : 'bg-subColor01'}`}></div>
9
+ <div className={`h-[8px] w-[8px] rounded-full sm-top:h-[12px] sm-top:w-[12px] lg:h-[16px] lg:w-[16px] ${isRefund ? 'bg-grayScale4' : 'bg-subColor01'}`}></div>
10
10
  </div>);
11
11
  };
12
12
  const WaitCircle = () => {
13
- return (<div className="border-grayScale4 sm-top:h-[20px] sm-top:w-[20px] h-[12px] w-[12px] flex-shrink-0 rounded-full border border-solid lg:h-[24px] lg:w-[24px]"></div>);
13
+ return (<div className="h-[12px] w-[12px] flex-shrink-0 rounded-full border border-solid border-grayScale4 sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px]"></div>);
14
14
  };
15
15
  const Line = ({ isRedLine, isRefund }) => {
16
16
  return (<div className={`h-[1px] w-full ${isRefund ? 'bg-grayScale4' : isRedLine ? 'bg-subColor01' : 'bg-[#B9B9B9]'}`}></div>);
@@ -18,46 +18,41 @@ const Line = ({ isRedLine, isRefund }) => {
18
18
  const CaseLine = ({ title, isRefund }) => {
19
19
  const number = (() => {
20
20
  switch (title) {
21
- case '사건접수':
22
- return 1;
23
21
  case '사건검토':
22
+ return 1;
23
+ case '사건접수':
24
24
  return 2;
25
- case '소송준비':
26
- return 3;
27
- case '소송준비':
28
- return 3;
29
25
  case '소송진행':
30
- return 4;
31
- case '환불':
26
+ return 3;
27
+ case '환불접수':
32
28
  return -1;
33
- case '사건종결':
29
+ case '환불진행중':
34
30
  return -2;
31
+ case '환불완료':
32
+ return -3;
33
+ case '사건종결':
34
+ return -4;
35
35
  default:
36
36
  return 0;
37
37
  }
38
38
  })();
39
- return (number >= -1 && (<div className="mt-[16px] lg:mt-[24px]">
40
- <div className="sm-top:mx-[22px] mx-[16px] flex flex-row items-center lg:mx-[25px] ">
39
+ return (number >= -1 && (<div className="mt-[16px] sm-top:mt-[24px] lg:mt-[32px]">
40
+ <div className="mx-[16px] flex flex-row items-center sm-top:mx-[22px] lg:mx-[25px] ">
41
41
  {number === 1 ? <ProcessCircle isRefund={isRefund}/> : <CheckCircle isRefund={isRefund}/>}
42
42
  <Line isRedLine={number > 1} isRefund={isRefund}/>
43
43
 
44
44
  {number === 2 ? (<ProcessCircle isRefund={isRefund}/>) : number < 2 ? (<WaitCircle />) : (<CheckCircle isRefund={isRefund}/>)}
45
45
  <Line isRedLine={number > 2} isRefund={isRefund}/>
46
46
  {number === 3 ? (<ProcessCircle isRefund={isRefund}/>) : number < 3 ? (<WaitCircle />) : (<CheckCircle isRefund={isRefund}/>)}
47
- <Line isRedLine={number > 3} isRefund={isRefund}/>
48
- {number === 4 ? (<ProcessCircle isRefund={isRefund}/>) : number < 4 ? (<WaitCircle />) : (<CheckCircle isRefund={isRefund}/>)}
49
47
  </div>
50
48
  <div className="mt-[4px] flex flex-row justify-between">
51
49
  <p className={`body_small2_mo sm-top:body_medium2_tb lg:body_medium2 ${isRefund ? 'text-grayScale4' : number >= 1 ? 'text-subColor01' : 'text-[#B9B9B9]'}`}>
52
- 사건접수
50
+ 사건검토
53
51
  </p>
54
52
  <p className={`body_small2_mo sm-top:body_medium2_tb lg:body_medium2 ${number >= 2 ? 'text-subColor01' : 'text-[#B9B9B9]'}`}>
55
- 사건검토
53
+ 사건접수
56
54
  </p>
57
55
  <p className={`body_small2_mo sm-top:body_medium2_tb lg:body_medium2 ${number >= 3 ? 'text-subColor01' : 'text-[#B9B9B9]'}`}>
58
- 소송준비
59
- </p>
60
- <p className={`body_small2_mo sm-top:body_medium2_tb lg:body_medium2 ${number >= 4 ? 'text-subColor01' : 'text-[#B9B9B9]'}`}>
61
56
  소송진행
62
57
  </p>
63
58
  </div>
@@ -9,7 +9,7 @@ const CheckCircle = ({ isRefund }: { isRefund: boolean }) => {
9
9
  alt="check"
10
10
  width={32}
11
11
  height={32}
12
- className="sm-top:h-[24px] sm-top:w-[24px] h-[16px] w-[16px] flex-shrink-0 lg:h-[32px] lg:w-[32px]"
12
+ className="h-[16px] w-[16px] flex-shrink-0 sm-top:h-[24px] sm-top:w-[24px] lg:h-[32px] lg:w-[32px]"
13
13
  />
14
14
  ) : (
15
15
  <Image
@@ -17,7 +17,7 @@ const CheckCircle = ({ isRefund }: { isRefund: boolean }) => {
17
17
  alt="check"
18
18
  width={32}
19
19
  height={32}
20
- className="sm-top:h-[24px] sm-top:w-[24px] h-[16px] w-[16px] flex-shrink-0 lg:h-[32px] lg:w-[32px]"
20
+ className="h-[16px] w-[16px] flex-shrink-0 sm-top:h-[24px] sm-top:w-[24px] lg:h-[32px] lg:w-[32px]"
21
21
  />
22
22
  );
23
23
  };
@@ -29,7 +29,7 @@ const ProcessCircle = ({ isRefund }: { isRefund: boolean }) => {
29
29
  } sm-top:h-[24px] sm-top:w-[24px] lg:h-[32px] lg:w-[32px]`}
30
30
  >
31
31
  <div
32
- className={`sm-top:h-[12px] sm-top:w-[12px] h-[8px] w-[8px] rounded-full lg:h-[16px] lg:w-[16px] ${
32
+ className={`h-[8px] w-[8px] rounded-full sm-top:h-[12px] sm-top:w-[12px] lg:h-[16px] lg:w-[16px] ${
33
33
  isRefund ? 'bg-grayScale4' : 'bg-subColor01'
34
34
  }`}
35
35
  ></div>
@@ -38,7 +38,7 @@ const ProcessCircle = ({ isRefund }: { isRefund: boolean }) => {
38
38
  };
39
39
  const WaitCircle = () => {
40
40
  return (
41
- <div className="border-grayScale4 sm-top:h-[20px] sm-top:w-[20px] h-[12px] w-[12px] flex-shrink-0 rounded-full border border-solid lg:h-[24px] lg:w-[24px]"></div>
41
+ <div className="h-[12px] w-[12px] flex-shrink-0 rounded-full border border-solid border-grayScale4 sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px]"></div>
42
42
  );
43
43
  };
44
44
  const Line = ({ isRedLine, isRefund }: { isRedLine: boolean; isRefund: boolean }) => {
@@ -52,28 +52,31 @@ const Line = ({ isRedLine, isRefund }: { isRedLine: boolean; isRefund: boolean }
52
52
  const CaseLine = ({ title, isRefund }: { title: string; isRefund: boolean }) => {
53
53
  const number = (() => {
54
54
  switch (title) {
55
- case '사건접수':
56
- return 1;
57
55
  case '사건검토':
56
+ return 1;
57
+ case '사건접수':
58
58
  return 2;
59
- case '소송준비':
60
- return 3;
61
- case '소송준비':
62
- return 3;
59
+
63
60
  case '소송진행':
64
- return 4;
65
- case '환불':
61
+ return 3;
62
+
63
+ case '환불접수':
66
64
  return -1;
67
- case '사건종결':
65
+ case '환불진행중':
68
66
  return -2;
67
+ case '환불완료':
68
+ return -3;
69
+
70
+ case '사건종결':
71
+ return -4;
69
72
  default:
70
73
  return 0;
71
74
  }
72
75
  })();
73
76
  return (
74
77
  number >= -1 && (
75
- <div className="mt-[16px] lg:mt-[24px]">
76
- <div className="sm-top:mx-[22px] mx-[16px] flex flex-row items-center lg:mx-[25px] ">
78
+ <div className="mt-[16px] sm-top:mt-[24px] lg:mt-[32px]">
79
+ <div className="mx-[16px] flex flex-row items-center sm-top:mx-[22px] lg:mx-[25px] ">
77
80
  {number === 1 ? <ProcessCircle isRefund={isRefund} /> : <CheckCircle isRefund={isRefund} />}
78
81
  <Line isRedLine={number > 1} isRefund={isRefund} />
79
82
 
@@ -92,14 +95,6 @@ const CaseLine = ({ title, isRefund }: { title: string; isRefund: boolean }) =>
92
95
  ) : (
93
96
  <CheckCircle isRefund={isRefund} />
94
97
  )}
95
- <Line isRedLine={number > 3} isRefund={isRefund} />
96
- {number === 4 ? (
97
- <ProcessCircle isRefund={isRefund} />
98
- ) : number < 4 ? (
99
- <WaitCircle />
100
- ) : (
101
- <CheckCircle isRefund={isRefund} />
102
- )}
103
98
  </div>
104
99
  <div className="mt-[4px] flex flex-row justify-between">
105
100
  <p
@@ -107,26 +102,19 @@ const CaseLine = ({ title, isRefund }: { title: string; isRefund: boolean }) =>
107
102
  isRefund ? 'text-grayScale4' : number >= 1 ? 'text-subColor01' : 'text-[#B9B9B9]'
108
103
  }`}
109
104
  >
110
- 사건접수
105
+ 사건검토
111
106
  </p>
112
107
  <p
113
108
  className={`body_small2_mo sm-top:body_medium2_tb lg:body_medium2 ${
114
109
  number >= 2 ? 'text-subColor01' : 'text-[#B9B9B9]'
115
110
  }`}
116
111
  >
117
- 사건검토
112
+ 사건접수
118
113
  </p>
119
114
  <p
120
115
  className={`body_small2_mo sm-top:body_medium2_tb lg:body_medium2 ${
121
116
  number >= 3 ? 'text-subColor01' : 'text-[#B9B9B9]'
122
117
  }`}
123
- >
124
- 소송준비
125
- </p>
126
- <p
127
- className={`body_small2_mo sm-top:body_medium2_tb lg:body_medium2 ${
128
- number >= 4 ? 'text-subColor01' : 'text-[#B9B9B9]'
129
- }`}
130
118
  >
131
119
  소송진행
132
120
  </p>
@@ -9,7 +9,7 @@ const CaseTableMoBox = ({ item }) => {
9
9
  return (<Link href={`/mycase/${item.idx}`} className={`h-fit w-full cursor-pointer rounded-[12px] border-[1px] border-solid border-grayScale5 p-[20px] sm-top:px-[32px] sm-top:py-[36px] lg:px-[48px] lg:py-[40px] ${isRefund ? 'bg-grayScale7' : ''}`}>
10
10
  <div className="flex flex-row items-center justify-between">
11
11
  <div className="flex flex-row items-center gap-[8px] sm-top:gap-[10px]">
12
- <Badge title={isRefund ? '환불' : item === null || item === void 0 ? void 0 : item.state}/>
12
+ <Badge title={isRefund ? '환불완료' : item === null || item === void 0 ? void 0 : item.state}/>
13
13
  {item.is_deferred && <Badge title="보류"/>}
14
14
  </div>
15
15
 
@@ -33,7 +33,10 @@ const CaseTableMoBox = ({ item }) => {
33
33
  <p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1">{item === null || item === void 0 ? void 0 : item.title}</p>
34
34
  </div>
35
35
 
36
- <CaseLine title={item === null || item === void 0 ? void 0 : item.state} isRefund={isRefund}/>
36
+ {(item === null || item === void 0 ? void 0 : item.state) !== '사건종결' &&
37
+ (item === null || item === void 0 ? void 0 : item.state) !== '환불접수' &&
38
+ (item === null || item === void 0 ? void 0 : item.state) !== '환불진행중' &&
39
+ (item === null || item === void 0 ? void 0 : item.state) !== '환불완료' && <CaseLine title={item === null || item === void 0 ? void 0 : item.state} isRefund={isRefund}/>}
37
40
  </Link>);
38
41
  };
39
42
  export default CaseTableMoBox;
@@ -17,7 +17,7 @@ const CaseTableMoBox = ({ item }: { item: Case }) => {
17
17
  >
18
18
  <div className="flex flex-row items-center justify-between">
19
19
  <div className="flex flex-row items-center gap-[8px] sm-top:gap-[10px]">
20
- <Badge title={isRefund ? '환불' : item?.state} />
20
+ <Badge title={isRefund ? '환불완료' : item?.state} />
21
21
  {item.is_deferred && <Badge title="보류" />}
22
22
  </div>
23
23
 
@@ -47,7 +47,10 @@ const CaseTableMoBox = ({ item }: { item: Case }) => {
47
47
  <p className="body_medium1_mo sm-top:body_medium1_tb lg:body_medium1">{item?.title}</p>
48
48
  </div>
49
49
 
50
- <CaseLine title={item?.state} isRefund={isRefund} />
50
+ {item?.state !== '사건종결' &&
51
+ item?.state !== '환불접수' &&
52
+ item?.state !== '환불진행중' &&
53
+ item?.state !== '환불완료' && <CaseLine title={item?.state} isRefund={isRefund} />}
51
54
  </Link>
52
55
  );
53
56
  };
@@ -0,0 +1,25 @@
1
+ export declare const isShareSupported: () => (data?: ShareData) => Promise<void>;
2
+ /**
3
+ * 인자로 받은 data를 OS 기본옵션으로 공유합니다.
4
+ * 기본 공유옵션이 지원되지 않을 경우, url만을 클립보드에 링크를 복사하는 기능으로 대체됩니다.
5
+ *
6
+ * @param data 공유할 data 객체
7
+ * @param data.url 공유될 또는 클립복드에 복사될 url
8
+ * @param data.text 공유시 해당 메신저에 추가적인 텍스트로 전달되는 문구
9
+ * @param data.title 공유시 썸네일에 제공되는 타이틀 문구
10
+ * @param data.files 공유할 file 리스트
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const result = await share('data');
15
+ * if (result === 'share') {
16
+ * console.log('공유 성공');
17
+ * } else if (result === 'clipboard') {
18
+ * console.log('클립보드 복사 성공');
19
+ * } else {
20
+ * console.log('공유 실패');
21
+ * }
22
+ * ```
23
+ */
24
+ export declare const share: (data: ShareData) => Promise<"shared" | "copiedToClipboard" | "failed">;
25
+ export default share;
@@ -0,0 +1,67 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import mobile from 'is-mobile';
11
+ //http 환경에서 동작안함 : 무조건 false
12
+ export const isShareSupported = () => { var _a; return (_a = navigator.share) !== null && _a !== void 0 ? _a : false; };
13
+ /**
14
+ * 인자로 받은 data를 OS 기본옵션으로 공유합니다.
15
+ * 기본 공유옵션이 지원되지 않을 경우, url만을 클립보드에 링크를 복사하는 기능으로 대체됩니다.
16
+ *
17
+ * @param data 공유할 data 객체
18
+ * @param data.url 공유될 또는 클립복드에 복사될 url
19
+ * @param data.text 공유시 해당 메신저에 추가적인 텍스트로 전달되는 문구
20
+ * @param data.title 공유시 썸네일에 제공되는 타이틀 문구
21
+ * @param data.files 공유할 file 리스트
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const result = await share('data');
26
+ * if (result === 'share') {
27
+ * console.log('공유 성공');
28
+ * } else if (result === 'clipboard') {
29
+ * console.log('클립보드 복사 성공');
30
+ * } else {
31
+ * console.log('공유 실패');
32
+ * }
33
+ * ```
34
+ */
35
+ export const share = (data) => {
36
+ return new Promise((resolve) => __awaiter(void 0, void 0, void 0, function* () {
37
+ const activeElement = document.activeElement;
38
+ const is_mobile = mobile();
39
+ try {
40
+ if (is_mobile && isShareSupported()) {
41
+ // pc: 링크복사, mobile: 공유하기 창
42
+ yield navigator.share(data);
43
+ resolve('shared');
44
+ return 'shared';
45
+ }
46
+ else {
47
+ if (data.url) {
48
+ navigator.clipboard
49
+ .writeText(window.location.href)
50
+ .then(() => {
51
+ alert('현재 주소가 복사되었습니다');
52
+ })
53
+ .catch(() => {
54
+ alert('오류가 발생했습니다. 다시 시도해주세요.');
55
+ });
56
+ }
57
+ }
58
+ }
59
+ catch (e) {
60
+ if (e.toString().includes('AbortError')) {
61
+ resolve('failed');
62
+ return 'failed';
63
+ }
64
+ }
65
+ }));
66
+ };
67
+ export default share;
@@ -0,0 +1,61 @@
1
+ import mobile from 'is-mobile';
2
+ import { TFunction } from 'i18next';
3
+
4
+ //http 환경에서 동작안함 : 무조건 false
5
+ export const isShareSupported = () => navigator.share ?? false;
6
+
7
+ /**
8
+ * 인자로 받은 data를 OS 기본옵션으로 공유합니다.
9
+ * 기본 공유옵션이 지원되지 않을 경우, url만을 클립보드에 링크를 복사하는 기능으로 대체됩니다.
10
+ *
11
+ * @param data 공유할 data 객체
12
+ * @param data.url 공유될 또는 클립복드에 복사될 url
13
+ * @param data.text 공유시 해당 메신저에 추가적인 텍스트로 전달되는 문구
14
+ * @param data.title 공유시 썸네일에 제공되는 타이틀 문구
15
+ * @param data.files 공유할 file 리스트
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * const result = await share('data');
20
+ * if (result === 'share') {
21
+ * console.log('공유 성공');
22
+ * } else if (result === 'clipboard') {
23
+ * console.log('클립보드 복사 성공');
24
+ * } else {
25
+ * console.log('공유 실패');
26
+ * }
27
+ * ```
28
+ */
29
+
30
+ export const share = (data: ShareData) => {
31
+ return new Promise<'shared' | 'copiedToClipboard' | 'failed'>(async resolve => {
32
+ const activeElement = document.activeElement as HTMLElement;
33
+ const is_mobile = mobile();
34
+ try {
35
+ if (is_mobile && isShareSupported()) {
36
+ // pc: 링크복사, mobile: 공유하기 창
37
+ await navigator.share(data);
38
+ resolve('shared');
39
+ return 'shared';
40
+ } else {
41
+ if (data.url) {
42
+ navigator.clipboard
43
+ .writeText(window.location.href)
44
+ .then(() => {
45
+ alert('현재 주소가 복사되었습니다');
46
+ })
47
+ .catch(() => {
48
+ alert('오류가 발생했습니다. 다시 시도해주세요.');
49
+ });
50
+ }
51
+ }
52
+ } catch (e: any) {
53
+ if (e.toString().includes('AbortError')) {
54
+ resolve('failed');
55
+ return 'failed';
56
+ }
57
+ }
58
+ });
59
+ };
60
+
61
+ export default share;