Skip to content

Commit

Permalink
#406 fixed nav bar
Browse files Browse the repository at this point in the history
Added leaderboard heading in the nav section..
  • Loading branch information
NavAneEth777 authored and sadanandpai committed Jul 18, 2024
1 parent 0f38f70 commit 5cbba92
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion apps/host/src/components/common/navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ import { ThemeContext } from '../../ThemeWrapper';
import { Sun, Moon, Menu } from 'lucide-react';
import styles from './navbar.module.scss';

function Navbar({ children, title }: { children?: React.ReactNode; title?: string }) {
function Navbar({
children,
title,
subheading,
}: {
children?: React.ReactNode;
title?: string;
subheading?: string;
}) {
const { theme, toggleTheme } = useContext(ThemeContext);
const [isDrawerOpen, setIsDrawerOpen] = useState(false);

Expand All @@ -21,6 +29,10 @@ function Navbar({ children, title }: { children?: React.ReactNode; title?: strin
<span>{title ?? 'Frontend Mini Challenges'}</span>
</a>

<div className={styles.logo}>
<span>{subheading ?? 'Frontend Mini Challenges'}</span>
</div>

<div className={styles.right}>
<div className={styles.links}>{children}</div>

Expand Down
2 changes: 1 addition & 1 deletion apps/host/src/pages/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Link } from 'react-router-dom';
function HomePage() {
return (
<>
<Navbar>
<Navbar subheading="">
<HashLink to="#whyUs">Why us?</HashLink>
<HashLink to="#testimonials">Testimonials</HashLink>
<HashLink to="#contributors">Contributors</HashLink>
Expand Down
2 changes: 1 addition & 1 deletion apps/host/src/pages/leaderboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Navbar from '@/components/common/navbar/navbar';
function LeaderboardPage() {
return (
<>
<Navbar title="Leaderboard" />
<Navbar title="Frontend Mini Challenges" subheading="Leaderboard" />
<Leaderboard />
</>
);
Expand Down

0 comments on commit 5cbba92

Please sign in to comment.