Validate missing prop types
This commit is contained in:
parent
a2ada305a7
commit
ec458191fb
@ -3,4 +3,4 @@ module.exports = {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -167,6 +167,7 @@ const Project = ({ repo, loading }) => {
|
||||
|
||||
Project.propTypes = {
|
||||
repo: PropTypes.array,
|
||||
loading: PropTypes.bool,
|
||||
};
|
||||
|
||||
export default Project;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user