Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24 download page 구조 개편 및 합치기 #34

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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