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

Dev #21

Merged
merged 30 commits into from
Nov 2, 2022
Merged

Dev #21

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
b6afeb0
개발 branch 전용 코드
ananjaemin Oct 27, 2022
d02b92c
Merge pull request #12 from ananjaemin/main
ananjaemin Oct 27, 2022
3c98555
fix: color
ananjaemin Oct 31, 2022
67b8506
feat: apiPage 이동,z-index
ananjaemin Oct 31, 2022
301cb57
fix: css variables color name
ananjaemin Oct 31, 2022
a6c9fa4
feat: Route ApiPage 추가
ananjaemin Oct 31, 2022
9d7d64a
feat: apiPage 기본구성
ananjaemin Oct 31, 2022
284638b
fix: color
ananjaemin Oct 31, 2022
a5eaae1
feat: SkeletonUIBox 추가
ananjaemin Oct 31, 2022
720e64f
feat: Skeleton UI
ananjaemin Oct 31, 2022
222e021
feat: password 기능
ananjaemin Nov 1, 2022
b852512
Merge branch 'dev' into 13-password-function-적용
ananjaemin Nov 1, 2022
d61d404
Merge pull request #14 from ananjaemin/13-password-function-적용
ananjaemin Nov 1, 2022
975d04d
feat: SkeletionUI component 추가
ananjaemin Nov 2, 2022
30dfea0
feat: Api Post Page 추가
ananjaemin Nov 2, 2022
b3d9df4
feat: color
ananjaemin Nov 2, 2022
2c02dc5
feat: postApiPage 추가:
ananjaemin Nov 2, 2022
4960427
Merge branch 'dev' into 4-api-page-개발
ananjaemin Nov 2, 2022
7963a78
Merge pull request #16 from ananjaemin/4-api-page-개발
ananjaemin Nov 2, 2022
d79d21e
fix: pull로 인한 버그 코드
ananjaemin Nov 2, 2022
8e258dd
test: Notfound Page
ananjaemin Nov 2, 2022
3022fc9
test: NotfoundPage Route
ananjaemin Nov 2, 2022
a9768dd
Merge branch '4-api-page-개발' into 17-404오류-page-제작
ananjaemin Nov 2, 2022
bf6fb74
Merge pull request #18 from ananjaemin/17-404오류-page-제작
ananjaemin Nov 2, 2022
c451c27
feat: catch추가, fix: res console 삭제
ananjaemin Nov 2, 2022
3ef541c
fix: 404 페이지 이동
ananjaemin Nov 2, 2022
57d9b22
Merge pull request #19 from ananjaemin/4-api-page-개발
ananjaemin Nov 2, 2022
aac0261
fix: pull 버그
ananjaemin Nov 2, 2022
8e0e753
Merge pull request #20 from ananjaemin/17-404오류-page-제작
ananjaemin Nov 2, 2022
8253d8a
fix: 제작중 toast
ananjaemin Nov 2, 2022
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
12 changes: 11 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ import { ToastContainer } from 'react-toastify';

import 'react-toastify/dist/ReactToastify.css';
import { Navbar } from './components';
import { MainPage, SuccessPage, DownloadPage, DeletePage, FileListPage } from './pages';
import {
MainPage,
SuccessPage,
DownloadPage,
DeletePage,
FileListPage,
ApiPage,
NotFoundPage,
} from './pages';
import { store } from './state/store';

