diff --git a/src/components/details/index.jsx b/src/components/details/index.jsx index d672cbd..5f6554d 100644 --- a/src/components/details/index.jsx +++ b/src/components/details/index.jsx @@ -4,6 +4,7 @@ import { SiTwitter } from 'react-icons/si'; import { GrLinkedinOption } from 'react-icons/gr'; import { CgDribbble } from 'react-icons/cg'; import { RiPhoneFill } from 'react-icons/ri'; +import { Fragment } from 'react'; import { FaBehanceSquare, FaBuilding, @@ -15,15 +16,15 @@ import PropTypes from 'prop-types'; import { skeleton } from '../../helpers/utils'; import config from '../../ezprofile.config'; -const ListItem = ({ icon, title, value, link }) => { +const ListItem = ({ icon, title, value, link, skeleton = false }) => { return (
{icon} -
{title}:
+
{title}
{ let array = []; for (let index = 0; index < 4; index++) { array.push( -
  • - - {skeleton({ width: 'w-6', height: 'h-4', className: 'mr-2' })} - {skeleton({ width: 'w-32', height: 'h-4' })} - -
  • + ); } @@ -60,122 +61,124 @@ const Details = ({ profile, loading }) => { return (
    - {loading || !profile ? ( - renderSkeleton() - ) : ( -
    - {profile.location && ( +
    + {loading || !profile ? ( + renderSkeleton() + ) : ( + + {profile.location && ( + } + title="Based on:" + value={profile.location} + /> + )} + {profile.company && ( + } + title="Company:" + value={profile.company} + /> + )} } - title="Based on" - value={profile.location} + icon={} + title="GitHub:" + value={config.github.username} + link={`https://github.com/${config.github.username}`} /> - )} - {profile.company && ( - } - title="Company" - value={profile.company} - /> - )} - } - title="GitHub" - value={config.github.username} - link={`https://github.com/${config.github.username}`} - /> - {typeof config.social.twitter !== 'undefined' && - config.social.twitter && ( - } - title="Twitter" - value={config.social.twitter} - link={`https://twitter.com/${config.social.twitter}`} - /> - )} - {typeof config.social.linkedin !== 'undefined' && - config.social.linkedin && ( - } - title="LinkedIn" - value={config.social.linkedin} - link={`https://www.linkedin.com/in/${config.social.linkedin}`} - /> - )} - {typeof config.social.dribbble !== 'undefined' && - config.social.dribbble && ( - } - title="Dribbble" - value={config.social.dribbble} - link={`https://dribbble.com/${config.social.dribbble}`} - /> - )} - {typeof config.social.behance !== 'undefined' && - config.social.behance && ( - } - title="Behance" - value={config.social.behance} - link={`https://www.behance.net/${config.social.behance}`} - /> - )} - {typeof config.social.facebook !== 'undefined' && - config.social.facebook && ( - } - title="Facebook" - value={config.social.facebook} - link={`https://www.facebook.com/${config.social.facebook}`} - /> - )} - {typeof config.social.medium !== 'undefined' && - config.social.medium && ( - } - title="Medium" - value={config.social.medium} - link={`https://medium.com/@${config.social.medium}`} - /> - )} - {typeof config.social.devto !== 'undefined' && - config.social.devto && ( - } - title="Dev" - value={config.social.devto} - link={`https://dev.to/${config.social.devto}`} - /> - )} - {typeof config.social.website !== 'undefined' && - config.social.website && ( - } - title="Website" - value={config.social.website} - link={config.social.website} - /> - )} - {typeof config.social.phone !== 'undefined' && - config.social.phone && ( - } - title="Phone" - value={config.social.phone} - link={`tel:${config.social.phone}`} - /> - )} - {typeof config.social.email !== 'undefined' && - config.social.email && ( - } - title="Email" - value={config.social.email} - link={`mailto:${config.social.email}`} - /> - )} -
    - )} + {typeof config.social.twitter !== 'undefined' && + config.social.twitter && ( + } + title="Twitter:" + value={config.social.twitter} + link={`https://twitter.com/${config.social.twitter}`} + /> + )} + {typeof config.social.linkedin !== 'undefined' && + config.social.linkedin && ( + } + title="LinkedIn:" + value={config.social.linkedin} + link={`https://www.linkedin.com/in/${config.social.linkedin}`} + /> + )} + {typeof config.social.dribbble !== 'undefined' && + config.social.dribbble && ( + } + title="Dribbble:" + value={config.social.dribbble} + link={`https://dribbble.com/${config.social.dribbble}`} + /> + )} + {typeof config.social.behance !== 'undefined' && + config.social.behance && ( + } + title="Behance:" + value={config.social.behance} + link={`https://www.behance.net/${config.social.behance}`} + /> + )} + {typeof config.social.facebook !== 'undefined' && + config.social.facebook && ( + } + title="Facebook:" + value={config.social.facebook} + link={`https://www.facebook.com/${config.social.facebook}`} + /> + )} + {typeof config.social.medium !== 'undefined' && + config.social.medium && ( + } + title="Medium:" + value={config.social.medium} + link={`https://medium.com/@${config.social.medium}`} + /> + )} + {typeof config.social.devto !== 'undefined' && + config.social.devto && ( + } + title="Dev:" + value={config.social.devto} + link={`https://dev.to/${config.social.devto}`} + /> + )} + {typeof config.social.website !== 'undefined' && + config.social.website && ( + } + title="Website:" + value={config.social.website} + link={config.social.website} + /> + )} + {typeof config.social.phone !== 'undefined' && + config.social.phone && ( + } + title="Phone:" + value={config.social.phone} + link={`tel:${config.social.phone}`} + /> + )} + {typeof config.social.email !== 'undefined' && + config.social.email && ( + } + title="Email:" + value={config.social.email} + link={`mailto:${config.social.email}`} + /> + )} + + )} +
    );