Skip to content

Commit

Permalink
Addition of style pages, minus their content
Browse files Browse the repository at this point in the history
  • Loading branch information
chamhayden committed Sep 9, 2023
1 parent 06294a3 commit 40e74a9
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 2 deletions.
11 changes: 11 additions & 0 deletions frontend/src/Router.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ import ContentTutorialsByWeek from './page/Content/ContentTutorialsByWeek';
import ContentTutorialsByTopic from './page/Content/ContentTutorialsByTopic';
import AssessmentsAssignments from './page/Assessments/AssessmentsAssignments';
import AssessmentsExam from './page/Assessments/AssessmentsExam';
import StyleBase from './page/Style/StyleBase';
import StyleHtml from './page/Style/StyleHtml';
import StyleCSS from './page/Style/StyleCSS';
import StyleJavascript from './page/Style/StyleJavascript';
import StyleReactJS from './page/Style/StyleReact';
import HelpBase from './page/Help/HelpBase';
import HelpStyle from './page/Help/HelpStyle';
import HelpInstallation from './page/Help/HelpInstallation';
Expand Down Expand Up @@ -90,6 +95,12 @@ const Router = () => {
<Route path="reactjs" element={<HelpResourcesReact />} />
</Route>
</Route>
<Route path="style" element={<StyleBase />}>
<Route path="html" element={<StyleHtml />} />
<Route path="css" element={<StyleCSS />} />
<Route path="javascript" element={<StyleJavascript />} />
<Route path="reactjs" element={<StyleReactJS />} />
</Route>
<Route path="grades" element={<Grades />}></Route>
<Route path="course-outline" element={<CourseOutline />}></Route>
</Route>
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/component/NavList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ export const getPrimaryNavList = (term) => {
},
{
title: 'Style Guide',
route: `https://nw-syd-gitlab.cseunsw.tech/COMP6080/${term}/style`,
external: true,
route: `/style`,
Icon: PaletteIcon,
description: 'View our style guide for different languages in the course',
},
Expand Down
60 changes: 60 additions & 0 deletions frontend/src/page/Style/StyleBase.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import React from 'react';
import { Outlet } from 'react-router-dom';
import { useNavigate, useLocation } from 'react-router-dom';

import Divider from '@mui/material/Divider';
import GitHubIcon from '@mui/icons-material/GitHub';
import LoopIcon from '@mui/icons-material/Loop';
import PodcastsIcon from '@mui/icons-material/Podcasts';
import PaletteIcon from '@mui/icons-material/Palette';
import BuildIcon from '@mui/icons-material/Build';
import CodeIcon from '@mui/icons-material/Code';

import SubNavWrapper from '../../component/SubNavWrapper';
import makePage from '../../component/makePage';

import { Context, useContext } from '../../context';

const HelpResources = ({ }) => {

const { getters } = useContext(Context);
const { pathname } = useLocation();
const navigate = useNavigate();

React.useEffect(() => {
if (pathname.endsWith('/style')) {
navigate(`/${getters.term}/style/html`);
}
}, []);

const menu = [
{
title: 'HTML',
icon: <CodeIcon />,
subRoute: 'html',
},
{
title: 'CSS',
icon: <PaletteIcon />,
subRoute: 'css',
},
{
title: 'Javascript',
icon: <BuildIcon />,
subRoute: 'javascript',
},
{
title: 'ReactJS',
icon: <LoopIcon />,
subRoute: 'reactjs',
},
];

return (
<SubNavWrapper baseUrl={'/style'} menu={menu}>
<Outlet />
</SubNavWrapper>
);
};

export default HelpResources
21 changes: 21 additions & 0 deletions frontend/src/page/Style/StyleCSS.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import Typography from '@mui/material/Typography';
import Divider from '@mui/material/Divider';

import makePage from '../../component/makePage';

const StyleCss = ({}) => {
return (
<>
<Typography variant="body1" gutterBottom>
Test
</Typography>

</>
);
};

export default makePage(StyleCss, {
loginRequired: true,
title: 'CSS Style',
});
21 changes: 21 additions & 0 deletions frontend/src/page/Style/StyleHtml.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import Typography from '@mui/material/Typography';
import Divider from '@mui/material/Divider';

import makePage from '../../component/makePage';

const StyleHtmlCss = ({}) => {
return (
<>
<Typography variant="body1" gutterBottom>
Test
</Typography>

</>
);
};

export default makePage(StyleHtmlCss, {
loginRequired: true,
title: 'HTML/CSS Style',
});
21 changes: 21 additions & 0 deletions frontend/src/page/Style/StyleJavascript.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import Typography from '@mui/material/Typography';
import Divider from '@mui/material/Divider';

import makePage from '../../component/makePage';

const StyleJavascript = ({}) => {
return (
<>
<Typography variant="body1" gutterBottom>
Test
</Typography>

</>
);
};

export default makePage(StyleJavascript, {
loginRequired: true,
title: 'Javascript Style',
});
21 changes: 21 additions & 0 deletions frontend/src/page/Style/StyleReact.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import Typography from '@mui/material/Typography';
import Divider from '@mui/material/Divider';

import makePage from '../../component/makePage';

const StyleReactJS = ({}) => {
return (
<>
<Typography variant="body1" gutterBottom>
Test
</Typography>

</>
);
};

export default makePage(StyleReactJS, {
loginRequired: true,
title: 'ReactJS Style',
});

0 comments on commit 40e74a9

Please sign in to comment.