export const App: React.FC = () => (
Expand Down Expand Up @@ -41,6 +49,8 @@ export const App: React.FC = () => (
<Route path="/download" element={<DownloadPage />} />
<Route path="/delete" element={<DeletePage />} />
<Route path="/filelist" element={<FileListPage />} />
<Route path="/api/*" element={<ApiPage />} />
<Route path="*" element={<NotFoundPage />} />
</Route>
</Routes>
</Provider>
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/FileListBox/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import styled from '@emotion/styled';

export const FileListBoxContainer = styled.div`
background-color: var(--color-backgorund-filelistbox);
color: var(--color-text-filelistbox);
color: var(--color-text-tertiary);
border-radius: 10px;
padding: 1.2rem 1.2rem 1.2rem 1.2rem;
display: flex;
Expand Down
13 changes: 1 addition & 12 deletions src/components/common/Navbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
import React from 'react';
import { toast } from 'react-toastify';

import * as S from './styled';

export const Navbar: React.FC = () => (
<S.NavbarContainer>
<S.Nav to={'/'}>Upload</S.Nav>
<S.Nav
to={'/'}
onClick={() => {
toast.success('제작중!', {
autoClose: 1000,
position: toast.POSITION.BOTTOM_RIGHT,
});
}}
>
API
</S.Nav>
<S.Nav to={'/api'}>API</S.Nav>
<S.Nav to={'/filelist'}>File list</S.Nav>
</S.NavbarContainer>
);
1 change: 1 addition & 0 deletions src/components/common/Navbar/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const NavbarContainer = styled.nav`
margin: 30px auto 30px auto;
display: flex;
justify-content: space-between;
z-index: 99;
`;

export const Nav = styled(Link)`
Expand Down
64 changes: 64 additions & 0 deletions src/components/common/SkeletonUIBox/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import styled from '@emotion/styled';
export const SkeletonUIBox = styled.div<{ randomWitdh: string }>`
display: flex;
background-color: var(--color-backgorund-filelistbox);
border-radius: 10px;
margin-bottom: 1.5rem;
min-height: 4.6rem;
min-width: ${(props) => props.randomWitdh}rem;
overflow: hidden;
&::before {
content: ' ';
width: 100%;
height: auto;
animation: loading 2s infinite;
box-shadow: 0 0 30px 30px rgba(255, 255, 255, 0.3);
}
@keyframes loading {
0% {
transform: translateX(-50%);
}
50% {
transform: translateX(100%);
}
100% {
transform: translate(200%);
}
}
`;
export const SkeletonUIApiBox = styled(SkeletonUIBox)`
min-height: 6.2rem;
margin: 1rem;
`;

export const SkeletonUI = styled.div<{
width: string;
height: string;
margin: string;
}>`
display: flex;
min-width: ${(props) => props.width};
min-height: ${(props) => props.height};
margin: ${(props) => props.margin};
background: var(--color-backgorund-filelistbox);
border-radius: 10px;
overflow: hidden;
&::before {
content: ' ';
width: 100%;
height: auto;
animation: loading 2s infinite;
box-shadow: 0 0 30px 30px rgba(255, 255, 255, 0.3);
}
@keyframes loading {
0% {
transform: translateX(-50%);
}
50% {
transform: translateX(100%);
}
100% {
transform: translate(200%);
}
}
`;
1 change: 1 addition & 0 deletions src/components/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export * from './Navbar';
export * from './Button';
export * from './FileListBox';
export * from './Progress';
export * from './SkeletonUIBox';
74 changes: 74 additions & 0 deletions src/pages/api/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import axios from 'axios';
import React, { useState, useEffect } from 'react';
import { Route, Routes, Link } from 'react-router-dom';

import { SkeletonUIApiBox } from '../../components';
import { ApiPostPage } from '../postApi';
import * as S from './styled';

export const ApiPage: React.FC = () => {
const [loading, setLoading] = useState(false);
const [apiInfo, setApiInfo] = useState<any[]>();
const SkeletonUIRandomWidth = ['40', '50', '55', '45'];
const getApiInfo = async () => {
await axios({
method: 'get',
url: 'https://tfb.minpeter.cf/info',
})
.then((res) => {
setApiInfo(res.data);
setTimeout(() => {
setLoading(true); //loading 확인하고싶으면 false로 바꿔주세요.
}, 1200);
})
.catch((err) => {
console.log(err);
});
};

useEffect(() => {
getApiInfo();
}, []);

return (
<S.ApiPageContainer>
<Routes>
<Route
path="/"
element={
<>
<S.ApiListSection>
{loading ? (
<>
{apiInfo?.map((item, index) => (
<Link key={index} to={item.apiHandler} style={{ textDecoration: 'none' }}>
<S.ApiListBox>{item.apiUrl}</S.ApiListBox>
</Link>
))}
</>
) : (
<>
<SkeletonUIApiBox
randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 4)]}
/>
<SkeletonUIApiBox
randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 4)]}
/>
<SkeletonUIApiBox
randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 4)]}
/>
<SkeletonUIApiBox
randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 4)]}
/>
</>
)}
</S.ApiListSection>
<S.ApiListSectionShadow />
</>
}
/>
<Route path=":urlApi" element={<ApiPostPage />} />
</Routes>
</S.ApiPageContainer>
);
};
40 changes: 40 additions & 0 deletions src/pages/api/styled.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import styled from '@emotion/styled';

