Validate missing prop types

This commit is contained in:
Ariful Alam 2022-03-20 01:36:43 +06:00
parent a2ada305a7
commit ec458191fb
11 changed files with 63 additions and 8 deletions

View File

@ -3,4 +3,4 @@ module.exports = {
tailwindcss: {},
autoprefixer: {},
},
}
};

View File

@ -1,5 +1,5 @@
import PropTypes from 'prop-types';
import { skeleton } from '../../helpers/utils';
import { fallbackImage, skeleton } from '../../helpers/utils';
import LazyImage from '../lazy-image';
const AvatarCard = ({ profile, loading }) => {
@ -54,6 +54,7 @@ const AvatarCard = ({ profile, loading }) => {
AvatarCard.propTypes = {
profile: PropTypes.object,
loading: PropTypes.bool,
};
export default AvatarCard;

View File

@ -1,10 +1,10 @@
import { getDevtoArticle, getMediumArticle } from 'article-api';
import moment from 'moment';
import { Fragment, useEffect, useState } from 'react';
import { CgHashtag } from 'react-icons/cg';
import config from '../../ezprofile.config';
import { ga, skeleton } from '../../helpers/utils';
import LazyImage from '../lazy-image';
import PropTypes from 'prop-types';
const displaySection = () => {
if (
@ -201,4 +201,8 @@ const Blog = ({ loading }) => {
);
};
Blog.propTypes = {
loading: PropTypes.bool,
};
export default Blog;

View File

@ -189,6 +189,15 @@ const Details = ({ profile, loading }) => {
Details.propTypes = {
profile: PropTypes.object,
loading: PropTypes.bool,
};
ListItem.propTypes = {
icon: PropTypes.node,
title: PropTypes.node,
value: PropTypes.node,
link: PropTypes.string,
skeleton: PropTypes.bool,
};
export default Details;

View File

@ -1,7 +1,7 @@
import { GoPrimitiveDot } from 'react-icons/go';
import { skeleton } from '../../helpers/utils';
import config from '../../ezprofile.config';
import { Fragment } from 'react';
import PropTypes from 'prop-types';
const ListItem = ({ time, degree, institution }) => (
<li className="mb-5 ml-4">
@ -79,4 +79,14 @@ const Education = ({ loading }) => {
);
};
Education.propTypes = {
loading: PropTypes.bool,
};
ListItem.propTypes = {
time: PropTypes.node,
degree: PropTypes.node,
institution: PropTypes.node,
};
export default Education;

View File

@ -1,7 +1,7 @@
import { GoPrimitiveDot } from 'react-icons/go';
import { skeleton } from '../../helpers/utils';
import config from '../../ezprofile.config';
import { Fragment } from 'react';
import PropTypes from 'prop-types';
const ListItem = ({ time, position, company }) => (
<li className="mb-5 ml-4">
@ -79,4 +79,14 @@ const Experience = ({ loading }) => {
);
};
ListItem.propTypes = {
time: PropTypes.node,
position: PropTypes.node,
company: PropTypes.node,
};
Experience.propTypes = {
loading: PropTypes.bool,
};
export default Experience;

View File

@ -31,9 +31,9 @@ const HeadTagEditor = ({ profile, theme }) => {
<meta name="description" content={profile.bio} />
<meta itemprop="name" content={`Portfolio of ${profile.name}`} />
<meta itemprop="description" content={profile.bio} />
<meta itemprop="image" content={profile.avatar} />
<meta itemProp="name" content={`Portfolio of ${profile.name}`} />
<meta itemProp="description" content={profile.bio} />
<meta itemProp="image" content={profile.avatar} />
<meta
property="og:url"
@ -60,6 +60,7 @@ const HeadTagEditor = ({ profile, theme }) => {
HeadTagEditor.propTypes = {
profile: PropTypes.object,
theme: PropTypes.string,
};
export default HeadTagEditor;

View File

@ -1,4 +1,5 @@
import { useState, Fragment, useEffect } from 'react';
import PropTypes from 'prop-types';
const LazyImage = ({ placeholder, src, alt, ...rest }) => {
const [loading, setLoading] = useState(true);
@ -19,4 +20,10 @@ const LazyImage = ({ placeholder, src, alt, ...rest }) => {
);
};
LazyImage.propTypes = {
placeholder: PropTypes.node,
alt: PropTypes.string,
src: PropTypes.string,
};
export default LazyImage;

View File

@ -167,6 +167,7 @@ const Project = ({ repo, loading }) => {
Project.propTypes = {
repo: PropTypes.array,
loading: PropTypes.bool,
};
export default Project;

View File

@ -1,5 +1,6 @@
import config from '../../ezprofile.config';
import { skeleton } from '../../helpers/utils';
import PropTypes from 'prop-types';
const Skill = ({ loading }) => {
const renderSkeleton = () => {
@ -50,4 +51,8 @@ const Skill = ({ loading }) => {
);
};
Skill.propTypes = {
loading: PropTypes.bool,
};
export default Skill;

View File

@ -1,6 +1,7 @@
import { AiOutlineControl } from 'react-icons/ai';
import { skeleton } from '../../helpers/utils';
import config from '../../ezprofile.config';
import PropTypes from 'prop-types';
const ThemeChanger = ({ theme, setTheme, loading }) => {
const changeTheme = (e, selectedTheme) => {
@ -88,4 +89,10 @@ const ThemeChanger = ({ theme, setTheme, loading }) => {
);
};
ThemeChanger.propTypes = {
theme: PropTypes.string,
setTheme: PropTypes.func,
loading: PropTypes.bool,
};
export default ThemeChanger;