Skip to content

Commit

Permalink
Merge pull request #33 from hack4impact-calpoly/27-customize-navbar
Browse files Browse the repository at this point in the history
27 customize navbar
  • Loading branch information
ryanchansf authored Feb 11, 2024
2 parents d1580f8 + d1812af commit 4b04e36
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 9 deletions.
124 changes: 121 additions & 3 deletions frontend/package-lock.json

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

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"lucide-react": "^0.314.0",
"mongoose": "^7.6.3",
"next": "^14.1.0",
"next-auth": "^4.24.5",
"react": "^18",
"react-dom": "^18",
"tailwind-merge": "^2.2.0",
Expand Down
31 changes: 28 additions & 3 deletions frontend/src/components/navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
"use client";
import React from "react";
import Link from "next/link";
import { signOut } from "next-auth/react";
// import { signOut, useSession } from "next-auth/react";
import { useState } from "react";
import "@/styles/globals.css";

export default function Navbar() {
// const { data: session } = useSession();
const [user, setUser] = useState("Karen");

const handleSignOut = async () => {
await signOut();
};

// const user = session?.user?.name || "Karen";
return (
<div className="bg-secondary p-4">
<div className="container flex justify-between items-center">
<div className="font-semibold">
<Link href="/">Ecologistics Web Scraper</Link>
<div>
<Link href="/" className="flex items-left">
<div className="font-bold">ECOLO</div>
<div className="text-primary">GISTICS Web Scraper</div>
</Link>
</div>
<div className="text-center text-primary">
<h3>Welcome {user}</h3>
</div>
<ul>
<li>
<li className="flex space-x-4">
<Link href="/">Home</Link>
<button onClick={handleSignOut}>Logout</button>
{/* {session ? (
<button onClick={handleSignOut}>Logout</button>
) : (
<Link href="/login">Login</Link>
)} */}
</li>
</ul>
</div>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/styles/globals.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";

@layer base {
:root {
Expand Down

0 comments on commit 4b04e36

Please sign in to comment.