mirror of
https://github.com/NohamR/gitprofile.git
synced 2026-05-25 12:27:17 +00:00
Added an option to display a custom footer
Added an option in config file. Added a component which renders the custom footer or a default footer if no custom footer is defined. Updated readme file with related instructions.
This commit is contained in:
41
src/components/footer/index.jsx
Normal file
41
src/components/footer/index.jsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import { skeleton } from '../../helpers/utils';
|
||||
|
||||
const DefaultFooter = () => {
|
||||
return (
|
||||
<a
|
||||
href="https://github.com/arifszn/gitprofile"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
<div>
|
||||
<p className="font-mono text-sm">
|
||||
Made with <span className="text-primary">GitProfile</span> and ❤️
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
);
|
||||
};
|
||||
|
||||
const Footer = ({ content, loading }) => {
|
||||
let footerContent = null;
|
||||
if (content) {
|
||||
footerContent = <div dangerouslySetInnerHTML={{ __html: content }} />;
|
||||
} else {
|
||||
footerContent = <DefaultFooter />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="card-body">
|
||||
{loading ? skeleton({ width: 'w-52', height: 'h-6' }) : footerContent}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Footer.propTypes = {
|
||||
content: PropTypes.string,
|
||||
loading: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
export default Footer;
|
||||
Reference in New Issue
Block a user