From ae8d6da8c5c507f4bf5f00874c2f209006601bfd Mon Sep 17 00:00:00 2001 From: anjaemin Date: Fri, 4 Nov 2022 17:18:59 +0900 Subject: [PATCH 01/17] feat: fix: api res data --- src/components/common/FileFind/index.tsx | 2 +- src/hooks/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/common/FileFind/index.tsx b/src/components/common/FileFind/index.tsx index ce39e69..07468b0 100644 --- a/src/components/common/FileFind/index.tsx +++ b/src/components/common/FileFind/index.tsx @@ -11,7 +11,7 @@ export const FileFind: React.FC = ({ handleChangeFile, fileProps {fileProps.name != '' && fileProps.size != '' && fileProps.fileType != '' ? ( - {'이름:' + fileProps.name + ' / 크기:' + fileProps.size + ' / 타입:' + fileProps.fileType} + {'이름:' + fileProps.Name + ' / 크기:' + fileProps.Size + ' / 타입:' + fileProps.fileType} ) : ( 업로드 할 파일을 선택해주세요.... diff --git a/src/hooks/index.ts b/src/hooks/index.ts index 45c5a95..a64239a 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1 +1,2 @@ export * from './useDeletePageNavigate'; +export * from './useDownloadPageNavigate'; From 9ea88fa5d8fae4084fee3a4b187090c5bb5d932d Mon Sep 17 00:00:00 2001 From: anjaemin Date: Fri, 4 Nov 2022 17:20:27 +0900 Subject: [PATCH 02/17] feat: useDownloaddPageNavigate custom hook --- src/hooks/useDownloadPageNavigate.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/hooks/useDownloadPageNavigate.ts diff --git a/src/hooks/useDownloadPageNavigate.ts b/src/hooks/useDownloadPageNavigate.ts new file mode 100644 index 0000000..0dc35af --- /dev/null +++ b/src/hooks/useDownloadPageNavigate.ts @@ -0,0 +1,16 @@ +import { useDispatch } from 'react-redux'; +import { useNavigate } from 'react-router-dom'; +import { bindActionCreators } from 'redux'; + +import { actionCreators } from '../state'; + +export const useDownloadPageNavigate = (props: any) => { + const navigate = useNavigate(); + const dispatch = useDispatch(); + const { SetDownloadFileProps } = bindActionCreators(actionCreators, dispatch); + const move = () => { + SetDownloadFileProps(props); + navigate('/download'); + }; + return [move]; +}; From 0daa1ffff83a8e9fff8e0de08c9ab51330ebaa44 Mon Sep 17 00:00:00 2001 From: anjaemin Date: Fri, 4 Nov 2022 17:22:14 +0900 Subject: [PATCH 03/17] =?UTF-8?q?feat:=20button,=20fix:=20navigate/?= =?UTF-8?q?=EB=AF=B8=EC=99=84=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/download/index.tsx | 28 +++++++++++++++++++++++++--- src/pages/download/styled.ts | 1 + 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/pages/download/index.tsx b/src/pages/download/index.tsx index f18640d..efa167c 100644 --- a/src/pages/download/index.tsx +++ b/src/pages/download/index.tsx @@ -18,9 +18,9 @@ export const DownloadPage: React.FC = () => { downloadFileProps.Size === null || downloadFileProps.LastModified === null ) { - navigate(-1); + navigate('/'); } - }); + }, [navigate, downloadFileProps]); return ( @@ -29,9 +29,31 @@ export const DownloadPage: React.FC = () => { {year}-{month}-{day} - + + {/* 패스워드 핸들링해서 다운로드 요청하기 ( token 넣어야됨 ) */}