From 4aee08d1bd4fc3d89b9b0d584ff85fa2387ff8fa Mon Sep 17 00:00:00 2001 From: Barunes Padhy Date: Sun, 5 May 2024 19:43:39 +0300 Subject: [PATCH] CSS fixes in the frontend --- frontend/public/data/shared/theme-config.json | 1 + frontend/src/App.jsx | 27 +++++++++++-------- frontend/src/components/blog-list.jsx | 4 +-- frontend/src/components/blog.jsx | 7 ++--- frontend/src/components/category-list.jsx | 4 +-- frontend/src/components/home.jsx | 6 +++-- frontend/src/components/shared/footer.jsx | 2 +- frontend/src/components/shared/navbar.jsx | 6 ++++- frontend/src/index.css | 6 +++-- 9 files changed, 39 insertions(+), 24 deletions(-) diff --git a/frontend/public/data/shared/theme-config.json b/frontend/public/data/shared/theme-config.json index 5005f9e..11f01ad 100644 --- a/frontend/public/data/shared/theme-config.json +++ b/frontend/public/data/shared/theme-config.json @@ -1,4 +1,5 @@ { + "defaultTheme": "darkTheme", "darkTheme": { "theme": "Dark Mode", "background": "bg-dark", diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 16a2e1f..47cb752 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -37,8 +37,10 @@ function App() { DataService.getData('shared/user-data').then( response => setUserData(response.data) ) - DataService.getData('shared/theme-config').then( response => - setThemeConfig(response.data) + DataService.getData('shared/theme-config').then( response =>{ + setThemeConfig(response.data) + setGlobalTheme(response.data.defaultTheme) + } ) },[]) @@ -46,18 +48,21 @@ function App() { setGlobalTheme(theme); } + if (themeConfig) return ( -
+
-
+
- - } /> - } /> - } /> - } /> - -
+
+ + } /> + } /> + } /> + } /> + +
+
); diff --git a/frontend/src/components/blog-list.jsx b/frontend/src/components/blog-list.jsx index 130f499..eea49af 100644 --- a/frontend/src/components/blog-list.jsx +++ b/frontend/src/components/blog-list.jsx @@ -45,10 +45,10 @@ function BlogList(props) { if (GlobalTheme && ThemeConfig) { return ( - + - +
diff --git a/frontend/src/components/blog.jsx b/frontend/src/components/blog.jsx index 8d26087..536c138 100644 --- a/frontend/src/components/blog.jsx +++ b/frontend/src/components/blog.jsx @@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'; import DataService from '../services/data-service'; import MediaService from '../services/media-service' import CategoryBar from './shared/category-bar'; + import { Container,Row, Col,Spinner, UncontrolledCollapse, Button, ButtonGroup, Card, CardBody } from 'reactstrap'; @@ -24,7 +25,7 @@ function Blog(props) { if (GlobalTheme && ThemeConfig) { return ( - + @@ -37,7 +38,7 @@ function Blog(props) { - = 765 ? '6':''}`}> + = 765 ? '6':''}`}>

{blogData.name}

{blogData.description}

@@ -113,7 +114,7 @@ function Blog(props) { - = 765 ? '6':''}`} style={{marginBottom: '25px'}}> + = 765 ? '6':''}`} style={{marginBottom: '25px'}}>
diff --git a/frontend/src/components/category-list.jsx b/frontend/src/components/category-list.jsx index ff138e9..6d36939 100644 --- a/frontend/src/components/category-list.jsx +++ b/frontend/src/components/category-list.jsx @@ -33,9 +33,9 @@ function Blogs(props) { if (GlobalTheme && ThemeConfig) { return ( - + - + {/* Top Section - Categories */}
diff --git a/frontend/src/components/home.jsx b/frontend/src/components/home.jsx index f9cc6a9..1176d2b 100644 --- a/frontend/src/components/home.jsx +++ b/frontend/src/components/home.jsx @@ -7,7 +7,7 @@ function HomePage(props) { const ThemeConfig = props.ThemeConfig; if (GlobalTheme && ThemeConfig) return ( - +
{UserData.profilePhoto !== "" ? : ""}

@@ -16,7 +16,9 @@ function HomePage(props) {

-
+ <> +
${UserData.tagLine}` }} /> +
diff --git a/frontend/src/components/shared/footer.jsx b/frontend/src/components/shared/footer.jsx index f87acc1..c2bbe13 100644 --- a/frontend/src/components/shared/footer.jsx +++ b/frontend/src/components/shared/footer.jsx @@ -15,7 +15,7 @@ const Footer = (props) => { const UserData = props.UserData; return ( -