Skip to content

Commit

Permalink
feat: add a basic header
Browse files Browse the repository at this point in the history
Resolves #74
  • Loading branch information
jkellerer authored and JonasKellerer committed Nov 22, 2024
1 parent f0d3422 commit 13f31c4
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 12 deletions.
2 changes: 1 addition & 1 deletion website/cypress/e2e/app.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe('Navigation', () => {
it('should navigate to the survey page', () => {
cy.visit('http://localhost:3000');

cy.get('a[href*="survey"]').click();
cy.get('a[href*="survey"]').first().click();

cy.url().should('include', '/survey');

Expand Down
Empty file added website/public/empty
Empty file.
6 changes: 0 additions & 6 deletions website/public/next.svg

This file was deleted.

4 changes: 0 additions & 4 deletions website/public/vercel.svg

This file was deleted.

6 changes: 5 additions & 1 deletion website/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import './globals.css';
import { Header } from '@/components/layout/Header';

const inter = Inter({ subsets: ['latin'] });

Expand All @@ -12,7 +13,10 @@ export const metadata: Metadata = {
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang='en'>
<body className={inter.className}>{children}</body>
<body className={inter.className}>
<Header />
{children}
</body>
</html>
);
}
44 changes: 44 additions & 0 deletions website/src/components/layout/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import Link from 'next/link';

export function Header() {
return (
<header className={'sticky'}>
<div className='mb-2 flex items-center justify-between border-b p-2 px-8'>
<Logo />
<Navigation />
<CallToAction />
</div>
</header>
);
}

function Logo() {
return (
<Link href='/' className='text-lg font-bold'>
Varilis
</Link>
);
}

function Navigation() {
return (
<nav className='flex items-center justify-between p-4'>
<ul className='flex space-x-4'>
<li>
<Link href='/'>Home</Link>
</li>
<li>
<Link href='/survey'>Survey</Link>
</li>
</ul>
</nav>
);
}

function CallToAction() {
return (
<div className='flex items-center justify-center'>
<Link href='/survey'>Take the survey</Link>
</div>
);
}

0 comments on commit 13f31c4

Please sign in to comment.