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

Feature/enhance navbar:Updated Navbar #71

Merged
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
2 changes: 1 addition & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function App() {
<React.Suspense fallback={<Loader/>}>
<Navbar />

<div className="min-h-[80vh]">
<div className="min-h-[80vh] mt-12 pt-12" >
<Routes>
<Route path="/app" element={<Home />} />
<Route path="/app/posts/:id" element={<Post />} />
Expand Down
52 changes: 17 additions & 35 deletions frontend/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,11 @@ const Navbar = () => {
: "block py-2 px-3 rounded md:border-0 md:p-0 text-white md:hover:text-blue-500 hover:bg-gray-700 hover:text-white md:hover:bg-transparent";
};

return (
<nav className="border-gray-200">
return (
<nav className="border-gray-200 bg-gray-800 fixed top-0 left-0 w-full z-10 py-1 bg-gradient-to-r from-pink-900 to-gray-800">
<div className="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
<Link
to="/app"
className="flex items-center space-x-3 rtl:space-x-reverse"
>
{/* <img
src=""
className="h-8"
alt="Logo"
/> */}
<span className="self-center text-2xl font-semibold whitespace-nowrap text-white">
<Link to="/app" className="flex items-center space-x-3 rtl:space-x-reverse">
<span className="self-center text-3xl leading-6 font-semibold whitespace-nowrap text-white font-teko">
Style Share
</span>
</Link>
Expand Down Expand Up @@ -67,58 +59,48 @@ const Navbar = () => {
<div
className={`${
isMenuOpen ? "block" : "hidden"
} w-full md:block md:w-auto transition-all duration-1000 ease-in-out`}
} w-full md:block md:w-auto transition-all duration-300 ease-in-out`}
id="navbar-default"
>
<ul className="font-medium flex flex-col p-4 md:p-0 mt-4 border rounded-lg md:flex-row md:space-x-8 rtl:space-x-reverse md:mt-0 md:border-0 bg-[#000435] border-gray-700">
<li>
<Link
to="/app"
className={getNavLinkClass("/app")}
aria-current="page"
>
<ul className="font-medium flex flex-col p-4 md:p-0 mt-4 border rounded-lg md:flex-row md:space-x-8 rtl:space-x-reverse md:mt-0 md:border-0">
<li className="mt-2 md:mb-0">
<Link to="/app" className={getNavLinkClass("/app")} aria-current="page">
Home
</Link>
</li>
<li>
<li className="mt-2">
<Link to="/app/posts" className={getNavLinkClass("/app/posts")}>
Posts
</Link>
</li>
{!isLoggedIn ? (
<>
<li>
<div className="flex flex-col md:flex-row md:space-x-4">
<li className="mb-2 md:mb-0">
<Link
to="/app/signin"
className={getNavLinkClass("/app/signin")}
className="block py-2 px-3 rounded-full text-white bg-gradient-to-l from-blue-400 to-pink-500 hover:from-pink-500 hover:to-blue-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-pink-500"
>
Sign in
</Link>
</li>
<li>
<Link
to="/app/signup"
className={getNavLinkClass("/app/signup")}
className="block py-2 px-3 rounded-full text-white bg-gradient-to-l from-blue-400 to-pink-500 hover:from-pink-500 hover:to-blue-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-pink-500"
>
Sign up
</Link>
</li>
</>
</div>
) : (
<>
<li>
<Link
to="/app/new-post"
className={getNavLinkClass("/app/new-post")}
>
<Link to="/app/new-post" className={getNavLinkClass("/app/new-post")}>
New Post
</Link>
</li>
<li>
<Link
to="/app/profile"
className={getNavLinkClass("/app/profile")}
>
<Link to="/app/profile" className={getNavLinkClass("/app/profile")}>
Profile
</Link>
</li>
Expand All @@ -139,4 +121,4 @@ const Navbar = () => {
);
};

export default Navbar;
export default Navbar;
1 change: 1 addition & 0 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import url('https://fonts.googleapis.com/css2?family=Sevillana&family=Seymour+One&family=Teko:[email protected]&display=swap');
@tailwind base;
@tailwind components;
@tailwind utilities;
Expand Down
14 changes: 7 additions & 7 deletions frontend/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
extend: {
fontFamily: {
teko: ["Teko", "sans-serif"],
},
},
},
plugins: [],
}

};