From 242b9100675cb441ebd10cf39ca821f41b739b94 Mon Sep 17 00:00:00 2001 From: ayan4m1 Date: Sun, 19 Jan 2025 16:40:15 -0500 Subject: [PATCH] feat: rework index header layout and styling --- src/components/bodyCard.js | 25 +++++++++++++++++++++++++ src/pages/index.js | 29 ++++++++++++++++++----------- {src/images => static}/profile.jpg | Bin 3 files changed, 43 insertions(+), 11 deletions(-) create mode 100644 src/components/bodyCard.js rename {src/images => static}/profile.jpg (100%) diff --git a/src/components/bodyCard.js b/src/components/bodyCard.js new file mode 100644 index 0000000..8c6952e --- /dev/null +++ b/src/components/bodyCard.js @@ -0,0 +1,25 @@ +import classNames from 'classnames'; +import PropTypes from 'prop-types'; +import { Card } from 'react-bootstrap'; + +import { useThemeContext } from 'hooks/useThemeContext'; + +export default function BodyCard({ children, ...props }) { + const { darkMode } = useThemeContext(); + + const className = classNames( + props?.className, + `text-${darkMode ? 'light' : 'dark'}` + ); + + return ( + + {children} + + ); +} + +BodyCard.propTypes = { + children: PropTypes.node.isRequired, + className: PropTypes.string +}; diff --git a/src/pages/index.js b/src/pages/index.js index 7b104dd..aa112c2 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -20,10 +20,9 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faGithub, faLinkedin } from '@fortawesome/free-brands-svg-icons'; import Layout from 'components/layout'; +import BodyCard from 'components/bodyCard'; import FeaturedPost from 'components/featuredPost'; -import profilePic from 'images/profile.jpg'; - export default function IndexPage({ data }) { const { articles: { nodes: articles }, @@ -41,19 +40,26 @@ export default function IndexPage({ data }) { return ( - + - + My face @@ -63,10 +69,11 @@ export default function IndexPage({ data }) { - +