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

basic pages and styles #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions src/app/(auth)/forgot-password/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const ForgotPassword = () => {
return <div>Forgot Password Page</div>
};

export default ForgotPassword;
5 changes: 5 additions & 0 deletions src/app/(auth)/login/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Login = () => {
return <div>Login Page</div>
};

export default Login;
5 changes: 5 additions & 0 deletions src/app/(auth)/register/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Register = () => {
return <div>Register Page</div>
};

export default Register;
5 changes: 5 additions & 0 deletions src/app/about/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const About = () => {
return <div>About Page</div>
};

export default About;
5 changes: 5 additions & 0 deletions src/app/admin/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Admin = () => {
return <div>Admin Page</div>
};

export default Admin;
5 changes: 5 additions & 0 deletions src/app/blog/[slug]/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const SinglePost = () => {
return <div>Single Post Page</div>
};

export default SinglePost;
5 changes: 5 additions & 0 deletions src/app/blog/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Blog = () => {
return <div>Blog Page</div>
};

export default Blog;
5 changes: 5 additions & 0 deletions src/app/contact/page.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Contact = () => {
return <div>Contact Page</div>
};

export default Contact;
8 changes: 8 additions & 0 deletions src/app/error.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"use client"
const Error = () => {
return (
<div>Error</div>
)
}

export default Error
7 changes: 7 additions & 0 deletions src/app/loading.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Loading = () => {
return (
<div>Loading...</div>
)
}

export default Loading
13 changes: 13 additions & 0 deletions src/app/not-found.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Link from "next/link"

const NotFound = () => {
return (
<div>
<h2>Not Found</h2>
<p>This page could not be found</p>
<Link href='/'>Go Home</Link>
</div>
)
}

export default NotFound
7 changes: 7 additions & 0 deletions src/components/footer/Footer.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const Footer = () => {
return (
<h2>Footer</h2>
)
}

export default Footer
15 changes: 15 additions & 0 deletions src/components/navbar/Navbar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Links from "./links/Links"
import styles from "./navbar.module.css"

const Navbar = () => {
return (
<div className={styles.container}>
<div className={styles.logo}>Logo</div>
<div>
<Links/>
</div>
</div>
)
}

export default Navbar
32 changes: 32 additions & 0 deletions src/components/navbar/links/Links.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import styles from "./links.module.css";
import NavLink from "./navLink/NavLink";

const Links = () => {
const links = [
{ id: 1, title: "Home", url: "/" },
{ id: 2, title: "About", url: "/about" },
{ id: 3, title: "Blog", url: "/blog" },
{ id: 4, title: "Contact", url: "/contact" },
];

const session = true;
const isAdmin = true;

return (
<div className={styles.links}>
{links.map((link) => (
<NavLink item={link} key={link.id} />
))}
{session ? (
<>
{isAdmin && <NavLink item={{ title: "Admin", url: "/admin" }} />}
<button className={styles.logout}>Logout</button>
</>
) : (
<NavLink item={{ title: "Login", url: "/login" }} />
)}
</div>
);
};

export default Links;
10 changes: 10 additions & 0 deletions src/components/navbar/links/links.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.links {
display: flex;
align-items: center;
gap: 20px;
}
.logout {
padding: 10px;
cursor: pointer;
font-weight: bold;
}
12 changes: 12 additions & 0 deletions src/components/navbar/links/navLink/navLink.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"use client"

import Link from "next/link";
import { usePathname } from "next/navigation";
import styles from "./navLink.module.css";

const NavLink = ({ item }) => {
const pathName = usePathname();
return <Link href={item.url} className={`${styles.container} ${pathName === item.url && styles.active}`}>{item.title}</Link>;
};

export default NavLink;
14 changes: 14 additions & 0 deletions src/components/navbar/links/navLink/navLink.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.container {
min-width: 100px;
padding: 10px;
border-radius: 20px;
font-weight: 500;
cursor: pointer;
transition: 0.3s;
text-align: center;
}

.active {
background-color: var(--text);
color: var(--bg);
}
11 changes: 11 additions & 0 deletions src/components/navbar/navbar.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.container {
height: 100px;
display: flex;
justify-content: space-between;
align-items: center;
}

.logo {
font-size: 30px;
font-weight: bold;
}