From c7ac31bb99f27496f8aac5c1a921f30180d56fac Mon Sep 17 00:00:00 2001 From: Christian Sarnataro Date: Mon, 9 Jan 2023 23:49:52 +0100 Subject: [PATCH] Updated code after code review --- README.md | 54 +++++++-------------------------- gitprofile.config.js | 13 +++++--- src/components/footer/index.jsx | 29 ++++-------------- 3 files changed, 26 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index e87ac48..dc59939 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,6 @@ ✓ [Education Section](#education) ✓ [Projects Section](#projects) ✓ [Blog Posts Section](#blog-posts) -✓ [Custom footer](#custom-footer) To view a live example, **[click here](https://arifszn.github.io/gitprofile)**. @@ -290,6 +289,17 @@ const config = { username: 'arifszn', // to hide blog section, keep it empty limit: 5, // How many posts to display. Max is 10. }, + // Display a footer. Supports plain text or HTML. (Optional) + footer: { + `

+ Made with GitProfile + and ❤️

` + }, googleAnalytics: { id: '', // GA3 tracking id/GA4 tag id UA-XXXXXXXXX-X | G-XXXXXXXXXX }, @@ -618,48 +628,6 @@ const config = { The posts are fetched by [blog.js](https://github.com/arifszn/blog.js). - -### Custom footer (Optional) -In the configuration file you can optionally -define a custom HTML footer for your page. - -If it's not defined, a default footer "Made with GitProfile and ❤️" will be used instead. - -Examples: -```js -// gitprofile.config.js - -// This is an HTML footer -const config = { - [...] - footer: ` -

- Built by - John Doe - - in 2023 - with ❤️ and - GitProfile -

- `, -``` -or: - -```js -// gitprofile.config.js - -// This is a plain text footer -const config = { - [...] - footer: 'Copyright 2002, John Doe' -``` - - ## 💖 Support

You can show your support by starring this project. ★

diff --git a/gitprofile.config.js b/gitprofile.config.js index 895edc0..53d3bbe 100644 --- a/gitprofile.config.js +++ b/gitprofile.config.js @@ -83,10 +83,15 @@ const config = { }, ], - // Optional custom footer. See README file, section "custom-footer", for details - /* - footer: '[...]', - */ + // Optional custom footer + footer: `

+ Made with GitProfile and ❤️ +

`, // To hide the `My Projects` section, keep it empty. externalProjects: [ { diff --git a/src/components/footer/index.jsx b/src/components/footer/index.jsx index 292d0c1..fa4c62c 100644 --- a/src/components/footer/index.jsx +++ b/src/components/footer/index.jsx @@ -2,33 +2,16 @@ import PropTypes from 'prop-types'; import { skeleton } from '../../helpers/utils'; -const DefaultFooter = () => { - return ( - -
-

- Made with GitProfile and ❤️ -

-
-
- ); -}; - const Footer = ({ content, loading }) => { - let footerContent = null; - if (content) { - footerContent =
; - } else { - footerContent = ; - } + if (!content) return null; return (
- {loading ? skeleton({ width: 'w-52', height: 'h-6' }) : footerContent} + {loading ? ( + skeleton({ width: 'w-52', height: 'h-6' }) + ) : ( +
+ )}
); };