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

[FEATURE] Introduce how to page and introduction video to the system. #35

Merged
merged 1 commit into from
Aug 12, 2024
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
Binary file added frontend/public/how-to.mp4
Binary file not shown.
3 changes: 2 additions & 1 deletion frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function App() {
<div className="main-content">
<Routes>
<Route path="/" element={<Dashboard onLogout={handleLogout} />} />
<Route path="/adminView" element={<Dashboard onLogout={handleLogout} view="admin" />} />
<Route path="/admin-panel" element={<Dashboard onLogout={handleLogout} view="admin" />} />
<Route path="/how-to" element={<Dashboard onLogout={handleLogout} view="how-to" />} />
</Routes>
</div>
</>
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import DefectConfig from '../defectConfig/DefectConfig';
import Sidebar from "../sidebar/Sidebar";
import AdminView from '../adminView/AdminView';
import logo from '../../logo.svg';
import HowTo from "../howTo/HowTo";

function Copyright(props) {
return (
Expand Down Expand Up @@ -183,7 +184,10 @@ export default function Dashboard({ view, onLogout }) {
<Toolbar />
<Container maxWidth="lg" sx={{ mt: 4, mb: 4 }}>
{view === 'admin' ? (
<AdminView />) : (
<AdminView />
) : view === 'how-to' ? (
<HowTo />
) : (

<><Grid container spacing={3}>
{/* Chart */}
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/components/howTo/HowTo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';

export default function HowTo () {
return (
<div>
<h2>How To</h2>
<video width="100%" controls>
<source src="how-to.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>
</div>
);
};
2 changes: 1 addition & 1 deletion frontend/src/components/sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function Sidebar ({ isAdmin }) {
<ListItemText primary="Admin Panel" />
</ListItemButton>
)}
<ListItemButton>
<ListItemButton component={RouterLink} to={'/how-to'}>
<ListItemIcon>
<SlideshowIcon />
</ListItemIcon>
Expand Down
Loading