add PropTypes to components

This commit is contained in:
Dawid Wysokiński 2020-06-30 14:21:18 +02:00
parent ef7f75d768
commit a69d43af36
5 changed files with 34 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import React from "react";
import PropTypes from "prop-types";
import { makeStyles } from "@material-ui/core/styles";
import { AppBar, Toolbar, Typography, Container } from "@material-ui/core";
@ -45,4 +46,9 @@ function Footer({ title, lang }) {
);
}
Footer.propTypes = {
title: PropTypes.string.isRequired,
lang: PropTypes.string.isRequired,
};
export default Footer;

View File

@ -1,4 +1,5 @@
import React, { useState } from "react";
import PropTypes from "prop-types";
import routes from "@config/routes";
import { makeStyles } from "@material-ui/core/styles";
@ -112,4 +113,11 @@ function Header({ twhelpUrl, lang, languages, pathname }) {
);
}
Header.propTypes = {
lang: PropTypes.string.isRequired,
twhelpUrl: PropTypes.string.isRequired,
pathname: PropTypes.string.isRequired,
languages: PropTypes.arrayOf(PropTypes.string),
};
export default Header;

View File

@ -1,4 +1,5 @@
import React from "react";
import PropTypes from "prop-types";
import plFlag from "@images/flags/pl.svg";
import usaFlag from "@images/flags/usa.svg";
@ -60,4 +61,10 @@ function LanguageSelector({ lang, languages, pathname }) {
);
}
Header.propTypes = {
lang: PropTypes.string.isRequired,
pathname: PropTypes.string.isRequired,
languages: PropTypes.arrayOf(PropTypes.string),
};
export default LanguageSelector;

View File

@ -1,4 +1,5 @@
import React from "react";
import PropTypes from "prop-types";
import { Card, CardHeader, CardContent, Typography } from "@material-ui/core";
@ -21,4 +22,11 @@ function Command({ command, commandSyntax, description, example }) {
);
}
Command.propTypes = {
command: PropTypes.string.isRequired,
commandSyntax: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
example: PropTypes.string.isRequired,
};
export default Command;

View File

@ -25,7 +25,11 @@ const NotFoundPage = ({ location, pageContext }) => {
lang={pageContext.langKey}
pathname={location.pathname}
>
<SEO title="404: Not found" location={location.pathname} />
<SEO
title="Page Not found"
description="Page not found"
location={location.pathname}
/>
<Container className={classes.container}>
<Typography gutterBottom variant="h1">
Page Not Found