Skip to content

Commit

Permalink
Merge pull request #33 from fac30:header_2
Browse files Browse the repository at this point in the history
Header 2
  • Loading branch information
JasonWarrenUK authored Oct 1, 2024
2 parents 25fbd30 + adac4b7 commit ebe916e
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 39 deletions.
75 changes: 71 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
"preview": "vite preview"
},
"dependencies": {
"@types/react-router-dom": "^5.3.3",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"react-dom": "^18.3.1",
"react-router-dom": "^6.26.2"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
Expand Down
9 changes: 4 additions & 5 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export default {
content: ['./src/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {},
plugins: {
tailwindcss: {},
autoprefixer: {},
},
plugins: [],
};
};
10 changes: 7 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import './App.css'
import Header from './sections/Header'
import Content from './sections/Content'
import './App.css';
import Header from './sections/Header';
import Content from './sections/Content';
import Footer from './sections/Footer';
import Button from './buttons/Button';

function App() {
return (
<>
<Header />
<Content />
<Button onClick={function (): void {
throw new Error('Function not implemented.')
} } label={'Click me'} />
<Footer />
</>
);
Expand Down
5 changes: 4 additions & 1 deletion src/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
Expand Down
68 changes: 49 additions & 19 deletions src/sections/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,56 @@
import React from "react";
import React, { useState} from "react";
import {Link} from 'react-router-dom';


// declare the component with a capitalised name
const Header: React.FC = () => {
return (
<>
<header>
<img
src="../assets/logo_backgrounf.png"
width="60"
height="60"
alt="logo of the app"
/>
<span>
<h1>MoodTime</h1>
</span>
<nav>
{/* Hamburger Menu Here? */}
</nav>
</header>
<hr/>
</>
const [menuOpen, setMenuOpen] = useState(false);


return (
<header className="bg-[#929cf8] text-black p-4">
<div className="container mx-auto flex justify-between items-center">
{/* Left side: Logo and Brand Name */}
<div className="flex items-center space-x-3">
<img
src="../assets/logo_background.png" // Replace this with the actual path to your logo
alt="Brand Logo"
className="h-8 w-8"
/>
<span className="text-xl font-bold">SpotifyMoodList</span>
</div>
</div>

{/* Right side: Menu with three dots */}
<nav>
<div className="relative">
<button
className="text-3xl focus:outline-none"
onClick={() => setMenuOpen(!menuOpen)}
>
&#x22EE; {/* Unicode for vertical ellipsis */}
</button>

{/* Dropdown Menu */}
{menuOpen && (
<div className="absolute right-0 mt-2 w-48 bg-white text-gray-900 rounded-md shadow-lg">
<ul className="py-1">
<li>
<Link
to="/option"
className="block px-4 py-2 text-sm hover:bg-gray-100"
onClick={() => setMenuOpen(false)}
>
Go Again
</Link>
</li>
</ul>
</div>
)}
</div>
</nav>
</header>

)
}

Expand Down
4 changes: 0 additions & 4 deletions src/styles.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom styles go here if needed */

/* Colours for the app: */
Expand Down
6 changes: 4 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [],
content: [
"./src/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
};

0 comments on commit ebe916e

Please sign in to comment.