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

Create header menu to navigate between pages #9

Merged
merged 5 commits into from
Jan 5, 2025
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
3 changes: 0 additions & 3 deletions webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
</style>
</head>
<body>
<a href="https://github.com/kaakaa/ai-agent-statistics" class="github-icon">
<img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" alt="GitHub" width="32" height="32">
</a>
<div id="root"></div>
<script type="module" src="./src/main.tsx"></script>
</body>
Expand Down
28 changes: 28 additions & 0 deletions webapp/src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import { Link } from 'react-router';
kaakaa marked this conversation as resolved.
Show resolved Hide resolved
import GitHubIcon from '@mui/icons-material/GitHub';

const Header: React.FC = () => {
return (
<nav style={{ display: 'flex', justifyContent: 'flex-end', position: 'fixed', 'top': 0, 'width': '100%', padding: '10px', backgroundColor: '#343a40'}}>
<ul style={{ display: 'flex', listStyle: 'none', margin: 0, padding: 0 }}>
<li style={{ margin: '0 10px' }}>
<Link to="/" style={{ textDecoration: 'none', color: '#ffffff' }}>Summary</Link>
</li>
<li style={{ margin: '0 10px' }}>
<Link to="/statistics" style={{ textDecoration: 'none', color: '#ffffff' }}>Statistics</Link>
</li>
<li style={{ margin: '0 10px' }}>
<Link to="/details" style={{ textDecoration: 'none', color: '#ffffff' }}>Details</Link>
</li>
<li style={{ margin: '0 10px' }}>
<a href="https://github.com/kaakaa/ai-agent-statistics" target="_blank" rel="noopener noreferrer" style={{ color: '#ffffff' }}>
<GitHubIcon />
</a>
</li>
</ul>
</nav>
);
};

export default Header;
1 change: 1 addition & 0 deletions webapp/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ body {
display: flex;
place-items: center;
min-width: 320px;
max-width: 100vw;
min-height: 100vh;
}

Expand Down
2 changes: 2 additions & 0 deletions webapp/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import './index.css'
import PullRequestsTable from './components/PullRequests.tsx'
import StatisticsPage from './components/Statistics.tsx';
import SummaryPage from './components/Summary.tsx';
import Header from './components/Header.tsx';

const base = import.meta.env.BASE_URL

createRoot(document.getElementById('root')!).render(
<StrictMode>
<Router basename={base}>
<Header/>
<Routes>
<Route path="/" element={<SummaryPage />} />
<Route path="/statistics" element={<StatisticsPage />} />
Expand Down