Commit 9de61e99 by Vijay G

feat: header update

parent 04ac208e
'use client';
import Header from "@components/base/header";
import { useAppContext } from "@context/index";
export default function PageHeader() {
const { theme, setTheme } = useAppContext();
return(
<Header name="NewsBlog" currentTheme={theme} onThemeChange={setTheme} />
)
}
\ No newline at end of file
import ThemeProvider from "./context"; import ThemeProvider from "@context/index";
import "./globals.css"; import "./globals.css";
export default function RootLayout({ children }) { export default function RootLayout({ children, header }) {
return ( return (
<ThemeProvider> <ThemeProvider>
<html lang="en"> <html lang="en">
<body>{children}</body> {console.log("header", header)}
<body>
{header}
{children}
</body>
</html> </html>
</ThemeProvider> </ThemeProvider>
); );
......
import BlogLists from "@components/top-level/blog-lists"; import BlogLists from "@components/top-level/blog-lists";
import Header from "@components/base/header";
import { getAllPosts } from "@lib/posts"; import { getAllPosts } from "@lib/posts";
import { useAppContext } from "./context";
const Home = () => { const Home = () => {
const { theme, setTheme } = useAppContext();
let blogs; let blogs;
const fetchAllBlogs = () => { const fetchAllBlogs = () => {
...@@ -14,7 +12,6 @@ const Home = () => { ...@@ -14,7 +12,6 @@ const Home = () => {
return ( return (
<div> <div>
<Header name="NewsBlog" currentTheme={theme} onThemeChange={setTheme} />
<BlogLists <BlogLists
title={blogs?.title} title={blogs?.title}
description={blogs?.description} description={blogs?.description}
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"@components/*": ["components/*"], "@components/*": ["components/*"],
"@img/*": ["public/images/*"], "@img/*": ["public/images/*"],
"@posts/*": ["posts/*"], "@posts/*": ["posts/*"],
"@context/*": ["app/context/*"], "@context/*": ["context/*"],
"@lib/*": ["lib/*"] "@lib/*": ["lib/*"]
}, },
"experimentalDecorators": true "experimentalDecorators": true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment