Skip to content

Commit

Permalink
Merge pull request #34 from ananjaemin/24-download-page-구조-개편-및-합치기
Browse files Browse the repository at this point in the history
24 download page 구조 개편 및 합치기
  • Loading branch information
ananjaemin committed Nov 9, 2022
2 parents 1f05c02 + 8b46546 commit 50f7983
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/common/FileFind/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const FileFind: React.FC<FileFindProps> = ({ handleChangeFile, fileProps
<S.FileFindContainer>
{fileProps.name != '' && fileProps.size != '' && fileProps.fileType != '' ? (
<S.FileFindTextBox placeholders={false}>
{'이름:' + fileProps.name + ' / 크기:' + fileProps.size + ' / 타입:' + fileProps.fileType}
{'이름:' + fileProps.Name + ' / 크기:' + fileProps.Size + ' / 타입:' + fileProps.fileType}
</S.FileFindTextBox>
) : (
<S.FileFindTextBox placeholders={true}>업로드 할 파일을 선택해주세요....</S.FileFindTextBox>
Expand Down
1 change: 1 addition & 0 deletions src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './useDeletePageNavigate';
export * from './useDownloadPageNavigate';
16 changes: 16 additions & 0 deletions src/hooks/useDownloadPageNavigate.ts
Original file line number Diff line number Diff line change
@@ -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];
};
25 changes: 23 additions & 2 deletions src/pages/download/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export const DownloadPage: React.FC = () => {
downloadFileProps.size === null ||
downloadFileProps.lastModified === null
) {
navigate(-1);
navigate('/');
}
});
}, [navigate, downloadFileProps]);
return (
<S.DownloadPageContainer>
<FileBox>
Expand All @@ -34,6 +34,27 @@ export const DownloadPage: React.FC = () => {
>
<Button click={() => {}} bgColor="var(--color-button-primary)" label="다운로드" />
</a>
<Button
click={() => {
navigator.clipboard.writeText(``);
toast.success('복사 완료', {
autoClose: 1000,
position: toast.POSITION.BOTTOM_RIGHT,
});
}}
bgColor="var(--color-button-primary)"
label="링크복사"
/>
<Button
click={() => {
toast.success('제작중!', {
autoClose: 1000,
position: toast.POSITION.BOTTOM_RIGHT,
});
}}
bgColor="var(--color-button-secondary)"
label="파일삭제"
/>
<Button
click={() => {
toast.success('제작중!', {
Expand Down
1 change: 1 addition & 0 deletions src/pages/download/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from '@emotion/styled';
export const DownloadPageContainer = styled.div`
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
`;

Expand Down

0 comments on commit 50f7983

Please sign in to comment.