From fce65c18e2f04078828440a8472097597ffd4d87 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Sat, 19 Mar 2022 00:52:31 +0600 Subject: [PATCH] Create Education component --- src/components/education/index.jsx | 92 ++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 src/components/education/index.jsx diff --git a/src/components/education/index.jsx b/src/components/education/index.jsx new file mode 100644 index 0000000..74f1cf3 --- /dev/null +++ b/src/components/education/index.jsx @@ -0,0 +1,92 @@ +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 Education = () => { + 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.education !== 'undefined' && + config.education.length !== 0 && ( +
    +
    +
      +
    • +
      +
      + {loading ? ( + skeleton({ width: 'w-32', height: 'h-8' }) + ) : ( + Education + )} +
      +
      +
    • + {loading + ? renderSkeleton() + : config.education.map((item, index) => ( +
    • + +
      + +
      +
      +
      +
      + {item.institution} +
      +
      + {item.from} - {item.to} +
      +
      +
      {item.degree}
      +
      +
      +
    • + ))} +
    +
    +
    + )} + + ); +}; + +export default Education;