Skip to content

Commit 50f7983

Browse files
authored
Merge pull request #34 from ananjaemin/24-download-page-구조-개편-및-합치기
24 download page 구조 개편 및 합치기
2 parents 1f05c02 + 8b46546 commit 50f7983

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed

src/components/common/FileFind/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const FileFind: React.FC<FileFindProps> = ({ handleChangeFile, fileProps
1111
<S.FileFindContainer>
1212
{fileProps.name != '' && fileProps.size != '' && fileProps.fileType != '' ? (
1313
<S.FileFindTextBox placeholders={false}>
14-
{'이름:' + fileProps.name + ' / 크기:' + fileProps.size + ' / 타입:' + fileProps.fileType}
14+
{'이름:' + fileProps.Name + ' / 크기:' + fileProps.Size + ' / 타입:' + fileProps.fileType}
1515
</S.FileFindTextBox>
1616
) : (
1717
<S.FileFindTextBox placeholders={true}>업로드 할 파일을 선택해주세요....</S.FileFindTextBox>

src/hooks/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export * from './useDeletePageNavigate';
2+
export * from './useDownloadPageNavigate';
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { useDispatch } from 'react-redux';
2+
import { useNavigate } from 'react-router-dom';
3+
import { bindActionCreators } from 'redux';
4+
5+
import { actionCreators } from '../state';
6+
7+
export const useDownloadPageNavigate = (props: any) => {
8+
const navigate = useNavigate();
9+
const dispatch = useDispatch();
10+
const { SetDownloadFileProps } = bindActionCreators(actionCreators, dispatch);
11+
const move = () => {
12+
SetDownloadFileProps(props);
13+
navigate('/download');
14+
};
15+
return [move];
16+
};

src/pages/download/index.tsx

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ export const DownloadPage: React.FC = () => {
1717
downloadFileProps.size === null ||
1818
downloadFileProps.lastModified === null
1919
) {
20-
navigate(-1);
20+
navigate('/');
2121
}
22-
});
22+
}, [navigate, downloadFileProps]);
2323
return (
2424
<S.DownloadPageContainer>
2525
<FileBox>
@@ -34,6 +34,27 @@ export const DownloadPage: React.FC = () => {
3434
>
3535
<Button click={() => {}} bgColor="var(--color-button-primary)" label="다운로드" />
3636
</a>
37+
<Button
38+
click={() => {
39+
navigator.clipboard.writeText(``);
40+
toast.success('복사 완료', {
41+
autoClose: 1000,
42+
position: toast.POSITION.BOTTOM_RIGHT,
43+
});
44+
}}
45+
bgColor="var(--color-button-primary)"
46+
label="링크복사"
47+
/>
48+
<Button
49+
click={() => {
50+
toast.success('제작중!', {
51+
autoClose: 1000,
52+
position: toast.POSITION.BOTTOM_RIGHT,
53+
});
54+
}}
55+
bgColor="var(--color-button-secondary)"
56+
label="파일삭제"
57+
/>
3758
<Button
3859
click={() => {
3960
toast.success('제작중!', {

src/pages/download/styled.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import styled from '@emotion/styled';
33
export const DownloadPageContainer = styled.div`
44
display: flex;
55
flex-direction: column;
6+
align-items: center;
67
width: 100%;
78
`;
89

0 commit comments

Comments
 (0)