From c0d1a68123f348a466cb21e144666b1bd265f1e3 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sat, 19 Mar 2022 00:52:51 +0600 Subject: [PATCH] Create Experience component --- src/components/experience/index.jsx | 94 +++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 src/components/experience/index.jsx diff --git a/src/components/experience/index.jsx b/src/components/experience/index.jsx new file mode 100644 index 0000000..9b40896 --- /dev/null +++ b/src/components/experience/index.jsx @@ -0,0 +1,94 @@ +import { GoPrimitiveDot } from 'react-icons/go'; +import { useContext } from 'react'; +import { LoadingContext } from '../../contexts/LoadingContext'; +import { skeleton } from '../../helpers/utils'; +import config from '../../ezprofile.config'; + +const Experience = () => { + const [loading] = useContext(LoadingContext); + + const renderSkeleton = () => { + let array = []; + for (let index = 0; index < 2; index++) { + array.push( +
  • + + {skeleton({ width: 'w-2', height: 'h-2', className: 'mr-2' })} +
    +
    +
    + {skeleton({ + width: 'w-9/12', + height: 'h-4', + className: 'mb-2', + })} +
    +
    + {skeleton({ + width: 'w-6/12', + height: 'h-4', + className: 'mb-2', + })} +
    +
    +
    {skeleton({ width: 'w-6/12', height: 'h-3' })}
    +
    +
    +
  • + ); + } + + return array; + }; + + return ( + <> + {typeof config.experiences !== 'undefined' && + config.experiences.length !== 0 && ( +
    +
    +
      +
    • +
      +
      + {loading ? ( + skeleton({ width: 'w-32', height: 'h-8' }) + ) : ( + Experience + )} +
      +
      +
    • + {loading + ? renderSkeleton() + : config.experiences.map((experience, index) => ( +
    • + +
      + +
      +
      +
      +
      + {experience.company} +
      +
      + {experience.from} - {experience.to} +
      +
      +
      + {experience.position} +
      +
      +
      +
    • + ))} +
    +
    +
    + )} + + ); +}; + +export default Experience;