Skip to content

Commit

Permalink
rename footer to navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
AmiltonCabral committed Aug 14, 2024
1 parent 89a9d16 commit a577a9b
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 93 deletions.
45 changes: 3 additions & 42 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro",
"Fira Mono", "Droid Sans Mono", "Courier New", monospace;

--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
--background-primary: #ffffee;
--background-secondary: #ffffff;
--background-tertiary: #e7e7e7;

--primary-glow: conic-gradient(
from 180deg at 50% 50%,
Expand Down Expand Up @@ -40,39 +40,6 @@
--card-border-rgb: 131, 134, 135;
}

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;

--primary-glow: radial-gradient(rgba(1, 65, 255, 0.4), rgba(1, 65, 255, 0));
--secondary-glow: linear-gradient(
to bottom right,
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0),
rgba(1, 65, 255, 0.3)
);

--tile-start-rgb: 2, 13, 46;
--tile-end-rgb: 2, 5, 19;
--tile-border: conic-gradient(
#ffffff80,
#ffffff40,
#ffffff30,
#ffffff20,
#ffffff10,
#ffffff10,
#ffffff80
);

--callout-rgb: 20, 20, 20;
--callout-border-rgb: 108, 108, 108;
--card-rgb: 100, 100, 100;
--card-border-rgb: 200, 200, 200;
}
}

* {
box-sizing: border-box;
padding: 0;
Expand All @@ -99,9 +66,3 @@ a {
color: inherit;
text-decoration: none;
}

@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
}
4 changes: 2 additions & 2 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import Footer from "@/components/Footer";
import Navbar from "@/components/Navbar";

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

Expand All @@ -19,7 +19,7 @@ export default function RootLayout({
<html lang="en">
<body className={inter.className}>
{children}
<Footer />
<Navbar />
</body>
</html>
);
Expand Down
12 changes: 1 addition & 11 deletions src/app/page.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
align-items: flex-end;
pointer-events: none;
inset: auto 0 0;
padding: 2rem;
margin-bottom: 4rem;
height: 200px;
background: linear-gradient(
to bottom,
Expand All @@ -210,16 +210,6 @@
}
}

@media (prefers-color-scheme: dark) {
.vercelLogo {
filter: invert(1);
}

.logo {
filter: invert(1) drop-shadow(0 0 0.3rem #ffffff70);
}
}

@keyframes rotate {
from {
transform: rotate(360deg);
Expand Down
1 change: 0 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function Home() {
<Image
src="/vercel.svg"
alt="Vercel Logo"
className={styles.vercelLogo}
width={100}
height={24}
priority
Expand Down
37 changes: 0 additions & 37 deletions src/components/Footer/index.tsx

This file was deleted.

38 changes: 38 additions & 0 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"use client";

import React from "react";
import Link from "next/link";
import { FaHome, FaBook, FaPlus, FaSearch, FaUser } from "react-icons/fa";
import { usePathname } from "next/navigation";

import styles from "./navbar.module.css";

export default function Navbar() {
const pathname = usePathname();

return (
<nav className={styles.navbar}>
<Link href="/" className={pathname === "/" ? styles.active : undefined}>
<FaHome className={styles.icon} />
</Link>
<Link href="/books">
<FaBook className={styles.icon} />
</Link>
<Link href="/add-book">
<FaPlus className={styles.icon} />
</Link>
<Link
href="/search"
className={pathname === "/search" ? styles.active : undefined}
>
<FaSearch className={styles.icon} />
</Link>
<Link
href="/profile"
className={pathname === "/profile" ? styles.active : undefined}
>
<FaUser className={styles.icon} />
</Link>
</nav>
);
}
30 changes: 30 additions & 0 deletions src/components/Navbar/navbar.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.navbar {
display: flex;
justify-content: space-around;
align-items: center;
background-color: var(--background-secondary);
position: fixed;
bottom: 0;
width: 100%;
border-top: 1px solid var(--background-tertiary);
}

.navbar a {
padding: 20px 0;
width: 20%;
display: flex;
justify-content: center;
}

.navbar a:hover {
background-color: var(--background-tertiary);
}

.icon {
color: #ffdd4b;
font-size: 24px;
}

.active {
background-color: var(--background-tertiary);
}

1 comment on commit a577a9b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for bookhive-web ready!

✅ Preview
https://bookhive-q6o94pea9-amiltoncabrals-projects.vercel.app

Built with commit a577a9b.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.