@daeryun/dr_components 0.4.49 → 0.4.51
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.
- package/dist/asset/images/myCase/icon/check box_3.webp +0 -0
- package/dist/asset/images/myCase/icon/file.webp +0 -0
- package/dist/asset/images/myCase/icon/jpeg.webp +0 -0
- package/dist/asset/images/myCase/icon/upload.webp +0 -0
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/components/common/integrate/index.d.ts +1 -1
- package/dist/components/page/Integrate/Broadcast.jsx +2 -5
- package/dist/components/page/Integrate/Broadcast.tsx +0 -6
- package/dist/components/page/Integrate/Field.jsx +2 -6
- package/dist/components/page/Integrate/Field.tsx +0 -7
- package/dist/components/page/Integrate/LawInfo.jsx +2 -5
- package/dist/components/page/Integrate/LawInfo.tsx +0 -7
- package/dist/components/page/Integrate/Lawyer.jsx +5 -8
- package/dist/components/page/Integrate/Lawyer.tsx +1 -11
- package/dist/components/page/Integrate/Map.jsx +2 -5
- package/dist/components/page/Integrate/Map.tsx +0 -7
- package/dist/components/page/Integrate/Reply.jsx +2 -6
- package/dist/components/page/Integrate/Reply.tsx +0 -8
- package/dist/components/page/Integrate/Success.jsx +2 -6
- package/dist/components/page/Integrate/Success.tsx +0 -8
- package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.jsx +1 -1
- package/dist/components/page/MyCase/[id]/_component/MyCaseDetailPageContainer.tsx +2 -0
- package/dist/components/page/MyCase/[id]/_component/_document/Document.d.ts +3 -1
- package/dist/components/page/MyCase/[id]/_component/_document/Document.jsx +3 -1
- package/dist/components/page/MyCase/[id]/_component/_document/Document.tsx +13 -1
- package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.jsx +36 -5
- package/dist/components/page/MyCase/[id]/_component/_document/DocumentLine.tsx +39 -6
- package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.d.ts +5 -0
- package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.jsx +32 -0
- package/dist/components/page/MyCase/[id]/_component/_document/FileDropZone.tsx +65 -0
- package/dist/components/page/MyCase/[id]/_component/_document/FileUpload.d.ts +10 -0
- package/dist/components/page/MyCase/[id]/_component/_document/FileUpload.js +43 -0
- package/dist/components/page/MyCase/[id]/_component/_document/FileUpload.ts +38 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.d.ts +5 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.jsx +22 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileSuccessModal.tsx +50 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileUploadModal.d.ts +7 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileUploadModal.jsx +71 -0
- package/dist/components/page/MyCase/[id]/_component/_modal/FileUploadModal.tsx +117 -0
- package/dist/components/page/MyCase/_actions/action.d.ts +5 -3
- package/dist/components/page/MyCase/_actions/action.js +23 -2
- package/dist/components/page/MyCase/_actions/action.ts +25 -6
- package/dist/components/page/MyCase/_component/CaseContainer.jsx +1 -3
- package/dist/components/page/MyCase/_component/CaseContainer.tsx +4 -9
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.jsx +2 -2
- package/dist/components/page/MyCase/_component/_breadCrumble/CategoryMenu.tsx +12 -2
- package/dist/components/page/MyCase/_fetchers/addMyFileUpload.d.ts +5 -0
- package/dist/components/page/MyCase/_fetchers/addMyFileUpload.js +34 -0
- package/dist/components/page/MyCase/_fetchers/addMyFileUpload.ts +27 -0
- package/dist/styles/globals.css +276 -177
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import React, {
|
|
10
|
+
import React, { useState } from 'react';
|
|
11
11
|
import Image from 'next/image';
|
|
12
12
|
import { NoResult } from './NoResult';
|
|
13
13
|
import { Title } from './Title';
|
|
@@ -18,7 +18,6 @@ const Map = (props) => {
|
|
|
18
18
|
const router = useRouter();
|
|
19
19
|
const { tab, onMoreViewText, list, pages } = props;
|
|
20
20
|
const [loading, setLoading] = useState(false);
|
|
21
|
-
const firstAddRef = useRef(null);
|
|
22
21
|
return props.tab === '전체' || props.tab === 'map' ? (
|
|
23
22
|
//구성원 탭에서는 결과 없음
|
|
24
23
|
tab === 'map' && props.listCount.map < 1 ? (<NoResult />) : (<>
|
|
@@ -67,9 +66,7 @@ const Map = (props) => {
|
|
|
67
66
|
//640px
|
|
68
67
|
'max-sm:relative max-sm:mx-auto max-sm:mt-[30px] max-sm:w-[85%] max-sm:translate-y-0'} onClick={() => {
|
|
69
68
|
void router.push('/map/' + item.key);
|
|
70
|
-
}} aria-label={item.title + ' 자세히 보기'}
|
|
71
|
-
? firstAddRef
|
|
72
|
-
: null}>
|
|
69
|
+
}} aria-label={item.title + ' 자세히 보기'}>
|
|
73
70
|
<span className={'text-[18px] font-[600] leading-none tracking-[-1px] ' +
|
|
74
71
|
//1024px
|
|
75
72
|
'max-lg:text-[16px] '}>
|
|
@@ -30,8 +30,6 @@ const Map = (props: {
|
|
|
30
30
|
|
|
31
31
|
const [loading, setLoading] = useState<boolean>(false);
|
|
32
32
|
|
|
33
|
-
const firstAddRef = useRef<HTMLButtonElement>(null);
|
|
34
|
-
|
|
35
33
|
return props.tab === '전체' || props.tab === 'map' ? (
|
|
36
34
|
//구성원 탭에서는 결과 없음
|
|
37
35
|
tab === 'map' && props.listCount.map < 1 ? (
|
|
@@ -114,11 +112,6 @@ const Map = (props: {
|
|
|
114
112
|
void router.push('/map/' + item.key);
|
|
115
113
|
}}
|
|
116
114
|
aria-label={item.title + ' 자세히 보기'}
|
|
117
|
-
ref={
|
|
118
|
-
index === 0 || (index > 12 && index === list.mapList.length - 12)
|
|
119
|
-
? firstAddRef
|
|
120
|
-
: null
|
|
121
|
-
}
|
|
122
115
|
>
|
|
123
116
|
<span
|
|
124
117
|
className={
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import Link from 'next/link';
|
|
3
3
|
import { NoResult } from './NoResult';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
@@ -8,7 +8,6 @@ import { searchColorText } from '../../common/integrate';
|
|
|
8
8
|
const Reply = (props) => {
|
|
9
9
|
const { tab, onMoreViewText, list, pages, onMoreView, search, listCount } = props;
|
|
10
10
|
const [loading, setLoading] = useState(false);
|
|
11
|
-
const firstAddRef = useRef(null);
|
|
12
11
|
return (<>
|
|
13
12
|
{tab === '전체' || tab === 'reply' ? (tab === 'reply' && listCount.reply < 1 ? (<NoResult />) : (<>
|
|
14
13
|
{listCount.reply > 0 ? (<div className={'mb-[180px] max-sm:mb-[100px] max-xs:mb-[50px]'}>
|
|
@@ -21,10 +20,7 @@ const Reply = (props) => {
|
|
|
21
20
|
? 'https://www.daeryunlaw.com'
|
|
22
21
|
: '') +
|
|
23
22
|
'/reply/' +
|
|
24
|
-
item.id} target={item.crime_code === props.crime_code ? '' : '_blank'}
|
|
25
|
-
(index > 12 && index === list.replyList.length - 12)
|
|
26
|
-
? firstAddRef
|
|
27
|
-
: null}>
|
|
23
|
+
item.id} target={item.crime_code === props.crime_code ? '' : '_blank'}>
|
|
28
24
|
<div className={'flex flex-col'}>
|
|
29
25
|
<p className={'h-[70px] text-[20px] font-[800] max-xs:h-[60px] max-xs:text-[18px] sm:text-[22px]'}>
|
|
30
26
|
<span className={'text-[#285FA7]'}>{item.etc4} </span>
|
|
@@ -31,8 +31,6 @@ const Reply = (props: {
|
|
|
31
31
|
|
|
32
32
|
const [loading, setLoading] = useState<boolean>(false);
|
|
33
33
|
|
|
34
|
-
const firstAddRef = useRef<HTMLAnchorElement>(null);
|
|
35
|
-
|
|
36
34
|
return (
|
|
37
35
|
<>
|
|
38
36
|
{tab === '전체' || tab === 'reply' ? (
|
|
@@ -69,12 +67,6 @@ const Reply = (props: {
|
|
|
69
67
|
item.id
|
|
70
68
|
}
|
|
71
69
|
target={item.crime_code === props.crime_code ? '' : '_blank'}
|
|
72
|
-
ref={
|
|
73
|
-
index === 0 ||
|
|
74
|
-
(index > 12 && index === list.replyList.length - 12)
|
|
75
|
-
? firstAddRef
|
|
76
|
-
: null
|
|
77
|
-
}
|
|
78
70
|
>
|
|
79
71
|
<div className={'flex flex-col'}>
|
|
80
72
|
<p
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import Link from 'next/link';
|
|
3
3
|
import { NoResult } from './NoResult';
|
|
4
4
|
import { Title } from './Title';
|
|
@@ -8,7 +8,6 @@ const Success = (props) => {
|
|
|
8
8
|
var _a;
|
|
9
9
|
const { tab, onMoreViewText, list, pages, onMoreView, search, listCount } = props;
|
|
10
10
|
const [loading, setLoading] = useState(false);
|
|
11
|
-
const firstAddRef = useRef(null);
|
|
12
11
|
return (<>
|
|
13
12
|
{tab === '전체' || tab === 'success' ? (tab === 'success' && listCount.success < 1 ? (<NoResult />) : (<>
|
|
14
13
|
{listCount.success > 0 ? (<div className={'mb-[180px] max-sm:mb-[100px] max-xs:mb-[50px]'}>
|
|
@@ -19,10 +18,7 @@ const Success = (props) => {
|
|
|
19
18
|
var _a, _b;
|
|
20
19
|
return (<Link href={!item.center_code.includes('OF')
|
|
21
20
|
? item.pathname + 'success_new/' + item.id
|
|
22
|
-
: `https://${item.office_pathname}/success_new/${item.id}`} target={item.center_code === props.center_code ? '' : '_blank'} className={' overflow-hidden border-[2px] border-solid border-[#ebebebcc]'} key={item.id + item.center_code}
|
|
23
|
-
(index > 12 && index === list.successList.length - 12)
|
|
24
|
-
? firstAddRef
|
|
25
|
-
: null}>
|
|
21
|
+
: `https://${item.office_pathname}/success_new/${item.id}`} target={item.center_code === props.center_code ? '' : '_blank'} className={' overflow-hidden border-[2px] border-solid border-[#ebebebcc]'} key={item.id + item.center_code}>
|
|
26
22
|
<p className={`ml-8 inline-block w-auto max-w-[70%] bg-[#2960A7] p-2 px-7 text-center text-[18px] font-[800] text-[#fff] max-lg:text-[16px] max-sm:text-[15px] max-2xs:text-[14px]`}>
|
|
27
23
|
<span className={'line-clamp-1'}>{item.sub}</span>
|
|
28
24
|
</p>
|
|
@@ -30,8 +30,6 @@ const Success = (props: {
|
|
|
30
30
|
|
|
31
31
|
const [loading, setLoading] = useState<boolean>(false);
|
|
32
32
|
|
|
33
|
-
const firstAddRef = useRef<HTMLAnchorElement>(null);
|
|
34
|
-
|
|
35
33
|
return (
|
|
36
34
|
<>
|
|
37
35
|
{tab === '전체' || tab === 'success' ? (
|
|
@@ -65,12 +63,6 @@ const Success = (props: {
|
|
|
65
63
|
' overflow-hidden border-[2px] border-solid border-[#ebebebcc]'
|
|
66
64
|
}
|
|
67
65
|
key={item.id + item.center_code}
|
|
68
|
-
ref={
|
|
69
|
-
index === 0 ||
|
|
70
|
-
(index > 12 && index === list.successList.length - 12)
|
|
71
|
-
? firstAddRef
|
|
72
|
-
: null
|
|
73
|
-
}
|
|
74
66
|
>
|
|
75
67
|
<p
|
|
76
68
|
className={`ml-8 inline-block w-auto max-w-[70%] bg-[#2960A7] p-2 px-7 text-center text-[18px] font-[800] text-[#fff] max-lg:text-[16px] max-sm:text-[15px] max-2xs:text-[14px]`}
|
|
@@ -60,7 +60,7 @@ const MyCaseDetailPageContainer = ({ jwt }) => {
|
|
|
60
60
|
</div>
|
|
61
61
|
{selected === '사건 정보' && (<DetailInfo detailList={detailList === null || detailList === void 0 ? void 0 : detailList.data} isLoading={detailListLoading}/>)}
|
|
62
62
|
{selected === '사건 타임라인' && (<TimeLine timeLine={timeLine === null || timeLine === void 0 ? void 0 : timeLine.list} isLoading={timeLineLoading}/>)}
|
|
63
|
-
{selected === '문서함' && (<Document courtFileList={courtFileList === null || courtFileList === void 0 ? void 0 : courtFileList.data} myFileList={myFileList === null || myFileList === void 0 ? void 0 : myFileList.data}/>)}
|
|
63
|
+
{selected === '문서함' && (<Document courtFileList={courtFileList === null || courtFileList === void 0 ? void 0 : courtFileList.data} myFileList={myFileList === null || myFileList === void 0 ? void 0 : myFileList.data} id={id} refetch={myCaseQuestionRefetch}/>)}
|
|
64
64
|
{selected === '계약정보' && <ContactInfo id={id}/>}
|
|
65
65
|
{selected === '사건문의' && (<CaseInquiry myCaseQuestion={myCaseQuestion === null || myCaseQuestion === void 0 ? void 0 : myCaseQuestion.list} isLoading={myCaseQuestionLoading} id={id} refetch={myCaseQuestionRefetch} pageSize={pageSize} totalLength={(_a = myCaseQuestion === null || myCaseQuestion === void 0 ? void 0 : myCaseQuestion.totalLength) !== null && _a !== void 0 ? _a : 0} pageNumber={pageNumber} onChange={handleOnChange}/>)}
|
|
66
66
|
</HeaderLayout>
|
|
@@ -141,6 +141,8 @@ const MyCaseDetailPageContainer = ({ jwt }: { jwt?: string }) => {
|
|
|
141
141
|
<Document
|
|
142
142
|
courtFileList={courtFileList?.data as FileList[]}
|
|
143
143
|
myFileList={myFileList?.data as FileList[]}
|
|
144
|
+
id={id as string}
|
|
145
|
+
refetch={myCaseQuestionRefetch}
|
|
144
146
|
/>
|
|
145
147
|
)}
|
|
146
148
|
{selected === '계약정보' && <ContactInfo id={id as string} />}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FileList } from '../../../_type/type';
|
|
2
|
-
declare const Document: ({ courtFileList, myFileList }: {
|
|
2
|
+
declare const Document: ({ courtFileList, myFileList, id, refetch }: {
|
|
3
3
|
courtFileList: FileList[];
|
|
4
4
|
myFileList: FileList[];
|
|
5
|
+
id: string;
|
|
6
|
+
refetch: () => void;
|
|
5
7
|
}) => import("react").JSX.Element;
|
|
6
8
|
export default Document;
|
|
@@ -2,7 +2,8 @@ import { useState } from 'react';
|
|
|
2
2
|
import CaseLayout from '../../../_component/_layout/CaseLayout';
|
|
3
3
|
import DocumentLine from './DocumentLine';
|
|
4
4
|
import EmptyTable from '../../../_component/_empty/EmptyTable';
|
|
5
|
-
|
|
5
|
+
import FileDropZone from './FileDropZone';
|
|
6
|
+
const Document = ({ courtFileList, myFileList, id, refetch }) => {
|
|
6
7
|
const [tap, setTap] = useState('my');
|
|
7
8
|
return (<CaseLayout isMobilePadding={false} outerClassName="mt-[35px] sm-top:mt-[24px] lg:mt-[40px] " innerClassName={'pt-[32px] px-[20px] 2sm:px-[40px] sm-top:pt-[56px] sm-top:px-[50px] sm-top:pb-[60px] lg:pt-[60px] lg:pb-[80px] lg:px-[60px]'}>
|
|
8
9
|
<div className="flex h-[48px] w-full overflow-hidden rounded-[12px] bg-grayScale4 sm-top:h-[60px]">
|
|
@@ -26,6 +27,7 @@ const Document = ({ courtFileList, myFileList }) => {
|
|
|
26
27
|
? courtFileList.map((item, index) => <DocumentLine item={item} index={index} key={index}/>)
|
|
27
28
|
: tap === 'court' && <EmptyTable tap="file" subTap={0}/>}
|
|
28
29
|
</div>
|
|
30
|
+
{tap === 'my' && <FileDropZone id={id} refetch={refetch}/>}
|
|
29
31
|
</CaseLayout>);
|
|
30
32
|
};
|
|
31
33
|
export default Document;
|
|
@@ -6,8 +6,19 @@ import Image from 'next/image';
|
|
|
6
6
|
import dayjs from 'dayjs';
|
|
7
7
|
import DocumentLine from './DocumentLine';
|
|
8
8
|
import EmptyTable from '../../../_component/_empty/EmptyTable';
|
|
9
|
+
import FileDropZone from './FileDropZone';
|
|
9
10
|
|
|
10
|
-
const Document = ({
|
|
11
|
+
const Document = ({
|
|
12
|
+
courtFileList,
|
|
13
|
+
myFileList,
|
|
14
|
+
id,
|
|
15
|
+
refetch
|
|
16
|
+
}: {
|
|
17
|
+
courtFileList: FileList[];
|
|
18
|
+
myFileList: FileList[];
|
|
19
|
+
id: string;
|
|
20
|
+
refetch: () => void;
|
|
21
|
+
}) => {
|
|
11
22
|
const [tap, setTap] = useState('my');
|
|
12
23
|
|
|
13
24
|
return (
|
|
@@ -45,6 +56,7 @@ const Document = ({ courtFileList, myFileList }: { courtFileList: FileList[]; my
|
|
|
45
56
|
? courtFileList.map((item, index) => <DocumentLine item={item} index={index} key={index} />)
|
|
46
57
|
: tap === 'court' && <EmptyTable tap="file" subTap={0} />}
|
|
47
58
|
</div>
|
|
59
|
+
{tap === 'my' && <FileDropZone id={id} refetch={refetch} />}
|
|
48
60
|
</CaseLayout>
|
|
49
61
|
);
|
|
50
62
|
};
|
|
@@ -10,6 +10,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import Image from 'next/image';
|
|
11
11
|
import dayjs from 'dayjs';
|
|
12
12
|
import { useEffect, useState } from 'react';
|
|
13
|
+
import hwp from '../../../../../../asset/images/mycase/icon/hwp.webp';
|
|
14
|
+
import jpg from '../../../../../../asset/images/mycase/icon/jpg.webp';
|
|
15
|
+
import pdf from '../../../../../../asset/images/mycase/icon/pdf.webp';
|
|
16
|
+
import png from '../../../../../../asset/images/mycase/icon/png.webp';
|
|
17
|
+
import word from '../../../../../../asset/images/mycase/icon/word.webp';
|
|
18
|
+
import xls from '../../../../../../asset/images/mycase/icon/xls.webp';
|
|
19
|
+
import jpeg from '../../../../../../asset/images/mycase/icon/jpg.webp';
|
|
20
|
+
import unkown from '../../../../../../asset/images/mycase/icon/unknown.webp';
|
|
21
|
+
const icon = {
|
|
22
|
+
hwp: hwp,
|
|
23
|
+
jpg: jpg,
|
|
24
|
+
pdf: pdf,
|
|
25
|
+
png: png,
|
|
26
|
+
word: word,
|
|
27
|
+
xls: xls,
|
|
28
|
+
jpeg: jpeg
|
|
29
|
+
};
|
|
30
|
+
const getIcon = (extension) => {
|
|
31
|
+
switch (extension) {
|
|
32
|
+
case 'hwp':
|
|
33
|
+
case 'jpg':
|
|
34
|
+
case 'pdf':
|
|
35
|
+
case 'png':
|
|
36
|
+
case 'word':
|
|
37
|
+
case 'xls':
|
|
38
|
+
case 'jpeg':
|
|
39
|
+
return icon[extension];
|
|
40
|
+
default:
|
|
41
|
+
return unkown;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
13
44
|
const DocumentLine = ({ item, index }) => {
|
|
14
45
|
const [downloadUrl, setDownloadUrl] = useState(null);
|
|
15
46
|
useEffect(() => {
|
|
@@ -26,18 +57,18 @@ const DocumentLine = ({ item, index }) => {
|
|
|
26
57
|
});
|
|
27
58
|
fetchBlob();
|
|
28
59
|
}, [item.path]);
|
|
29
|
-
return (<div key={index} className="
|
|
30
|
-
<Image src={
|
|
60
|
+
return (<div key={index} className="flex flex-row items-center pb-[20px] sm-top:border-b-[2px] sm-top:border-solid sm-top:border-grayScale6 sm-top:py-[16px]">
|
|
61
|
+
<Image src={getIcon(item.name.split('.')[1])} alt="image" width={39} height={48} unoptimized className="ml-[5.08px] mr-[12.22px] h-[32.86px] w-[26.7px] flex-shrink-0 sm-top:ml-0 sm-top:mr-[29.6px] sm-top:h-[43.81px] sm-top:w-[35.5px] lg:mr-[32px] lg:h-[48px] lg:w-[39px] "/>
|
|
31
62
|
<div className="mr-[10px] flex flex-grow flex-col overflow-hidden">
|
|
32
|
-
<p className="
|
|
63
|
+
<p className="body_medium1_mo sm-top:body_medium2_tb lg:body_medium2 line-clamp-1 w-full text-black">
|
|
33
64
|
{item.name}
|
|
34
65
|
</p>
|
|
35
|
-
<p className="body_small1_mo sm-top:body_small2_tb lg:body_small2 sm-top:mt-[8px]
|
|
66
|
+
<p className="body_small1_mo sm-top:body_small2_tb lg:body_small2 mt-[4px] text-grayScale2 sm-top:mt-[8px]">
|
|
36
67
|
{dayjs(item.created_at).format('YYYY.MM.DD HH:mm')} - {item.size}MB
|
|
37
68
|
</p>
|
|
38
69
|
</div>
|
|
39
70
|
{downloadUrl && (<a href={downloadUrl} download={item.name} className="flex-shrink-0">
|
|
40
|
-
<Image src={`/images/mycase/icon/download.webp`} alt="image" width={28} height={28} className="
|
|
71
|
+
<Image src={`/images/mycase/icon/download.webp`} alt="image" width={28} height={28} className="h-[20px] w-[20px] flex-shrink-0 sm-top:h-[24px] sm-top:w-[24px] lg:h-[28px] lg:w-[28px] "/>
|
|
41
72
|
</a>)}
|
|
42
73
|
</div>);
|
|
43
74
|
};
|
|
@@ -2,6 +2,39 @@ import Image from 'next/image';
|
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
import { FileList } from '../../../_type/type';
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
5
|
+
import hwp from '../../../../../../asset/images/mycase/icon/hwp.webp';
|
|
6
|
+
import jpg from '../../../../../../asset/images/mycase/icon/jpg.webp';
|
|
7
|
+
import pdf from '../../../../../../asset/images/mycase/icon/pdf.webp';
|
|
8
|
+
import png from '../../../../../../asset/images/mycase/icon/png.webp';
|
|
9
|
+
import word from '../../../../../../asset/images/mycase/icon/word.webp';
|
|
10
|
+
import xls from '../../../../../../asset/images/mycase/icon/xls.webp';
|
|
11
|
+
import jpeg from '../../../../../../asset/images/mycase/icon/jpg.webp';
|
|
12
|
+
import unkown from '../../../../../../asset/images/mycase/icon/unknown.webp';
|
|
13
|
+
|
|
14
|
+
const icon = {
|
|
15
|
+
hwp: hwp,
|
|
16
|
+
jpg: jpg,
|
|
17
|
+
pdf: pdf,
|
|
18
|
+
png: png,
|
|
19
|
+
word: word,
|
|
20
|
+
xls: xls,
|
|
21
|
+
jpeg: jpeg
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const getIcon = (extension: string) => {
|
|
25
|
+
switch (extension) {
|
|
26
|
+
case 'hwp':
|
|
27
|
+
case 'jpg':
|
|
28
|
+
case 'pdf':
|
|
29
|
+
case 'png':
|
|
30
|
+
case 'word':
|
|
31
|
+
case 'xls':
|
|
32
|
+
case 'jpeg':
|
|
33
|
+
return icon[extension];
|
|
34
|
+
default:
|
|
35
|
+
return unkown;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
5
38
|
|
|
6
39
|
const DocumentLine = ({ item, index }: { item: FileList; index: number }) => {
|
|
7
40
|
const [downloadUrl, setDownloadUrl] = useState<string | null>(null);
|
|
@@ -25,21 +58,21 @@ const DocumentLine = ({ item, index }: { item: FileList; index: number }) => {
|
|
|
25
58
|
return (
|
|
26
59
|
<div
|
|
27
60
|
key={index}
|
|
28
|
-
className="
|
|
61
|
+
className="flex flex-row items-center pb-[20px] sm-top:border-b-[2px] sm-top:border-solid sm-top:border-grayScale6 sm-top:py-[16px]"
|
|
29
62
|
>
|
|
30
63
|
<Image
|
|
31
|
-
src={
|
|
64
|
+
src={getIcon(item.name.split('.')[1])}
|
|
32
65
|
alt="image"
|
|
33
66
|
width={39}
|
|
34
67
|
height={48}
|
|
35
68
|
unoptimized
|
|
36
|
-
className="
|
|
69
|
+
className="ml-[5.08px] mr-[12.22px] h-[32.86px] w-[26.7px] flex-shrink-0 sm-top:ml-0 sm-top:mr-[29.6px] sm-top:h-[43.81px] sm-top:w-[35.5px] lg:mr-[32px] lg:h-[48px] lg:w-[39px] "
|
|
37
70
|
/>
|
|
38
71
|
<div className="mr-[10px] flex flex-grow flex-col overflow-hidden">
|
|
39
|
-
<p className="
|
|
72
|
+
<p className="body_medium1_mo sm-top:body_medium2_tb lg:body_medium2 line-clamp-1 w-full text-black">
|
|
40
73
|
{item.name}
|
|
41
74
|
</p>
|
|
42
|
-
<p className="body_small1_mo sm-top:body_small2_tb lg:body_small2 sm-top:mt-[8px]
|
|
75
|
+
<p className="body_small1_mo sm-top:body_small2_tb lg:body_small2 mt-[4px] text-grayScale2 sm-top:mt-[8px]">
|
|
43
76
|
{dayjs(item.created_at).format('YYYY.MM.DD HH:mm')} - {item.size}MB
|
|
44
77
|
</p>
|
|
45
78
|
</div>
|
|
@@ -50,7 +83,7 @@ const DocumentLine = ({ item, index }: { item: FileList; index: number }) => {
|
|
|
50
83
|
alt="image"
|
|
51
84
|
width={28}
|
|
52
85
|
height={28}
|
|
53
|
-
className="
|
|
86
|
+
className="h-[20px] w-[20px] flex-shrink-0 sm-top:h-[24px] sm-top:w-[24px] lg:h-[28px] lg:w-[28px] "
|
|
54
87
|
/>
|
|
55
88
|
</a>
|
|
56
89
|
)}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import FileUploadModal from '../_modal/FileUploadModal';
|
|
4
|
+
import FileSuccessModal from '../_modal/FileSuccessModal';
|
|
5
|
+
import FileUpload from './FileUpload';
|
|
6
|
+
import upload from '../../../../../../asset/images/mycase/icon/upload.webp';
|
|
7
|
+
const FileDropZone = ({ id, refetch }) => {
|
|
8
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
9
|
+
const saved = localStorage.getItem('isFileUploadModalCheck');
|
|
10
|
+
const { getRootProps, getInputProps, isSuccess, setIsSuccess } = FileUpload({ id, refetch });
|
|
11
|
+
return (<div className="mb-[40px] mt-[20px] flex w-full items-end justify-end">
|
|
12
|
+
{/* saved가 true일 때만 Dropzone 적용 */}
|
|
13
|
+
{saved ? (<div {...getRootProps()} className="">
|
|
14
|
+
<input {...getInputProps()}/>
|
|
15
|
+
<button className="flex h-[48px] items-center justify-center gap-[16px] rounded-[24px] bg-mycaseMainColor px-[16px] sm-top:h-[60px] sm-top:gap-[28px] sm-top:rounded-[36px] sm-top:px-[26px] lg:gap-[24px] lg:px-[36px]">
|
|
16
|
+
<Image src={upload} alt="file_upload" width={48} height={48} className="h-[16px] w-[16px] sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px] "/>
|
|
17
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">파일 제출</p>
|
|
18
|
+
</button>
|
|
19
|
+
</div>) : (<button className="flex h-[48px] items-center justify-center gap-[16px] rounded-[24px] bg-mycaseMainColor px-[16px] sm-top:h-[60px] sm-top:gap-[28px] sm-top:rounded-[36px] sm-top:px-[26px] lg:gap-[24px] lg:px-[36px]" onClick={() => setIsOpen(true)}>
|
|
20
|
+
<Image src={upload} alt="file_upload" width={48} height={48} className="h-[16px] w-[16px] sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px] "/>
|
|
21
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">파일 제출</p>
|
|
22
|
+
</button>)}
|
|
23
|
+
|
|
24
|
+
{/* 모달 */}
|
|
25
|
+
<FileUploadModal isOpen={isOpen} onClose={() => setIsOpen(false)} getRootProps={getRootProps} getInputProps={getInputProps}/>
|
|
26
|
+
<FileSuccessModal isOpen={isSuccess} onClose={() => {
|
|
27
|
+
setIsSuccess(false);
|
|
28
|
+
setIsOpen(false);
|
|
29
|
+
}}/>
|
|
30
|
+
</div>);
|
|
31
|
+
};
|
|
32
|
+
export default FileDropZone;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import FileUploadModal from '../_modal/FileUploadModal';
|
|
4
|
+
import FileSuccessModal from '../_modal/FileSuccessModal';
|
|
5
|
+
import FileUpload from './FileUpload';
|
|
6
|
+
import upload from '../../../../../../asset/images/mycase/icon/upload.webp';
|
|
7
|
+
|
|
8
|
+
const FileDropZone = ({ id, refetch }: { id: string; refetch: () => void }) => {
|
|
9
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
10
|
+
const saved = localStorage.getItem('isFileUploadModalCheck');
|
|
11
|
+
|
|
12
|
+
const { getRootProps, getInputProps, isSuccess, setIsSuccess } = FileUpload({ id, refetch });
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className="mb-[40px] mt-[20px] flex w-full items-end justify-end">
|
|
16
|
+
{/* saved가 true일 때만 Dropzone 적용 */}
|
|
17
|
+
{saved ? (
|
|
18
|
+
<div {...getRootProps()} className="">
|
|
19
|
+
<input {...getInputProps()} />
|
|
20
|
+
<button className="flex h-[48px] items-center justify-center gap-[16px] rounded-[24px] bg-mycaseMainColor px-[16px] sm-top:h-[60px] sm-top:gap-[28px] sm-top:rounded-[36px] sm-top:px-[26px] lg:gap-[24px] lg:px-[36px]">
|
|
21
|
+
<Image
|
|
22
|
+
src={upload}
|
|
23
|
+
alt="file_upload"
|
|
24
|
+
width={48}
|
|
25
|
+
height={48}
|
|
26
|
+
className="h-[16px] w-[16px] sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px] "
|
|
27
|
+
/>
|
|
28
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">파일 제출</p>
|
|
29
|
+
</button>
|
|
30
|
+
</div>
|
|
31
|
+
) : (
|
|
32
|
+
<button
|
|
33
|
+
className="flex h-[48px] items-center justify-center gap-[16px] rounded-[24px] bg-mycaseMainColor px-[16px] sm-top:h-[60px] sm-top:gap-[28px] sm-top:rounded-[36px] sm-top:px-[26px] lg:gap-[24px] lg:px-[36px]"
|
|
34
|
+
onClick={() => setIsOpen(true)}
|
|
35
|
+
>
|
|
36
|
+
<Image
|
|
37
|
+
src={upload}
|
|
38
|
+
alt="file_upload"
|
|
39
|
+
width={48}
|
|
40
|
+
height={48}
|
|
41
|
+
className="h-[16px] w-[16px] sm-top:h-[20px] sm-top:w-[20px] lg:h-[24px] lg:w-[24px] "
|
|
42
|
+
/>
|
|
43
|
+
<p className="body_large2_mo sm-top:body_large2_tb lg:body_large2 text-white">파일 제출</p>
|
|
44
|
+
</button>
|
|
45
|
+
)}
|
|
46
|
+
|
|
47
|
+
{/* 모달 */}
|
|
48
|
+
<FileUploadModal
|
|
49
|
+
isOpen={isOpen}
|
|
50
|
+
onClose={() => setIsOpen(false)}
|
|
51
|
+
getRootProps={getRootProps}
|
|
52
|
+
getInputProps={getInputProps}
|
|
53
|
+
/>
|
|
54
|
+
<FileSuccessModal
|
|
55
|
+
isOpen={isSuccess}
|
|
56
|
+
onClose={() => {
|
|
57
|
+
setIsSuccess(false);
|
|
58
|
+
setIsOpen(false);
|
|
59
|
+
}}
|
|
60
|
+
/>
|
|
61
|
+
</div>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default FileDropZone;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const FileUpload: ({ id, refetch }: {
|
|
2
|
+
id: string;
|
|
3
|
+
refetch: () => void;
|
|
4
|
+
}) => {
|
|
5
|
+
getRootProps: <T extends import("react-dropzone").DropzoneRootProps>(props?: T) => T;
|
|
6
|
+
getInputProps: <T extends import("react-dropzone").DropzoneInputProps>(props?: T) => T;
|
|
7
|
+
isSuccess: boolean;
|
|
8
|
+
setIsSuccess: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
9
|
+
};
|
|
10
|
+
export default FileUpload;
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { useDropzone } from 'react-dropzone';
|
|
11
|
+
import { useState, useCallback } from 'react';
|
|
12
|
+
import { useActionPostMyFileUpload } from '../../../_actions/action';
|
|
13
|
+
const FileUpload = ({ id, refetch }) => {
|
|
14
|
+
const [uploadedFiles, setUploadedFiles] = useState([]);
|
|
15
|
+
const { mutateAsync, isLoading } = useActionPostMyFileUpload(id);
|
|
16
|
+
const [isSuccess, setIsSuccess] = useState(false);
|
|
17
|
+
const onDrop = useCallback((acceptedFiles) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
// setUploadedFiles((prev: File[]) => [...prev, ...acceptedFiles]);
|
|
19
|
+
console.log('test2244442');
|
|
20
|
+
const res = yield mutateAsync(acceptedFiles[0]);
|
|
21
|
+
console.log('res:', res);
|
|
22
|
+
if (res.result) {
|
|
23
|
+
setIsSuccess(res.result);
|
|
24
|
+
if (refetch) {
|
|
25
|
+
refetch();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}), []);
|
|
29
|
+
const { getRootProps, getInputProps } = useDropzone({
|
|
30
|
+
onDrop,
|
|
31
|
+
accept: {
|
|
32
|
+
'image/jpeg': ['.jpeg', '.jpg'],
|
|
33
|
+
'image/png': ['.png'],
|
|
34
|
+
'application/pdf': ['.pdf'],
|
|
35
|
+
'application/msword': ['.doc'],
|
|
36
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': ['.docx']
|
|
37
|
+
},
|
|
38
|
+
multiple: false,
|
|
39
|
+
maxSize: 10 * 1024 * 1024 // 10MB
|
|
40
|
+
});
|
|
41
|
+
return { getRootProps, getInputProps, isSuccess, setIsSuccess };
|
|
42
|
+
};
|
|
43
|
+
export default FileUpload;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useDropzone } from 'react-dropzone';
|
|
2
|
+
import { useState, useCallback } from 'react';
|
|
3
|
+
import { useActionPostMyFileUpload } from '../../../_actions/action';
|
|
4
|
+
|
|
5
|
+
const FileUpload = ({ id, refetch }: { id: string; refetch: () => void }) => {
|
|
6
|
+
const [uploadedFiles, setUploadedFiles] = useState<File[]>([]);
|
|
7
|
+
const { mutateAsync, isLoading } = useActionPostMyFileUpload(id);
|
|
8
|
+
const [isSuccess, setIsSuccess] = useState(false);
|
|
9
|
+
const onDrop = useCallback(async (acceptedFiles: File[]) => {
|
|
10
|
+
// setUploadedFiles((prev: File[]) => [...prev, ...acceptedFiles]);
|
|
11
|
+
console.log('test2244442');
|
|
12
|
+
const res = await mutateAsync(acceptedFiles[0]);
|
|
13
|
+
console.log('res:', res);
|
|
14
|
+
if (res.result) {
|
|
15
|
+
setIsSuccess(res.result);
|
|
16
|
+
if (refetch) {
|
|
17
|
+
refetch();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}, []);
|
|
21
|
+
|
|
22
|
+
const { getRootProps, getInputProps } = useDropzone({
|
|
23
|
+
onDrop,
|
|
24
|
+
accept: {
|
|
25
|
+
'image/jpeg': ['.jpeg', '.jpg'],
|
|
26
|
+
'image/png': ['.png'],
|
|
27
|
+
'application/pdf': ['.pdf'],
|
|
28
|
+
'application/msword': ['.doc'],
|
|
29
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': ['.docx']
|
|
30
|
+
},
|
|
31
|
+
multiple: false,
|
|
32
|
+
maxSize: 10 * 1024 * 1024 // 10MB
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
return { getRootProps, getInputProps, isSuccess, setIsSuccess };
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export default FileUpload;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Image from 'next/image';
|
|
2
|
+
import ModalContainer from './ModalCotainer';
|
|
3
|
+
const CaseInquiryConfirmModal = ({ isOpen, onClose, }) => {
|
|
4
|
+
// console.log(isLoading);
|
|
5
|
+
return (<ModalContainer isOpen={isOpen} onClose={() => {
|
|
6
|
+
onClose();
|
|
7
|
+
}}>
|
|
8
|
+
<div className="absolute flex w-[calc(100%-40px)] flex-col items-center justify-center overflow-y-auto rounded-[12px] border border-solid border-grayScale4 bg-grayScale8 p-[30px] sm-top:w-[calc(100%-252px)] sm-top:max-w-[648px] sm-top:rounded-[24px] sm-top:px-[54px] sm-top:py-[44px] lg:w-full lg:max-w-[804px] lg:p-[52px] " onClick={e => e.stopPropagation()}>
|
|
9
|
+
<Image src="/images/mycase/icon/modal_icon.webp" alt="check" width={40} height={48.9} className="h-[48.9px] w-[40px] sm-top:h-[68.44px] sm-top:w-[56px] lg:h-[88px] lg:w-[72px]"/>
|
|
10
|
+
<p className="body_large1_mo sm-top:body_large1_tb sm-top: lg:body_large1 mt-[20.11px] sm-top:mt-[48px] lg:mt-[60px]">
|
|
11
|
+
파일 제출이 완료되었습니다.
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<button className={`mt-[20px] h-[48px] w-full rounded-[4px] bg-grayScale1 sm-top:mt-[53px] sm-top:h-[60px] sm-top:rounded-[8px] lg:mt-[73px] lg:h-[72px] lg:rounded-[16px] `} onClick={() => {
|
|
15
|
+
onClose();
|
|
16
|
+
}}>
|
|
17
|
+
<p className="text-white body_large2_mo sm-top:body_large2_tb lg:body_large2">확인</p>
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
</ModalContainer>);
|
|
21
|
+
};
|
|
22
|
+
export default CaseInquiryConfirmModal;
|