diff --git a/NextJS/129_layouts_in_next.js/.eslintrc.json b/NextJS/129_layouts_in_next.js/.eslintrc.json new file mode 100644 index 0000000..bffb357 --- /dev/null +++ b/NextJS/129_layouts_in_next.js/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/NextJS/129_layouts_in_next.js/.gitignore b/NextJS/129_layouts_in_next.js/.gitignore new file mode 100644 index 0000000..fd3dbb5 --- /dev/null +++ b/NextJS/129_layouts_in_next.js/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/NextJS/129_layouts_in_next.js/README.md b/NextJS/129_layouts_in_next.js/README.md new file mode 100644 index 0000000..0dc9ea2 --- /dev/null +++ b/NextJS/129_layouts_in_next.js/README.md @@ -0,0 +1,36 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/NextJS/129_layouts_in_next.js/app/(admin)/admincomments/page.js b/NextJS/129_layouts_in_next.js/app/(admin)/admincomments/page.js new file mode 100644 index 0000000..9770db4 --- /dev/null +++ b/NextJS/129_layouts_in_next.js/app/(admin)/admincomments/page.js @@ -0,0 +1,9 @@ +import React from 'react' + +const Comment = () => { + return ( +
Comments
+ ) +} + +export default Comment \ No newline at end of file diff --git a/NextJS/129_layouts_in_next.js/app/(admin)/adminlogin/page.js b/NextJS/129_layouts_in_next.js/app/(admin)/adminlogin/page.js new file mode 100644 index 0000000..cd64463 --- /dev/null +++ b/NextJS/129_layouts_in_next.js/app/(admin)/adminlogin/page.js @@ -0,0 +1,20 @@ +import React from 'react' + +const page = () => { + return ( + +
+ Admin Login +

Feel free to login as an Admin

+
+ ) +} + +export default page + +// Dynamic metadata +export async function generateMetadata({ params }) { + return { + title: 'Admin Login', + } +} \ No newline at end of file diff --git a/NextJS/129_layouts_in_next.js/app/(admin)/adminlogout/layout.js b/NextJS/129_layouts_in_next.js/app/(admin)/adminlogout/layout.js new file mode 100644 index 0000000..eccefdb --- /dev/null +++ b/NextJS/129_layouts_in_next.js/app/(admin)/adminlogout/layout.js @@ -0,0 +1,19 @@ +import { Inter } from "next/font/google"; + +import Navbar from "@/components/Navbar"; +import Footer from "@/components/Footer"; +const inter = Inter({ subsets: ["latin"] }); + +export const metadata = { + title: "Admin Facebook - Connect With World", + description: "Admin Page Facebook - connect with friends and world around you", +}; + +export default function AdminLayout({ children }) { + return ( + <> + Logout Navbar + {children} + + ); +} diff --git a/NextJS/129_layouts_in_next.js/app/(admin)/adminlogout/page.js b/NextJS/129_layouts_in_next.js/app/(admin)/adminlogout/page.js new file mode 100644 index 0000000..e8db2fc --- /dev/null +++ b/NextJS/129_layouts_in_next.js/app/(admin)/adminlogout/page.js @@ -0,0 +1,9 @@ +import React from 'react' + +const Logout = () => { + return ( +
Logout
+ ) +} + +export default Logout \ No newline at end of file diff --git a/NextJS/129_layouts_in_next.js/app/(admin)/layout.js b/NextJS/129_layouts_in_next.js/app/(admin)/layout.js new file mode 100644 index 0000000..2a60efe --- /dev/null +++ b/NextJS/129_layouts_in_next.js/app/(admin)/layout.js @@ -0,0 +1,19 @@ +import { Inter } from "next/font/google"; + +import Navbar from "@/components/Navbar"; +import Footer from "@/components/Footer"; +const inter = Inter({ subsets: ["latin"] }); + +export const metadata = { + title: "Admin Facebook - Connect With World", + description: "Admin Page Facebook - connect with friends and world around you", +}; + +export default function AdminLayout({ children }) { + return ( + <> + Admin Navbar + {children} + + ); +} diff --git a/NextJS/129_layouts_in_next.js/app/about/page.js b/NextJS/129_layouts_in_next.js/app/about/page.js new file mode 100644 index 0000000..4c72e0d --- /dev/null +++ b/NextJS/129_layouts_in_next.js/app/about/page.js @@ -0,0 +1,9 @@ +import React from 'react' + +const page = () => { + return ( +
Facebook is Lorem ipsum dolor, sit amet consectetur adipisicing elit. Labore maxime aut quod soluta!
+ ) +} + +export default page \ No newline at end of file diff --git a/NextJS/129_layouts_in_next.js/app/favicon.ico b/NextJS/129_layouts_in_next.js/app/favicon.ico new file mode 100644 index 0000000..718d6fe Binary files /dev/null and b/NextJS/129_layouts_in_next.js/app/favicon.ico differ diff --git a/NextJS/129_layouts_in_next.js/app/globals.css b/NextJS/129_layouts_in_next.js/app/globals.css new file mode 100644 index 0000000..875c01e --- /dev/null +++ b/NextJS/129_layouts_in_next.js/app/globals.css @@ -0,0 +1,33 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +:root { + --foreground-rgb: 0, 0, 0; + --background-start-rgb: 214, 219, 220; + --background-end-rgb: 255, 255, 255; +} + +@media (prefers-color-scheme: dark) { + :root { + --foreground-rgb: 255, 255, 255; + --background-start-rgb: 0, 0, 0; + --background-end-rgb: 0, 0, 0; + } +} + +body { + color: rgb(var(--foreground-rgb)); + background: linear-gradient( + to bottom, + transparent, + rgb(var(--background-end-rgb)) + ) + rgb(var(--background-start-rgb)); +} + +@layer utilities { + .text-balance { + text-wrap: balance; + } +} diff --git a/NextJS/129_layouts_in_next.js/app/layout.js b/NextJS/129_layouts_in_next.js/app/layout.js new file mode 100644 index 0000000..76f2ce9 --- /dev/null +++ b/NextJS/129_layouts_in_next.js/app/layout.js @@ -0,0 +1,22 @@ +import { Inter } from "next/font/google"; +import "./globals.css"; +import Navbar from "@/components/Navbar"; +import Footer from "@/components/Footer"; +const inter = Inter({ subsets: ["latin"] }); + +export const metadata = { + title: "Facebook - Connect With World", + description: "Facebook - connect with friends and world around you", +}; + +export default function RootLayout({ children }) { + return ( + + + + {children} +