prop types

This commit is contained in:
Sergey Yarkov 2020-07-21 23:12:29 +03:00
parent ffcb871bde
commit 96f29a1a74
5 changed files with 27 additions and 15 deletions

View File

@ -45,9 +45,3 @@ About.propTypes = {
pageTitle: PropTypes.string,
email: PropTypes.string
}
About.defaultProps = {
title: null,
pageTitle: null,
email: null
}

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types'
import { useLocation } from '@reach/router'
import { Link } from 'gatsby'
@ -19,3 +20,7 @@ const Categories = ({ children, setQuery = () => null }) => {
}
export default Categories
Categories.propTypes = {
setQuery: PropTypes.func
}

View File

@ -28,5 +28,13 @@ const Search = ({ allArticles, filterArticles, articlesLength, resultsLength, qu
export default Search
Search.propTypes = {
articlesLength: PropTypes.number
allArticles: PropTypes.array,
filterArticles: PropTypes.func,
articlesLength: PropTypes.number,
resultsLength: PropTypes.number,
query: PropTypes.string,
setQuery: PropTypes.func,
setFiltredArticles: PropTypes.func,
setLimit: PropTypes.func,
onPage: PropTypes.number
}

View File

@ -70,11 +70,11 @@ export default SEO
SEO.propTypes = {
title: PropTypes.string,
description: PropTypes.string
}
SEO.defaultProps = {
title: null,
description: null
titleTemplate: PropTypes.bool,
keywords: PropTypes.string,
description: PropTypes.string,
image: PropTypes.string,
type: PropTypes.string,
canonical: PropTypes.string
}

View File

@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types'
import firebase from 'gatsby-plugin-firebase';
import incrementViews from '../../lib/increment-views';
@ -29,3 +30,7 @@ const ViewCounter = ({ id }) => {
};
export default ViewCounter;
ViewCounter.propTypes = {
id: PropTypes.string
}