@@ -3,33 +3,35 @@ import { useSelector } from 'react-redux';
33import { useNavigate } from 'react-router-dom' ;
44import { toast } from 'react-toastify' ;
55
6- import { Button } from '../../components' ;
6+ import { Button , FileBox } from '../../components' ;
77import { RootState } from '../../state/reducers' ;
8- import { getFileSize , getDate } from '../../utils' ;
98import * as S from './styled' ;
109
1110export const DownloadPage : React . FC = ( ) => {
1211 const navigate = useNavigate ( ) ;
1312 const downloadFileProps : any = useSelector ( ( state : RootState ) => state . DownloadFileProps ) ;
14- const { year, month, day } = getDate ( downloadFileProps . LastModified ) ;
13+ const { year, month, day } = downloadFileProps . lastModified ;
1514 useEffect ( ( ) => {
1615 if (
17- downloadFileProps . Name === null ||
18- downloadFileProps . Size === null ||
19- downloadFileProps . LastModified === null
16+ downloadFileProps . filename === null ||
17+ downloadFileProps . size === null ||
18+ downloadFileProps . lastModified === null
2019 ) {
2120 navigate ( '/' ) ;
2221 }
2322 } , [ navigate , downloadFileProps ] ) ;
2423 return (
2524 < S . DownloadPageContainer >
26- < S . DonwloadFileBox >
27- 파일이름:{ downloadFileProps . Name } / 크기:{ getFileSize ( downloadFileProps . Size ) } / 업로드된
28- 날짜:
25+ < FileBox >
26+ 파일이름:{ downloadFileProps . filename } / 크기:{ downloadFileProps . size } / 업로드된 날짜:
2927 { year } -{ month } -{ day }
30- </ S . DonwloadFileBox >
28+ </ FileBox >
3129 < S . DownloadPageButtonSection >
32- < a href = { `${ process . env . REACT_APP_BACKEND_BASEURL } /dl/${ downloadFileProps . Name } ` } >
30+ < a
31+ href = { `${ process . env . REACT_APP_BACKEND_BASEURL } /dl/${ downloadFileProps . name } ${
32+ downloadFileProps . token != null ? `?${ downloadFileProps . token } ` : ''
33+ } `}
34+ >
3335 < Button click = { ( ) => { } } bgColor = "var(--color-button-primary)" label = "다운로드" />
3436 </ a >
3537 < Button
0 commit comments