Skip to content

Commit

Permalink
fix: presentation page sidebar 수정
Browse files Browse the repository at this point in the history
- #48
  • Loading branch information
SaaaHoP committed Oct 13, 2022
1 parent 79d1f75 commit fbc56b6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/util/getSideTabList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const getSideTabList = (id: number) => [
link: `/project/${id}/kanban`,
path: `/project/${id}/kanban`,
},
{ tab: SIDE_TAB.presentation, link: `/project/${id}/presentation`, path: '/presentation' },
{ tab: SIDE_TAB.presentation, link: `/project/${id}/presentation`, path: `/project/${id}/presentation` },
];

export default getSideTabList;
26 changes: 21 additions & 5 deletions pages/project/[id]/presentation.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import { useRouter } from 'next/router';

import getSideTabList from '@/lib/util/getSideTabList';

import AppLayoutMain from '@/components/common/Layout/AppLayoutMain';

import PresentationVideo from '@/components/project/PresentationVideo';
import Sidebar from '@/components/project/Sidebar';
import SideTab from '@/components/project/Sidebar/TabList/SideTab';

import * as Styled from '@/styles/pages/Project/presentation';

const PresentationPage = () => {
const router = useRouter();

const [id, setId] = useState<number>();

useEffect(() => {
if (!router.isReady) return;

setId(parseInt(router.query.id as string, 10));
}, [router.isReady]);

return (
<AppLayoutMain height="100vh" bottom="-45vh">
<Styled.Container>
<Sidebar />
<PresentationVideo />
</Styled.Container>
{id && (
<Styled.Container>
<Sidebar TabList={<SideTab path={router.asPath} sideTabList={getSideTabList(id)} />} />
<PresentationVideo />
</Styled.Container>
)}
</AppLayoutMain>
);
};
Expand Down

0 comments on commit fbc56b6

Please sign in to comment.