export const ApiPageContainer = styled.div`
display: flex;
align-items: center;
flex-direction: column;
`;

export const ApiListSection = styled.div`
overflow-y: auto;
display: flex;
flex-direction: column;
align-items: center;
max-height: 40rem;
&::-webkit-scrollbar {
display: none;
}
`;

export const ApiListBox = styled.div`
background-color: var(--color-backgorund-filelistbox);
color: var(--color-text-tertiary);
border-radius: 10px;
padding: 2rem 1.4rem 2rem 1.4rem;
margin: 1rem;
display: flex;
flex-direction: row;
align-items: center;
font-size: 2.2rem;
font-weight: 700;
cursor: pointer;
`;

export const ApiListSectionShadow = styled.div`
width: 100%;
height: 6rem;
position: relative;
top: -25px;
background: linear-gradient(180deg, rgba(40, 42, 58, 0) 0%, #282a3a 45.31%);
`;
2 changes: 1 addition & 1 deletion src/pages/download/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const DownloadPageButtonSection = styled.div`

export const DonwloadFileBox = styled.div`
background-color: var(--color-backgorund-filelistbox);
color: var(--color-text-filelistbox);
color: var(--color-text-tertiary);
border-radius: 10px;
padding: 1.2rem 1.2rem 1.2rem 1.2rem;
display: flex;
Expand Down
32 changes: 9 additions & 23 deletions src/pages/filelist/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useDispatch } from 'react-redux';
import { useNavigate } from 'react-router-dom';
import { bindActionCreators } from 'redux';

import { FileListBox } from '../../components';
import { FileListBox, SkeletonUIBox } from '../../components';
import { actionCreators } from '../../state';
import { getFileSize, getShortFileName, getDate } from '../../utils';
import * as S from './styled';
Expand All @@ -25,7 +25,7 @@ export const FileListPage: React.FC = () => {
setFileList(res.data.list); //파일리스트 요소 갯수에 따른 핸들링 추가예정
setTimeout(() => {
setLoading(true); //loading 확인하고싶으면 false로 바꿔주세요.
}, 1500);
}, 1200);
})
.catch((err) => {
console.log(err);
Expand Down Expand Up @@ -62,27 +62,13 @@ export const FileListPage: React.FC = () => {
) : (
<>
<S.FileListPageContainer>
<S.FileListSkeletonUI
randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]}
/>
<S.FileListSkeletonUI
randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]}
/>
<S.FileListSkeletonUI
randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]}
/>
<S.FileListSkeletonUI
randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]}
/>
<S.FileListSkeletonUI
randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]}
/>
<S.FileListSkeletonUI
randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]}
/>
<S.FileListSkeletonUI
randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]}
/>
<SkeletonUIBox randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]} />
<SkeletonUIBox randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]} />
<SkeletonUIBox randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]} />
<SkeletonUIBox randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]} />
<SkeletonUIBox randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]} />
<SkeletonUIBox randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]} />
<SkeletonUIBox randomWitdh={SkeletonUIRandomWidth[Math.floor(Math.random() * 6)]} />
</S.FileListPageContainer>
<S.FileListPageBoxShoadow />
</>
Expand Down
28 changes: 0 additions & 28 deletions src/pages/filelist/styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,3 @@ export const FileListPageBoxShoadow = styled.div`
top: -25px;
background: linear-gradient(180deg, rgba(40, 42, 58, 0) 0%, #282a3a 45.31%);
`;

export const FileListSkeletonUI = styled.div<{ randomWitdh: string }>`
display: flex;
background-color: var(--color-backgorund-filelistbox);
border-radius: 10px;
margin-bottom: 1.5rem;
min-height: 4.6rem;
min-width: ${(props) => props.randomWitdh}rem;
overflow: hidden;
&::before {
content: ' ';
width: 100%;
height: auto;
animation: loading 2s infinite;
box-shadow: 0 0 30px 30px rgba(255, 255, 255, 0.3);
}
@keyframes loading {
0% {
transform: translateX(-50%);
}
50% {
transform: translateX(100%);
}
100% {
transform: translate(200%);
}
}
`;
2 changes: 2 additions & 0 deletions src/pages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ export * from './success';
export * from './download';
export * from './delete';
export * from './filelist';
export * from './api';
export * from './notfound';
Loading