From 4f442c369bc7598fdc32d267b382b8dcd5e21d98 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Sun, 9 Nov 2025 00:00:55 +0530 Subject: [PATCH] feat(ui): make footer always visible on home and hidden in article view --- src/blog/Blog.tsx | 92 +++++++++---- src/blog/components/Footer.tsx | 202 +--------------------------- src/blog/components/MainContent.tsx | 1 - 3 files changed, 74 insertions(+), 221 deletions(-) diff --git a/src/blog/Blog.tsx b/src/blog/Blog.tsx index 1d334dd..7bd502b 100644 --- a/src/blog/Blog.tsx +++ b/src/blog/Blog.tsx @@ -1,15 +1,16 @@ import * as React from 'react'; import CssBaseline from '@mui/material/CssBaseline'; import Container from '@mui/material/Container'; +import Box from '@mui/material/Box'; import AppTheme from '../shared-theme/AppTheme'; import MainContent from './components/MainContent'; import Article from './components/Article'; import Latest from './components/Latest'; import Footer from './components/Footer'; -import { useArticles } from './providers/Article'; // ✅ custom hook for global articles +import { useArticles } from './providers/Article'; export default function Blog(props: { disableCustomTheme?: boolean }) { - const { articles, loading, error } = useArticles(); // ✅ Hook must be inside component + const { articles, loading, error } = useArticles(); const [selectedArticle, setSelectedArticle] = React.useState(null); const handleSelectArticle = (index: number) => { @@ -26,7 +27,12 @@ export default function Blog(props: { disableCustomTheme?: boolean }) { Loading articles... @@ -41,7 +47,12 @@ export default function Blog(props: { disableCustomTheme?: boolean }) { Failed to load articles: {error} @@ -53,28 +64,61 @@ export default function Blog(props: { disableCustomTheme?: boolean }) { - - {selectedArticle === null ? ( - <> - - { - // Optional: fetch more from API (if you want true pagination) - // await fetchMoreArticles(offset, limit); - }} - /> - - ) : ( -
+ + {selectedArticle === null ? ( + <> + + { + // Optional pagination call + }} + /> + + ) : ( +
+ )} + + + {selectedArticle === null && ( + +